//
// lws_return_http_status from 0x649910 to 0x6499c6 (182 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool __fastcall lws_return_http_status(int a1, int a2, const char *a3)
{
int context; // r0
char *v7; // r5
unsigned int v8; // r4
void *v10; // r0
int v11; // r4
void *v12[2]; // [sp+Ch] [bp-8h] BYREF
context = lws_get_context(a1);
v7 = (char *)(context + 84);
v8 = context + 4164;
v12[0] = (void *)(context + 84);
if ( !a3 )
a3 = &byte_9B1912;
if ( lws_add_http_header_status(a1, a2, v12, v8) )
return 1;
if ( lws_add_http_header_by_token(a1, 0x41u, "libwebsockets", 0xDu, v12, v8) )
return 1;
if ( lws_add_http_header_by_token(a1, 0x1Cu, "text/html", 9u, v12, v8) )
return 1;
if ( lws_finalize_http_header(a1, (_BYTE **)v12, v8) )
return 1;
v10 = (void *)lws_write(a1, (int)v7, (char *)v12[0] - (char *)v7, 8u);
if ( (void *)((char *)v12[0] - (char *)v7) != v10 )
return 1;
v11 = sprintf(v7, "
%u
%s", a2, a3);
return lws_write(a1, (int)v7, v11, 3u) != v11;
}