LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: matchbracketclass
static int matchbracketclass(int c,const char*p,const char*ec){
int sig=1;
if(*(p+1)=='^'){
sig=0;
p++;
}
while(++p<ec){
if(*p=='%'){
p++;
if(match_class(c,uchar(*p)))
return sig;
}
else if((*(p+1)=='-')&&(p+2<ec)){
p+=2;
if(uchar(*(p-2))<=c&&c<=uchar(*p))
return sig;
}
else if(uchar(*p)==c)return sig;
}
return!sig;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x1(%rsi), %r12
cmpb $0x5e, 0x1(%rsi)
sete %r14b
setne %r15b
cmovneq %rsi, %r12
leaq 0x1(%r12), %rax
cmpq %rdx, %rax
jae 0x12f07
movq %rdx, %rbx
movl %edi, %ebp
movzbl 0x1(%r12), %ecx
movzbl 0x2(%r12), %esi
cmpl $0x25, %ecx
jne 0x12ed3
movl %ebp, %edi
callq 0x12fc3
testl %eax, %eax
jne 0x12f04
addq $0x2, %r12
movq %r12, %rax
jmp 0x12ef7
cmpl $0x2d, %esi
jne 0x12ef3
addq $0x3, %r12
cmpq %rbx, %r12
jae 0x12ef3
cmpl %ebp, %ecx
jg 0x12ece
movzbl (%r12), %ecx
movq %r12, %rax
cmpl %ebp, %ecx
jl 0x12ef7
jmp 0x12f04
cmpl %ebp, %ecx
je 0x12f04
movq %rax, %r12
incq %rax
cmpq %rbx, %rax
jb 0x12eae
jmp 0x12f07
movl %r15d, %r14d
movzbl %r14b, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: singlematch
static int singlematch(int c,const char*p,const char*ep){
switch(*p){
case'.':return 1;
case'%':return match_class(c,uchar(*(p+1)));
case'[':return matchbracketclass(c,p,ep-1);
default:return(uchar(*p)==c);
}
}

// Assembly:
movzbl (%rsi), %ecx
cmpl $0x5b, %ecx
je 0x12f35
cmpl $0x2e, %ecx
je 0x12f2f
cmpl $0x25, %ecx
jne 0x12f3d
movzbl 0x1(%rsi), %esi
jmp 0x12fc3
movl $0x1, %eax
retq
decq %rdx
jmp 0x12e83
xorl %eax, %eax
cmpl %edi, %ecx
sete %al
retq
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: max_expand
static const char*max_expand(MatchState*ms,const char*s,
const char*p,const char*ep){
ptrdiff_t i=0;
while((s+i)<ms->src_end&&singlematch(uchar(*(s+i)),p,ep))
i++;
while(i>=0){
const char*res=match(ms,(s+i),ep+1);
if(res)return res;
i--;
}
return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rbp
subq %rsi, %rbp
jbe 0x12f86
movq %rdx, %r12
xorl %r13d, %r13d
movzbl (%r14,%r13), %edi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x12f14
testl %eax, %eax
je 0x12f89
incq %r13
cmpq %r13, %rbp
jne 0x12f68
jmp 0x12f89
xorl %r13d, %r13d
incq %rbx
testq %r13, %r13
js 0x12fae
leaq (%r14,%r13), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x1292a
decq %r13
testq %rax, %rax
cmovneq %rax, %r12
je 0x12f8c
jmp 0x12fb1
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: match_class
static int match_class(int c,int cl){
int res;
switch(tolower(cl)){
case'a':res=isalpha(c);break;
case'c':res=iscntrl(c);break;
case'd':res=isdigit(c);break;
case'l':res=islower(c);break;
case'p':res=ispunct(c);break;
case's':res=isspace(c);break;
case'u':res=isupper(c);break;
case'w':res=isalnum(c);break;
case'x':res=isxdigit(c);break;
case'z':res=(c==0);break;
default:return(cl==c);
}
return(islower(cl)?res:!res);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl %esi, %edi
callq 0x31c0
cmpl $0x6b, %eax
jle 0x1300e
addl $-0x6c, %eax
cmpl $0xe, %eax
ja 0x13112
leaq 0x13f6(%rip), %rcx      # 0x143e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x200, %r14d           # imm = 0x200
jmp 0x130f2
cmpl $0x61, %eax
je 0x130c7
cmpl $0x63, %eax
je 0x130df
cmpl $0x64, %eax
jne 0x13112
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x800, %r14d           # imm = 0x800
jmp 0x130f2
xorl %r14d, %r14d
testl %ebp, %ebp
sete %r14b
jmp 0x130f2
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x100, %r14d           # imm = 0x100
jmp 0x130f2
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x1000, %r14d          # imm = 0x1000
jmp 0x130f2
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x2000, %r14d          # imm = 0x2000
jmp 0x130f2
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x4, %r14d
jmp 0x130f2
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x8, %r14d
jmp 0x130f2
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x400, %r14d           # imm = 0x400
jmp 0x130f2
callq 0x32f0
movq (%rax), %rax
movl %ebp, %ecx
movzwl (%rax,%rcx,2), %r14d
andl $0x2, %r14d
callq 0x32f0
movq (%rax), %rcx
movl %ebx, %edx
xorl %eax, %eax
testl %r14d, %r14d
sete %al
testb $0x2, 0x1(%rcx,%rdx,2)
cmovnel %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
cmpl %ebp, %ebx
sete %al
jmp 0x1310d
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: push_onecapture
static void push_onecapture(MatchState*ms,int i,const char*s,
const char*e){
if(i>=ms->level){
if(i==0)
lua_pushlstring(ms->L,s,e-s);
else
luaL_error(ms->L,"invalid capture index");
}
else{
ptrdiff_t l=ms->capture[i].len;
if(l==(-1))luaL_error(ms->L,"unfinished capture");
if(l==(-2))
lua_pushinteger(ms->L,ms->capture[i].init-ms->src_init+1);
else
lua_pushlstring(ms->L,ms->capture[i].init,l);
}
}

// Assembly:
pushq %rax
movq %rdi, %rax
cmpl %esi, 0x18(%rdi)
jle 0x1314b
movslq %esi, %rcx
shlq $0x4, %rcx
addq %rax, %rcx
addq $0x20, %rcx
movq 0x8(%rcx), %rdx
movq 0x10(%rax), %rdi
cmpq $-0x2, %rdx
je 0x13162
cmpq $-0x1, %rdx
je 0x1318f
movq (%rcx), %rsi
jmp 0x1315c
movq 0x10(%rax), %rdi
testl %esi, %esi
jne 0x13186
subq %rdx, %rcx
movq %rdx, %rsi
movq %rcx, %rdx
popq %rax
jmp 0x90a1
movq (%rcx), %rcx
subq (%rax), %rcx
incq %rcx
movq 0x10(%rdi), %rax
cvtsi2sd %rcx, %xmm0
movsd %xmm0, (%rax)
movl $0x3, 0x8(%rax)
addq $0x10, 0x10(%rdi)
popq %rax
retq
leaq 0x1fdb(%rip), %rsi      # 0x15168
jmp 0x13196
leaq 0x1fe8(%rip), %rsi      # 0x1517e
xorl %eax, %eax
callq 0xa049
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: luaL_checknumber
static lua_Number luaL_checknumber(lua_State*L,int narg){
lua_Number d=lua_tonumber(L,narg);
if(d==0&&!lua_isnumber(L,narg))
tag_error(L,narg,3);
return d;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0xf8db
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x131cf
jp 0x131cf
movq %r14, %rdi
movl %ebx, %esi
movsd %xmm0, (%rsp)
callq 0xa7de
movsd (%rsp), %xmm0
testl %eax, %eax
je 0x131d7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1523(%rip), %rdx      # 0x14701
movq %r14, %rdi
movl %ebx, %esi
callq 0xa6d4
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: gmatch_aux
static int gmatch_aux(lua_State*L){
MatchState ms;
size_t ls;
const char*s=lua_tolstring(L,lua_upvalueindex(1),&ls);
const char*p=lua_tostring(L,lua_upvalueindex(2));
const char*src;
ms.L=L;
ms.src_init=s;
ms.src_end=s+ls;
for(src=s+(size_t)lua_tointeger(L,lua_upvalueindex(3));
src<=ms.src_end;
src++){
const char*e;
ms.level=0;
if((e=match(&ms,src,p))!=NULL){
lua_Integer newstart=e-s;
if(e==src)newstart++;
lua_pushinteger(L,newstart);
lua_replace(L,lua_upvalueindex(3));
return push_captures(&ms,src,e);
}
}
return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movl $0xffffd8ed, %esi       # imm = 0xFFFFD8ED
movq %r14, %rdx
callq 0x3c5a
movq %rax, %rbp
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0xffffd8ec, %esi       # imm = 0xFFFFD8EC
xorl %edx, %edx
callq 0x3c5a
movq %rax, %r12
movq %rbx, 0x28(%rsp)
movq %rbp, 0x18(%rsp)
movq (%r14), %r14
leaq (%rbp,%r14), %rax
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movl $0xffffd8eb, %esi       # imm = 0xFFFFD8EB
callq 0xa7af
cmpq %r14, %rax
jg 0x132e2
movq %rax, %r13
movq %rbp, 0x8(%rsp)
addq %rbp, %r13
leaq 0x18(%rsp), %rbp
movl $0x0, 0x30(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1292a
movq %rax, %r14
testq %rax, %rax
je 0x132ce
movq %r14, %rax
subq 0x8(%rsp), %rax
xorl %ecx, %ecx
cmpq %r14, %r13
sete %cl
addq %rax, %rcx
movq 0x10(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
movsd %xmm0, (%rax)
movl $0x3, 0x8(%rax)
addq $0x10, 0x10(%rbx)
movq %rbx, %rdi
movl $0xffffd8eb, %esi       # imm = 0xFFFFD8EB
callq 0x10651
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x12d64
movl %eax, %r15d
testq %r14, %r14
jne 0x132e2
incq %r13
cmpq 0x20(%rsp), %r13
jbe 0x13263
xorl %r15d, %r15d
jmp 0x132e2
movl %r15d, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: luaL_findtable
static const char*luaL_findtable(lua_State*L,int idx,
const char*fname,int szhint){
const char*e;
lua_pushvalue(L,idx);
do{
e=strchr(fname,'.');
if(e==NULL)e=fname+strlen(fname);
lua_pushlstring(L,fname,e-fname);
lua_rawget(L,-2);
if(lua_isnil(L,-1)){
lua_pop(L,1);
lua_createtable(L,0,(*e=='.'?1:szhint));
lua_pushlstring(L,fname,e-fname);
lua_pushvalue(L,-2);
lua_settable(L,-4);
}
else if(!lua_istable(L,-1)){
lua_pop(L,2);
return fname;
}
lua_remove(L,-2);
fname=e+1;
}while(*e=='.');
return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movq %rdx, %r14
movq %rdi, %rbx
callq 0x975f
movq 0x10(%rbx), %rcx
movq (%rax), %rdx
movq %rdx, (%rcx)
movl 0x8(%rax), %eax
movl %eax, 0x8(%rcx)
addq $0x10, 0x10(%rbx)
leaq 0x10f3(%rip), %r13      # 0x14420
movq %r14, %rdi
movl $0x2e, %esi
callq 0x30f0
movq %rax, %r15
testq %rax, %rax
jne 0x13350
movq %r14, %rdi
callq 0x30e0
movq %rax, %r15
addq %r14, %r15
movq %r15, %r12
subq %r14, %r12
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x90a1
movq 0x10(%rbx), %rbp
movq -0x20(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x759e
movq (%rax), %rcx
movq %rcx, -0x10(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movq 0x10(%rbx), %rax
leaq -0x10(%rax), %rcx
cmpq %r13, %rcx
je 0x13425
cmpl $0x0, -0x8(%rax)
je 0x133aa
cmpq %r13, %rcx
je 0x13425
cmpl $0x5, -0x8(%rax)
je 0x13405
jmp 0x13425
movq %rcx, 0x10(%rbx)
cmpb $0x2e, (%r15)
movl $0x1, %esi
je 0x133bd
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x38a8
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x90a1
movq 0x10(%rbx), %rax
movq -0x20(%rax), %rcx
movq %rcx, (%rax)
movl -0x18(%rax), %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rbx), %rcx
leaq 0x10(%rcx), %rax
movq %rax, 0x10(%rbx)
leaq -0x30(%rcx), %rsi
leaq -0x10(%rcx), %rdx
movq %rbx, %rdi
callq 0x6fc6
addq $-0x20, 0x10(%rbx)
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0xf9ff
leaq 0x1(%r15), %r14
cmpb $0x2e, (%r15)
je 0x1332d
xorl %r14d, %r14d
jmp 0x1342d
addq $-0x20, %rax
movq %rax, 0x10(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: tohex
static int tohex(lua_State*L){
UB b=barg(L,1);
int n=lua_isnone(L,2)?8:(int)barg(L,2);
const char*hexdigits="0123456789abcdef";
char buf[8];
int i;
if(n<0){n=-n;hexdigits="0123456789ABCDEF";}
if(n>8)n=8;
for(i=(int)n;--i>=0;){buf[i]=hexdigits[b&15];b>>=4;}
lua_pushlstring(L,buf,(size_t)n);
return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
callq 0x1380c
movl %eax, %ebp
movq 0x18(%rbx), %rcx
leaq 0x10(%rcx), %rax
cmpq 0x10(%rbx), %rax
setae %dl
leaq 0xca8(%rip), %rsi       # 0x14420
cmpq %rsi, %rax
sete %al
orb %dl, %al
movl $0x8, %eax
jne 0x1379a
cmpl $-0x1, 0x18(%rcx)
je 0x1379a
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1380c
leaq 0x1b1c(%rip), %rdx      # 0x152bd
leaq 0x1b04(%rip), %rcx      # 0x152ac
testl %eax, %eax
cmovsq %rdx, %rcx
je 0x137e3
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
cmpl $0x8, %edx
movl $0x8, %esi
cmovll %edx, %esi
leal 0x1(%rsi), %edx
decl %esi
addq %rsp, %rsi
movl %ebp, %edi
andl $0xf, %edi
movb (%rcx,%rdi), %dil
movb %dil, (%rsi)
shrl $0x4, %ebp
decl %edx
decq %rsi
cmpl $0x1, %edx
jg 0x137ca
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl $0x8, %ecx
movl $0x8, %edx
cmovll %ecx, %edx
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x90a1
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: barg
static UB barg(lua_State*L,int idx){
union{lua_Number n;U64 b;}bn;
bn.n=lua_tonumber(L,idx)+6755399441055744.0;
if(bn.n==0.0&&!lua_isnumber(L,idx))luaL_typerror(L,idx,"number");
return(UB)bn.b;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0xf8db
addsd 0xdb6(%rip), %xmm0      # 0x145d8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x13846
jp 0x13846
movq %r14, %rdi
movl %ebx, %esi
movsd %xmm0, (%rsp)
callq 0xa7de
movsd (%rsp), %xmm0
testl %eax, %eax
je 0x13853
movq %xmm0, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xea7(%rip), %rdx       # 0x14701
movq %r14, %rdi
movl %ebx, %esi
callq 0xa6d4
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: errfile
static int errfile(lua_State*L,const char*what,int fnameindex){
const char*serr=strerror(errno);
const char*filename=lua_tostring(L,fnameindex)+1;
lua_pushfstring(L,"cannot %s %s: %s",what,filename,serr);
lua_remove(L,fnameindex);
return(5+1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
callq 0x3050
movl (%rax), %edi
callq 0x32c0
movq %rax, %r12
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x3c5a
leaq 0x1(%rax), %rcx
leaq 0x1a49(%rip), %rsi      # 0x152e3
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %r8
xorl %eax, %eax
callq 0xa5f8
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xf9ff
// File: /workspace/github_c_makefile_star2_O1/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: getF
static const char*getF(lua_State*L,void*ud,size_t*size){
LoadF*lf=(LoadF*)ud;
(void)L;
if(lf->extraline){
lf->extraline=0;
*size=1;
return"\n";
}
if(feof(lf->f))return NULL;
*size=fread(lf->buff,1,sizeof(lf->buff),lf->f);
return(*size>0)?lf->buff:NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
cmpl $0x0, (%rsi)
je 0x138e4
movl $0x0, (%rbx)
movq $0x1, (%r14)
leaq 0x1018(%rip), %rbx      # 0x148fa
jmp 0x13919
movq 0x8(%rbx), %rdi
callq 0x3190
testl %eax, %eax
je 0x138f5
xorl %ebx, %ebx
jmp 0x13919
movq 0x8(%rbx), %rcx
addq $0x10, %rbx
movl $0x1, %esi
movl $0x2000, %edx           # imm = 0x2000
movq %rbx, %rdi
callq 0x30a0
movq %rax, (%r14)
testq %rax, %rax
cmoveq %rax, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.13/spin-condvar.c
// Function: main
int main(){
	int i, flag_is_set;
	pthread_t thread_id;
	char option;

	initialize_flag();

	pthread_create(&thread_id, NULL, &thread_function, NULL);

	printf("Presione enter para empezar a generar listas aleatorias...\n");

	getchar();

	do{
		set_thread_flag(1);

		while(get_thread_flag());

		for(i = 0; i < TAM; ++i)
			printf("%d, ", lista_random[i]);

		printf("\nGenerar otra?: (s/n)\n");
		scanf("%c", &option);
		getchar();
		printf("\n");

	}while(option == 's');

	printf("\nPrograma finalizado!\n");
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x2eec(%rip), %rbx      # 0x40f0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x0, 0x2f00(%rip)      # 0x4118
leaq 0xd4(%rip), %rdx        # 0x12f3
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x10a0
leaq 0xdd9(%rip), %rdi       # 0x200c
callq 0x1040
callq 0x1070
leaq 0x2e5c(%rip), %r15      # 0x40a0
leaq 0xdb9(%rip), %r14       # 0x2004
leaq -0x29(%rbp), %r13
movq %rbx, %rdi
callq 0x10d0
movl $0x1, 0x2eb7(%rip)      # 0x4118
movq %rbx, %rdi
callq 0x1090
movq %rbx, %rdi
callq 0x10d0
movl 0x2ea0(%rip), %r12d     # 0x4118
movq %rbx, %rdi
callq 0x1090
testl %r12d, %r12d
jne 0x1269
xorl %r12d, %r12d
movl (%r12,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
addq $0x4, %r12
cmpq $0x50, %r12
jne 0x1288
leaq 0xda0(%rip), %rdi       # 0x2047
callq 0x1040
leaq 0xd56(%rip), %rdi       # 0x2009
movq %r13, %rsi
xorl %eax, %eax
callq 0x10b0
callq 0x1070
movl $0xa, %edi
callq 0x1030
cmpb $0x73, -0x29(%rbp)
je 0x124f
leaq 0xd80(%rip), %rdi       # 0x205d
callq 0x1040
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.13/spin-condvar.c
// Function: thread_function
void* thread_function (void* thread_arg){
	srand(time(NULL));
	while (1) {
		if (get_thread_flag())
			do_work ();
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %edi, %edi
callq 0x1080
movl %eax, %edi
callq 0x1060
leaq 0x2de1(%rip), %rbx      # 0x40f0
movq %rbx, %rdi
callq 0x10d0
movl 0x2dfa(%rip), %r14d     # 0x4118
movq %rbx, %rdi
callq 0x1090
testl %r14d, %r14d
je 0x130f
callq 0x137a
jmp 0x130f
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.13/spin-condvar.c
// Function: do_work
void do_work(){
	int i;
	for(i = 0; i < TAM; ++i)
		lista_random[i] = rand() % 100;
	set_thread_flag(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %ebx, %ebx
leaq 0x2d16(%rip), %r14      # 0x40a0
callq 0x10e0
cltq
imulq $0x51eb851f, %rax, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
imull $0x64, %ecx, %ecx
subl %ecx, %eax
movl %eax, (%rbx,%r14)
addq $0x4, %rbx
cmpq $0x50, %rbx
jne 0x138a
leaq 0x2d31(%rip), %rbx      # 0x40f0
movq %rbx, %rdi
callq 0x10d0
movl $0x0, 0x2d47(%rip)      # 0x4118
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O1/ramirezsebas[P]TP-LISTINGS/./src/capitulo_4/4.13/spin-condvar.c
// Function: get_thread_flag
int get_thread_flag(){
	int flag_is_set;
	/* Protect the flag with a mutex lock. */
	pthread_mutex_lock (&thread_flag_mutex);
	flag_is_set = thread_flag;
	pthread_mutex_unlock (&thread_flag_mutex);

	return flag_is_set;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x2d05(%rip), %rbx      # 0x40f0
movq %rbx, %rdi
callq 0x10d0
movl 0x2d1e(%rip), %r14d     # 0x4118
movq %rbx, %rdi
callq 0x1090
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/demo/output.c
// Function: main
int main(int argc, char **argv) {
    (void)argc; (void)argv;
    int ret = tb_init();
    if (ret) {
        fprintf(stderr, "tb_init() failed with error code %d\n", ret);
        return 1;
    }

    draw_all();

    struct tb_event ev;
    while (tb_poll_event(&ev)) {
        switch (ev.type) {
        case TB_EVENT_KEY:
            switch (ev.key) {
            case TB_KEY_ESC:
                goto done;
                break;
            }
            break;
        case TB_EVENT_RESIZE:
            draw_all();
            break;
        }
    }
done:
    tb_shutdown();
    return 0;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
callq 0x3e67
testl %eax, %eax
jne 0x33d9
callq 0x33fa
leaq 0x8(%rsp), %rdi
callq 0x486e
testl %eax, %eax
je 0x33cc
leaq 0x8(%rsp), %rbx
movzbl 0x8(%rsp), %eax
cmpl $0x2, %eax
je 0x33bb
cmpl $0x1, %eax
jne 0x33c0
cmpw $0x1b, 0xa(%rsp)
jne 0x33c0
jmp 0x33cc
callq 0x33fa
movq %rbx, %rdi
callq 0x486e
testl %eax, %eax
jne 0x33a2
callq 0x3e83
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
retq
movq 0x5c10(%rip), %rcx      # 0x8ff0
movq (%rcx), %rdi
leaq 0x2c1a(%rip), %rsi      # 0x6004
movl %eax, %edx
xorl %eax, %eax
callq 0x3160
movl $0x1, %eax
jmp 0x33d3
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/demo/output.c
// Function: draw_all
static void draw_all() {
    tb_clear();

    tb_select_output_mode(TB_OUTPUT_NORMAL);
    static const uint16_t col1[] = {0, TB_BOLD};
    static const uint16_t col2[] = {TB_REVERSE};
    print_combinations_table(1, 1, col1, 2);
    print_combinations_table(2 + strlen(chars), 1, col2, 1);
    tb_present();

    tb_select_output_mode(TB_OUTPUT_GRAYSCALE);
    int c, x, y;
    for (x = 0, y = 23; x < 24; ++x) {
        tb_change_cell(x, y, '@', x, 0);
        tb_change_cell(x+25, y, ' ', 0, x);
    }
    tb_present();

    tb_select_output_mode(TB_OUTPUT_216);
    y++;
    for (c = 0, x = 0; c < 216; ++c, ++x) {
        if (!(x%24)) {
            x = 0;
            ++y;
        }
        tb_change_cell(x, y, '@', c, 0);
        tb_change_cell(x+25, y, ' ', 0, c);
    }
    tb_present();

    tb_select_output_mode(TB_OUTPUT_256);
    y++;
    for (c = 0, x = 0; c < 256; ++c, ++x) {
        if (!(x%24)) {
            x = 0;
            ++y;
        }
        tb_change_cell(x, y, '+', c | ((y & 1) ? TB_UNDERLINE : 0), 0);
        tb_change_cell(x+25, y, ' ', 0, c);
    }
    tb_present();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x4aef
movl $0x1, %edi
callq 0x4bc3
leaq 0x2c13(%rip), %rsi      # 0x602a
movl $0x1, %edi
movl $0x2, %edx
callq 0x3595
leaq 0x2c01(%rip), %rsi      # 0x602e
movl $0x26, %edi
movl $0x1, %edx
callq 0x3595
callq 0x4045
movl $0x4, %edi
callq 0x4bc3
xorl %ebx, %ebx
movzwl %bx, %ebp
movl %ebx, %edi
movl $0x17, %esi
movl $0x40, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x4745
leal 0x19(%rbx), %edi
movl $0x17, %esi
movl $0x20, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x4745
incl %ebx
cmpl $0x18, %ebx
jne 0x344d
callq 0x4045
movl $0x3, %edi
callq 0x4bc3
xorl %eax, %eax
movl $0x18, %ebx
xorl %r15d, %r15d
imull $0xaaaaaaab, %eax, %ecx # imm = 0xAAAAAAAB
addl $0x2aaaaaa8, %ecx       # imm = 0x2AAAAAA8
rorl $0x3, %ecx
movl $0x0, %r14d
cmpl $0xaaaaaab, %ecx        # imm = 0xAAAAAAB
jb 0x34bd
movl %eax, %r14d
adcl $0x0, %ebx
movzwl %r15w, %ebp
movl %r14d, %edi
movl %ebx, %esi
movl $0x40, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x4745
leal 0x19(%r14), %edi
movl %ebx, %esi
movl $0x20, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x4745
incl %r15d
incl %r14d
movl %r14d, %eax
cmpl $0xd8, %r15d
jne 0x349d
callq 0x4045
movl $0x2, %edi
callq 0x4bc3
incl %ebx
xorl %eax, %eax
movl $0xffff, %ebp           # imm = 0xFFFF
xorl %r15d, %r15d
imull $0xaaaaaaab, %eax, %ecx # imm = 0xAAAAAAAB
addl $0x2aaaaaa8, %ecx       # imm = 0x2AAAAAA8
rorl $0x3, %ecx
movl $0x0, %r14d
cmpl $0xaaaaaab, %ecx        # imm = 0xAAAAAAB
jb 0x353a
movl %eax, %r14d
adcl $0x0, %ebx
movl %ebx, %ecx
andl $0x1, %ecx
shll $0x9, %ecx
addl %r15d, %ecx
andl %ebp, %ecx
movl %r14d, %edi
movl %ebx, %esi
movl $0x2b, %edx
xorl %r8d, %r8d
callq 0x4745
leal 0x19(%r14), %edi
movl %r15d, %r8d
andl %ebp, %r8d
movl %ebx, %esi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x4745
incl %r15d
incl %r14d
movl %r14d, %eax
cmpl $0x100, %r15d           # imm = 0x100
jne 0x351a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4045
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/demo/output.c
// Function: print_combinations_table
static void print_combinations_table(int sx, int sy, const uint16_t *attrs, int attrs_n) {
    int i, c;
    for (i = 0; i < attrs_n; i++) {
        for (c = TB_DEFAULT; c <= TB_WHITE; c++) {
            uint16_t bg = attrs[i] | c;
            draw_line(sx, sy, bg);
            sy++;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x28(%rsp)
movl %edi, 0x14(%rsp)
testl %edx, %edx
jle 0x367d
movl %edx, %eax
movq %rax, 0x20(%rsp)
movl $0x1, %r15d
leaq 0x2a78(%rip), %r14      # 0x6040
movq $0x0, 0x8(%rsp)
xorl %esi, %esi
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rdx
movzwl (%rax,%rdx,2), %eax
movl %esi, 0x18(%rsp)
orw %si, %ax
xorl %edx, %edx
movzwl %ax, %r12d
movl 0x14(%rsp), %eax
movl %eax, %ebx
xorl %ebp, %ebp
leaq 0x2a33(%rip), %rax      # 0x6030
movq %rdx, 0x30(%rsp)
movzwl (%rax,%rdx,2), %eax
movl %eax, 0x1c(%rsp)
xorl %r13d, %r13d
leal (%rbx,%r13), %edi
movl 0x1c(%rsp), %eax
orl %r13d, %eax
movslq %ebp, %rbp
movsbl (%rbp,%r14), %edx
movzwl %ax, %ecx
movl %r15d, %esi
movl %r12d, %r8d
callq 0x4745
xorl %eax, %eax
incl %ebp
cmpl $0x24, %ebp
cmovel %eax, %ebp
incl %r13d
cmpl $0x9, %r13d
jne 0x360d
movq 0x30(%rsp), %rdx
incq %rdx
addl %r13d, %ebx
cmpq $0x4, %rdx
jne 0x35f6
incl %r15d
movl 0x18(%rsp), %esi
incl %esi
cmpl $0x9, %esi
jne 0x35d3
movq 0x8(%rsp), %rdx
incq %rdx
movq %rdx, 0x8(%rsp)
cmpq 0x20(%rsp), %rdx
jne 0x35d1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: send_clear
static void send_clear(void) {
    send_attr(foreground, background);
    bytebuffer_puts(&output_buffer, funcs[T_CLEAR_SCREEN]);
    if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y))
        write_cursor(cursor_x, cursor_y);
    bytebuffer_flush(&output_buffer, inout);

    /* we need to invalidate cursor position too and these two vars are
     * used only for simple cursor positioning optimization, cursor
     * actually may be in the correct place, but we simply discard
     * optimization once and it gives us simple solution for the case when
     * cursor moved */
    lastx = LAST_COORD_INIT;
    lasty = LAST_COORD_INIT;
}

// Assembly:
pushq %rbx
movzwl 0x5c01(%rip), %edi      # 0x9924
movzwl 0x5bfc(%rip), %esi      # 0x9926
callq 0x42ba
movq 0x5bc2(%rip), %rax      # 0x98f8
movq 0x20(%rax), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movl 0x53fe(%rip), %edi      # 0x9150
cmpl $-0x1, %edi
sete %al
movl 0x53f6(%rip), %esi      # 0x9154
cmpl $-0x1, %esi
sete %cl
orb %al, %cl
jne 0x3d6d
callq 0x45e9
movl 0x5b1d(%rip), %edi      # 0x9890
movq 0x5b6e(%rip), %rsi      # 0x98e8
movslq 0x5b6f(%rip), %rdx      # 0x98f0
callq 0x30a0
movl $0x0, 0x5b60(%rip)      # 0x98f0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x53ad(%rip)      # 0x9148
movl %eax, 0x53ab(%rip)      # 0x914c
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: update_term_size
static void update_term_size(void) {
    struct winsize sz;
    memset(&sz, 0, sizeof(sz));

    ioctl(inout, TIOCGWINSZ, &sz);

    termw = sz.ws_col > 0 ? sz.ws_col : 80;
    termh = sz.ws_row > 0 ? sz.ws_row : 24;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rbx
movq $0x0, (%rbx)
movl 0x5ad6(%rip), %edi      # 0x9890
movl $0x5413, %esi           # imm = 0x5413
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3110
movzwl 0x2(%rbx), %eax
testw %ax, %ax
movl $0x50, %ecx
cmovnel %eax, %ecx
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %ecx
movl %ecx, 0x535b(%rip)      # 0x9140
movl (%rbx), %ecx
testw %cx, %cx
movl $0x18, %edx
cmovnel %ecx, %edx
andl %eax, %edx
movl %edx, 0x534a(%rip)      # 0x9144
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: cellbuf_init
static void cellbuf_init(struct cellbuf *buf, int width, int height) {
    buf->cells =
        (struct tb_cell *)malloc(sizeof(struct tb_cell) * width * height);
    assert(buf->cells);
    buf->width = width;
    buf->height = height;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movslq %esi, %rax
movslq %edx, %rdi
imulq %rax, %rdi
shlq $0x3, %rdi
callq 0x31b0
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x3e33
movl %ebp, (%r14)
movl %ebx, 0x4(%r14)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2531(%rip), %rdi      # 0x636b
leaq 0x2535(%rip), %rsi      # 0x6376
leaq 0x2538(%rip), %rcx      # 0x6380
movl $0x3ff, %edx            # imm = 0x3FF
callq 0x30e0
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: tb_shutdown
void tb_shutdown(void) {
    if (termw == -1) {
        fputs("tb_shutdown() should not be called twice.", stderr);
        abort();
    }

    bytebuffer_puts(&output_buffer, funcs[T_SHOW_CURSOR]);
    bytebuffer_puts(&output_buffer, funcs[T_SGR0]);
    bytebuffer_puts(&output_buffer, funcs[T_CLEAR_SCREEN]);
    bytebuffer_puts(&output_buffer, funcs[T_EXIT_CA]);
    bytebuffer_puts(&output_buffer, funcs[T_EXIT_KEYPAD]);
    bytebuffer_puts(&output_buffer, funcs[T_EXIT_MOUSE]);
    bytebuffer_flush(&output_buffer, inout);
    tcsetattr(inout, TCSAFLUSH, &orig_tios);

    shutdown_term();
    close(inout);
    close(winch_fds[0]);
    close(winch_fds[1]);

    cellbuf_free(&back_buffer);
    cellbuf_free(&front_buffer);
    bytebuffer_free(&output_buffer);
    bytebuffer_free(&input_buffer);
    termw = termh = -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $-0x1, 0x52b1(%rip)     # 0x9140
je 0x4040
movq 0x5a5c(%rip), %rax      # 0x98f8
movq 0x10(%rax), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movq 0x5a3f(%rip), %rax      # 0x98f8
movq 0x28(%rax), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movq 0x5a22(%rip), %rax      # 0x98f8
movq 0x20(%rax), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movq 0x5a05(%rip), %rax      # 0x98f8
movq 0x8(%rax), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movq 0x59e8(%rip), %rax      # 0x98f8
movq 0x58(%rax), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movq 0x59cb(%rip), %rax      # 0x98f8
movq 0x68(%rax), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movl 0x5947(%rip), %edi      # 0x9890
movq 0x5998(%rip), %rsi      # 0x98e8
movslq 0x5999(%rip), %rdx      # 0x98f0
callq 0x30a0
movl $0x0, 0x598a(%rip)      # 0x98f0
movl 0x5924(%rip), %edi      # 0x9890
leaq 0x5929(%rip), %rdx      # 0x989c
movl $0x2, %esi
callq 0x31f0
cmpb $0x1, 0x59a4(%rip)      # 0x9928
jne 0x3fce
movq 0x59a3(%rip), %rbx      # 0x9930
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x3040
incq %r14
cmpq $0x16, %r14
jne 0x3f90
movq 0x594f(%rip), %r14      # 0x98f8
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x3040
incq %r15
cmpq $0xc, %r15
jne 0x3fac
movq %rbx, %rdi
callq 0x3040
movq %r14, %rdi
callq 0x3040
movl 0x58bc(%rip), %edi      # 0x9890
callq 0x3120
movl 0x58b5(%rip), %edi      # 0x9894
callq 0x3120
movl 0x58ae(%rip), %edi      # 0x9898
callq 0x3120
movq 0x5912(%rip), %rdi      # 0x9908
callq 0x3040
movq 0x5916(%rip), %rdi      # 0x9918
callq 0x3040
movq 0x58da(%rip), %rdi      # 0x98e8
testq %rdi, %rdi
je 0x4018
callq 0x3040
movq 0x58b9(%rip), %rdi      # 0x98d8
testq %rdi, %rdi
je 0x4029
callq 0x3040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0x5110(%rip)      # 0x9144
movl %eax, 0x5106(%rip)      # 0x9140
popq %rbx
popq %r14
popq %r15
retq
callq 0x3270
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: update_size
static void update_size(void) {
    update_term_size();
    cellbuf_resize(&back_buffer, termw, termh);
    cellbuf_resize(&front_buffer, termw, termh);
    cellbuf_clear(&front_buffer);
    send_clear();
}

// Assembly:
pushq %rax
callq 0x3da3
movl 0x4ef9(%rip), %esi      # 0x9140
movl 0x4ef7(%rip), %edx      # 0x9144
leaq 0x56ac(%rip), %rdi      # 0x9900
callq 0x4e04
movl 0x4ee1(%rip), %esi      # 0x9140
movl 0x4edf(%rip), %edx      # 0x9144
leaq 0x56a4(%rip), %rdi      # 0x9910
callq 0x4e04
movl 0x569d(%rip), %esi      # 0x9914
imull 0x5692(%rip), %esi      # 0x9910
testl %esi, %esi
jle 0x42b4
movq 0x568f(%rip), %rax      # 0x9918
movzwl 0x5694(%rip), %ecx      # 0x9924
movzwl 0x568f(%rip), %edx      # 0x9926
movl %esi, %esi
xorl %edi, %edi
movl $0x20, (%rax,%rdi,8)
movw %cx, 0x4(%rax,%rdi,8)
movw %dx, 0x6(%rax,%rdi,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x429b
popq %rax
jmp 0x3d1b
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: send_char
static void send_char(int x, int y, uint32_t c) {
    char buf[7];
    int bw = tb_utf8_unicode_to_char(buf, c);
    if (x - 1 != lastx || y != lasty)
        write_cursor(x, y);
    lastx = x;
    lasty = y;
    if (!c)
        buf[0] = ' '; // replace 0 with whitespace
    bytebuffer_append(&output_buffer, buf, bw);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
leaq 0x1(%rsp), %rdi
movl %edx, %esi
callq 0x5571
movl %eax, %ebx
leal -0x1(%r15), %eax
cmpl 0x4ba3(%rip), %eax      # 0x9148
jne 0x45b0
cmpl %r14d, 0x4b9e(%rip)     # 0x914c
je 0x45bb
movl %r15d, %edi
movl %r14d, %esi
callq 0x45e9
movl %r15d, 0x4b86(%rip)     # 0x9148
movl %r14d, 0x4b83(%rip)     # 0x914c
testl %ebp, %ebp
jne 0x45d2
movb $0x20, 0x1(%rsp)
leaq 0x1(%rsp), %rdi
movl %ebx, %esi
callq 0x4d36
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: write_cursor
static void write_cursor(int x, int y) {
    char buf[32];
    WRITE_LITERAL("\033[");
    WRITE_INT(y + 1);
    WRITE_LITERAL(";");
    WRITE_INT(x + 1);
    WRITE_LITERAL("H");
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movl %edi, %ebx
leaq 0x1d6c(%rip), %rdi      # 0x6368
movl $0x2, %esi
callq 0x4d36
incl %ebp
movq %rsp, %r14
movl %ebp, %edi
movq %r14, %rsi
callq 0x4da4
movq %r14, %rdi
movl %eax, %esi
callq 0x4d36
leaq 0x1d8c(%rip), %rdi      # 0x63b2
movl $0x1, %esi
callq 0x4d36
incl %ebx
movl %ebx, %edi
movq %r14, %rsi
callq 0x4da4
movq %r14, %rdi
movl %eax, %esi
callq 0x4d36
leaq 0x1c6f(%rip), %rdi      # 0x62bc
movl $0x1, %esi
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4d36
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: tb_set_cursor
void tb_set_cursor(int cx, int cy) {
    if (IS_CURSOR_HIDDEN(cursor_x, cursor_y) && !IS_CURSOR_HIDDEN(cx, cy))
        bytebuffer_puts(&output_buffer, funcs[T_SHOW_CURSOR]);

    if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y) && IS_CURSOR_HIDDEN(cx, cy))
        bytebuffer_puts(&output_buffer, funcs[T_HIDE_CURSOR]);

    cursor_x = cx;
    cursor_y = cy;
    if (!IS_CURSOR_HIDDEN(cursor_x, cursor_y))
        write_cursor(cursor_x, cursor_y);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
cmpl $-0x1, 0x4adf(%rip)     # 0x9150
setne %al
cmpl $-0x1, 0x4ad9(%rip)     # 0x9154
setne %cl
cmpl $-0x1, %esi
je 0x46a9
cmpl $-0x1, %ebp
je 0x46a9
andb %cl, %al
jne 0x46a9
movq 0x5265(%rip), %rax      # 0x98f8
movq 0x10(%rax), %r14
movq %r14, %rdi
callq 0x30c0
movq %r14, %rdi
movl %eax, %esi
callq 0x4d36
cmpl $-0x1, %ebx
sete %al
cmpl $-0x1, %ebp
sete %r15b
orb %al, %r15b
cmpb $0x1, %r15b
jne 0x46ee
cmpl $-0x1, 0x4a8a(%rip)     # 0x9150
je 0x46ee
cmpl $-0x1, 0x4a85(%rip)     # 0x9154
je 0x46ee
movq 0x5220(%rip), %rax      # 0x98f8
movq 0x18(%rax), %r14
movq %r14, %rdi
callq 0x30c0
movq %r14, %rdi
movl %eax, %esi
callq 0x4d36
movl %ebp, 0x4a5c(%rip)      # 0x9150
movl %ebx, 0x4a5a(%rip)      # 0x9154
testb %r15b, %r15b
je 0x470a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x45e9
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: tb_blit
void tb_blit(int x, int y, int w, int h, const struct tb_cell *cells) {
    if (x + w < 0 || x >= back_buffer.width)
        return;
    if (y + h < 0 || y >= back_buffer.height)
        return;
    int xo = 0, yo = 0, ww = w, hh = h;
    if (x < 0) {
        xo = -x;
        ww -= xo;
        x = 0;
    }
    if (y < 0) {
        yo = -y;
        hh -= yo;
        y = 0;
    }
    if (ww > back_buffer.width - x)
        ww = back_buffer.width - x;
    if (hh > back_buffer.height - y)
        hh = back_buffer.height - y;

    int sy;
    struct tb_cell *dst = &CELL(&back_buffer, x, y);
    const struct tb_cell *src = cells + yo * w + xo;
    size_t size = sizeof(struct tb_cell) * ww;

    for (sy = 0; sy < hh; ++sy) {
        memcpy(dst, src, size);
        dst += back_buffer.width;
        src += w;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r11d
addl %edi, %r11d
setns %r9b
movl 0x5167(%rip), %eax      # 0x9900
cmpl %edi, %eax
setg %r10b
movl %ecx, %ebx
addl %esi, %ebx
setns %r14b
andb %r9b, %r14b
andb %r10b, %r14b
movl 0x5151(%rip), %ebp      # 0x9904
cmpl %esi, %ebp
setg %r9b
andb %r14b, %r9b
cmpb $0x1, %r9b
jne 0x485d
xorl %r9d, %r9d
testl %edi, %edi
cmovnsl %edx, %r11d
movl $0x0, %r10d
cmovgl %edi, %r10d
testl %esi, %esi
cmovgl %esi, %r9d
cmovsl %ebx, %ecx
movl %eax, %ebx
subl %r10d, %ebx
cmpl %ebx, %r11d
cmovll %r11d, %ebx
subl %r9d, %ebp
cmpl %ebp, %ecx
cmovll %ecx, %ebp
testl %ebp, %ebp
jle 0x485d
movslq %ebx, %rbx
shlq $0x3, %rbx
movl %esi, %ecx
negl %ecx
sarl $0x1f, %esi
andl %ecx, %esi
imull %edx, %esi
movslq %esi, %rcx
leaq (%r8,%rcx,8), %rcx
movl %edi, %esi
negl %esi
sarl $0x1f, %edi
andl %esi, %edi
leaq (%rcx,%rdi,8), %r14
imull %r9d, %eax
addl %r10d, %eax
movslq %eax, %r15
shlq $0x3, %r15
addq 0x50d2(%rip), %r15      # 0x9908
movslq %edx, %r12
shlq $0x3, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3170
movslq 0x50ae(%rip), %rax      # 0x9900
leaq (%r15,%rax,8), %r15
addq %r12, %r14
decl %ebp
jne 0x483d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: tb_peek_event
int tb_peek_event(struct tb_event *event, int timeout) {
    struct timeval tv;
    tv.tv_sec = timeout / 1000;
    tv.tv_usec = (timeout - (tv.tv_sec * 1000)) * 1000;
    return wait_fill_event(event, &tv);
}

// Assembly:
subq $0x18, %rsp
movslq %esi, %rax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movslq %ecx, %rcx
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
imulq $-0x3e8, %rcx, %rcx     # imm = 0xFC18
addq %rax, %rcx
imulq $0x3e8, %rcx, %rax      # imm = 0x3E8
movq %rax, 0x8(%rsi)
callq 0x4872
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: tb_clear
void tb_clear(void) {
    if (buffer_size_change_request) {
        update_size();
        buffer_size_change_request = 0;
    }
    cellbuf_clear(&back_buffer);
}

// Assembly:
pushq %rax
cmpl $0x0, 0x4e29(%rip)      # 0x9920
je 0x4b08
callq 0x423b
movl $0x0, 0x4e18(%rip)      # 0x9920
movl 0x4df6(%rip), %esi      # 0x9904
imull 0x4deb(%rip), %esi      # 0x9900
testl %esi, %esi
jle 0x4b4b
movq 0x4de8(%rip), %rax      # 0x9908
movzwl 0x4dfd(%rip), %ecx      # 0x9924
movzwl 0x4df8(%rip), %edx      # 0x9926
movl %esi, %esi
xorl %edi, %edi
movl $0x20, (%rax,%rdi,8)
movw %cx, 0x4(%rax,%rdi,8)
movw %dx, 0x6(%rax,%rdi,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x4b32
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: tb_select_input_mode
int tb_select_input_mode(int mode) {
    if (mode) {
        if ((mode & (TB_INPUT_ESC | TB_INPUT_ALT)) == 0)
            mode |= TB_INPUT_ESC;

        /* technically termbox can handle that, but let's be nice and show here
           what mode is actually used */
        if ((mode & (TB_INPUT_ESC | TB_INPUT_ALT)) ==
            (TB_INPUT_ESC | TB_INPUT_ALT))
            mode &= ~TB_INPUT_ALT;

        inputmode = mode;
        if (mode & TB_INPUT_MOUSE) {
            bytebuffer_puts(&output_buffer, funcs[T_ENTER_MOUSE]);
            bytebuffer_flush(&output_buffer, inout);
        } else {
            bytebuffer_puts(&output_buffer, funcs[T_EXIT_MOUSE]);
            bytebuffer_flush(&output_buffer, inout);
        }
    }
    return inputmode;
}

// Assembly:
testl %edi, %edi
je 0x4bbc
pushq %rbx
xorl %eax, %eax
testb $0x3, %dil
sete %al
orl %edi, %eax
movl %eax, %ecx
notl %ecx
movl %eax, %edx
andl $-0x3, %edx
testb $0x3, %cl
cmovnel %eax, %edx
movl %edx, 0x45e6(%rip)      # 0x9158
xorl %eax, %eax
testb $0x4, %dl
sete %al
movq 0x4d77(%rip), %rcx      # 0x98f8
movq 0x60(%rcx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x30c0
movq %rbx, %rdi
movl %eax, %esi
callq 0x4d36
movl 0x4cf2(%rip), %edi      # 0x9890
movq 0x4d43(%rip), %rsi      # 0x98e8
movslq 0x4d44(%rip), %rdx      # 0x98f0
callq 0x30a0
movl $0x0, 0x4d35(%rip)      # 0x98f0
popq %rbx
movl 0x4596(%rip), %eax      # 0x9158
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: terminfo_copy_string
static const char *terminfo_copy_string(char *data, int str, int table) {
    const int16_t off = *(int16_t *)(data + str);
    const char *src = data + table + off;
    int len = strlen(src);
    char *dst = malloc(len + 1);
    strcpy(dst, src);
    return dst;
}

// Assembly:
pushq %rbx
movslq %esi, %rax
movswq (%rdi,%rax), %rax
movslq %edx, %rbx
addq %rdi, %rbx
addq %rax, %rbx
movq %rbx, %rdi
callq 0x30c0
incl %eax
movslq %eax, %rdi
callq 0x31b0
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x3070
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: terminfo_try_path
static char *terminfo_try_path(const char *path, const char *term) {
    char tmp[4096];
    snprintf(tmp, sizeof(tmp), "%s/%c/%s", path, term[0], term);
    tmp[sizeof(tmp) - 1] = '\0';
    char *data = read_file(tmp);
    if (data) {
        return data;
    }

    // fallback to darwin specific dirs structure
    snprintf(tmp, sizeof(tmp), "%s/%x/%s", path, term[0], term);
    tmp[sizeof(tmp) - 1] = '\0';
    return read_file(tmp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %rbx
movq %rdi, %r14
movsbl (%rsi), %r8d
leaq 0x1571(%rip), %rdx      # 0x61a1
movq %rsp, %r15
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r9
xorl %eax, %eax
callq 0x30d0
movb $0x0, 0xfff(%r15)
movq %r15, %rdi
callq 0x4c9d
testq %rax, %rax
jne 0x4c90
movsbl (%rbx), %r8d
leaq 0x1542(%rip), %rdx      # 0x61aa
movq %rsp, %r15
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rcx
movq %rbx, %r9
xorl %eax, %eax
callq 0x30d0
movb $0x0, 0xfff(%r15)
movq %r15, %rdi
callq 0x4c9d
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: read_file
static char *read_file(const char *file) {
    FILE *f = fopen(file, "rb");
    if (!f)
        return 0;

    struct stat st;
    if (fstat(fileno(f), &st) != 0) {
        fclose(f);
        return 0;
    }

    char *data = malloc(st.st_size);
    if (!data) {
        fclose(f);
        return 0;
    }

    if (fread(data, 1, st.st_size, f) != (size_t)st.st_size) {
        fclose(f);
        free(data);
        return 0;
    }

    fclose(f);
    return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq 0x1501(%rip), %rsi      # 0x61b3
callq 0x3210
testq %rax, %rax
je 0x4cdf
movq %rax, %rbx
movq %rax, %rdi
callq 0x3180
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x3240
testl %eax, %eax
je 0x4cf4
movq %rbx, %rdi
callq 0x30b0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x31b0
testq %rax, %rax
je 0x4cd7
movq %rax, %r14
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3090
movq %rax, %r12
movq %rbx, %rdi
callq 0x30b0
cmpq %r15, %r12
je 0x4ce2
movq %r14, %rdi
callq 0x3040
jmp 0x4cdf
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: convertnum
static int convertnum(uint32_t num, char *buf) {
    int i, l = 0;
    int ch;
    do {
        buf[l++] = '0' + (num % 10);
        num /= 10;
    } while (num);
    for (i = 0; i < l / 2; i++) {
        ch = buf[i];
        buf[i] = buf[l - 1 - i];
        buf[l - 1 - i] = ch;
    }
    return l;
}

// Assembly:
xorl %eax, %eax
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
movl %edi, %edx
imulq %rcx, %rdx
shrq $0x23, %rdx
leal (%rdx,%rdx), %r8d
leal (%r8,%r8,4), %r8d
movl %edi, %r9d
subl %r8d, %r9d
orb $0x30, %r9b
movb %r9b, (%rsi,%rax)
incq %rax
cmpl $0x9, %edi
movl %edx, %edi
ja 0x4dab
cmpq $0x1, %rax
je 0x4e03
movl %eax, %ecx
shrl %ecx
leal -0x1(%rax), %edx
movslq %edx, %rdx
addq %rsi, %rdx
xorl %edi, %edi
movb (%rsi,%rdi), %r8b
movb (%rdx), %r9b
movb %r9b, (%rsi,%rdi)
movb %r8b, (%rdx)
incq %rdi
decq %rdx
cmpq %rcx, %rdi
jb 0x4dea
retq
// File: /workspace/github_c_makefile_star2_O1/termbox[P]termbox/termbox.c
// Function: cellbuf_resize
static void cellbuf_resize(struct cellbuf *buf, int width, int height) {
    if (buf->width == width && buf->height == height)
        return;

    int oldw = buf->width;
    int oldh = buf->height;
    struct tb_cell *oldcells = buf->cells;

    cellbuf_init(buf, width, height);
    cellbuf_clear(buf);

    int minw = (width < oldw) ? width : oldw;
    int minh = (height < oldh) ? height : oldh;
    int i;

    for (i = 0; i < minh; ++i) {
        struct tb_cell *csrc = oldcells + (i * oldw);
        struct tb_cell *cdst = buf->cells + (i * width);
        memcpy(cdst, csrc, sizeof(struct tb_cell) * minw);
    }

    free(oldcells);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
movslq (%rdi), %r12
cmpl %esi, %r12d
jne 0x4e36
cmpl %ebp, 0x4(%rbx)
jne 0x4e36
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rbx), %r14d
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x3e00
movl 0x4(%rbx), %esi
imull (%rbx), %esi
testl %esi, %esi
jle 0x4e89
movq 0x8(%rbx), %rax
movzwl 0x4abf(%rip), %ecx      # 0x9924
movzwl 0x4aba(%rip), %edx      # 0x9926
movl %esi, %esi
xorl %edi, %edi
movl $0x20, (%rax,%rdi,8)
movw %cx, 0x4(%rax,%rdi,8)
movw %dx, 0x6(%rax,%rdi,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x4e70
cmpl %ebp, %r14d
cmovll %r14d, %ebp
testl %ebp, %ebp
jle 0x4eed
movq %r12, %rax
cmpl %r15d, %eax
movslq %r15d, %rcx
cmovll %eax, %r15d
movslq %r15d, %rdx
shlq $0x3, %rdx
movq %rdx, 0x10(%rsp)
movl %ebp, %ebp
shlq $0x3, %rcx
movq %rcx, %r15
shlq $0x3, %rax
xorl %r13d, %r13d
movq 0x8(%rsp), %r12
movq 0x8(%rbx), %rdi
addq %r13, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %r14
movq %rax, %rbx
callq 0x3170
movq %rbx, %rax
movq %r14, %rbx
addq %r15, %r13
addq %rax, %r12
decq %rbp
jne 0x4ec2
movq 0x8(%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3040