xunge/DecIR huggingface dataset:
void elec_syn(double v_post, double v_pre, double *g, double *ret,
              double *aux) {
  *ret = g[0] * (v_post - v_pre);
  return;
}


x86 assembly (clang, -O0):
<elec_syn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<elec_syn>:
subsd  %xmm1,%xmm0
mulsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @elec_syn(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double*, double** %8
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double*, double** %9
store double %17, double* %18
ret void
}

LLVM IR (-O2):
define void @elec_syn(double %0, double %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture readnone %4) {
%6 = load double, double* %2
%7 = fsub double %0, %1
%8 = fmul double %7, %6
store double %8, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Public_Key_Packet(int);
extern void Public_Subkey_Packet(int len) { Public_Key_Packet(len); }


x86 assembly (clang, -O0):
<Public_Subkey_Packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Public_Key_Packet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Public_Subkey_Packet>:
jmp    1030 <Public_Key_Packet@plt>

LLVM IR (-O0):
define void @Public_Subkey_Packet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @Public_Key_Packet(i32 %3)
ret void
}

LLVM IR (-O2):
define void @Public_Subkey_Packet(i32 %0) {
%2 = tail call i32 @Public_Key_Packet(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ probarV();
int main(void) {
  probarV();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <probarV@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <probarV@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @probarV()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @probarV()
ret i32 0
}
/* Variables and functions */
void *vmm_trunc_addr(void *addr) { return (void *)((uintptr_t)addr & ~0xFFF); }


x86 assembly (clang, -O0):
<vmm_trunc_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffff000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmm_trunc_addr>:
mov    %rdi,%rax
and    $0xfffffffffffff000,%rax
ret

LLVM IR (-O0):
define i8* @vmm_trunc_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, -4096
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @vmm_trunc_addr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, -4096
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
scalar_t__ write_com_4bit(int);
void disp_shift_L() {
  write_com_4bit(0x0010 | 0x08);
  while (write_com_4bit(0x0100) != 0)
    ;
}


x86 assembly (clang, -O0):
<disp_shift_L>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
call   1030 <write_com_4bit@plt>
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
cmp    $0x0,%rax
je     1137 <disp_shift_L+0x27>
jmp    111e <disp_shift_L+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_shift_L>:
push   %rax
mov    $0x18,%edi
call   1030 <write_com_4bit@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x100,%edi
call   1030 <write_com_4bit@plt>
test   %rax,%rax
jne    1120 <disp_shift_L+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @disp_shift_L() {
%1 = call i64 @write_com_4bit(i32 24)
br label %2
2: ; preds = %5, %0
%3 = call i64 @write_com_4bit(i32 256)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @disp_shift_L() {
%1 = tail call i64 @write_com_4bit(i32 24)
br label %2
2: ; preds = %2, %0
%3 = tail call i64 @write_com_4bit(i32 256)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
float rmin(float l, float r) {
  if (l <= r)
    return l;
  return r;
}


x86 assembly (clang, -O0):
<rmin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1130 <rmin+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <rmin+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmin>:
movaps %xmm0,%xmm2
cmpless %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @rmin(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ole float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @rmin(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int bracktype(ch)
int ch;
{
  switch (ch) {
  case '(':
    return 1;
  case '[':
    return 2;
  case '{':
    return 3;
  case ')':
    return -1;
  case ']':
    return -2;
  case '}':
    return -3;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<bracktype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x28,%eax
je     1170 <bracktype+0x70>
jmp    111b <bracktype+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x29,%eax
je     1194 <bracktype+0x94>
jmp    112c <bracktype+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x5b,%eax
je     117c <bracktype+0x7c>
jmp    113d <bracktype+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x5d,%eax
je     11a0 <bracktype+0xa0>
jmp    114e <bracktype+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x7b,%eax
je     1188 <bracktype+0x88>
jmp    115f <bracktype+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x7d,%eax
je     11ac <bracktype+0xac>
jmp    11b8 <bracktype+0xb8>
movl   $0x1,-0x4(%rbp)
jmp    11bf <bracktype+0xbf>
movl   $0x2,-0x4(%rbp)
jmp    11bf <bracktype+0xbf>
movl   $0x3,-0x4(%rbp)
jmp    11bf <bracktype+0xbf>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bf <bracktype+0xbf>
movl   $0xfffffffe,-0x4(%rbp)
jmp    11bf <bracktype+0xbf>
movl   $0xfffffffd,-0x4(%rbp)
jmp    11bf <bracktype+0xbf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bracktype>:
lea    -0x5b(%rdi),%eax
cmp    $0x22,%eax
ja     111e <bracktype+0x1e>
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%eax
ret
cmp    $0x28,%edi
je     1143 <bracktype+0x43>
cmp    $0x29,%edi
jne    112e <bracktype+0x2e>
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret
mov    $0xfffffffe,%eax
ret
mov    $0x3,%eax
ret
mov    $0xfffffffd,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bracktype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 40, label %5
i32 91, label %6
i32 123, label %7
i32 41, label %8
i32 93, label %9
i32 125, label %10
]
5: ; preds = %1
store i32 1, i32* %2
br label %12
6: ; preds = %1
store i32 2, i32* %2
br label %12
7: ; preds = %1
store i32 3, i32* %2
br label %12
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
store i32 -2, i32* %2
br label %12
10: ; preds = %1
store i32 -3, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @bracktype(i32 %0) {
switch i32 %0, label %7 [
i32 40, label %8
i32 91, label %2
i32 123, label %3
i32 41, label %4
i32 93, label %5
i32 125, label %6
]
2: ; preds = %1
br label %8
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3, %2
%9 = phi i32 [ 0, %7 ], [ -3, %6 ], [ -2, %5 ], [ -1, %4 ], [ 3, %3 ], [ 2, %2 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ set_palette(int /*<<< orphan*/, int, unsigned char *);
void init_palette(void) {
  static unsigned char s_table_rgb[16 * 3] = {
      0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00,
      0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
      0xc6, 0xc6, 0xc6, 0x84, 0x00, 0x00, 0x00, 0x84, 0x00, 0x84, 0x84, 0x00,
      0x00, 0x00, 0x84, 0x84, 0x00, 0x84, 0x00, 0x84, 0x84, 0x84, 0x84, 0x84,
  };
  set_palette(0, 15, s_table_rgb);
}


x86 assembly (clang, -O0):
<init_palette>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xf,%esi
lea    0x2f0e(%rip),%rdx
call   1030 <set_palette@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_palette>:
lea    0x2f19(%rip),%rdx
xor    %edi,%edi
mov    $0xf,%esi
jmp    1030 <set_palette@plt>

LLVM IR (-O0):
@init_palette.s_table_rgb = internal global [48 x i8] c"\00\00\00\FF\00\00\00\FF\00\FF\FF\00\00\00\FF\FF\00\FF\00\FF\FF\FF\FF\FF\C6\C6\C6\84\00\00\00\84\00\84\84\00\00\00\84\84\00\84\00\84\84\84\84\84"
define void @init_palette() {
%1 = call i32 @set_palette(i32 0, i32 15, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @init_palette.s_table_rgb, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@init_palette.s_table_rgb = internal global [48 x i8] c"\00\00\00\FF\00\00\00\FF\00\FF\FF\00\00\00\FF\FF\00\FF\00\FF\FF\FF\FF\FF\C6\C6\C6\84\00\00\00\84\00\84\84\00\00\00\84\84\00\84\00\84\84\84\84\84"
define void @init_palette() {
%1 = tail call i32 @set_palette(i32 0, i32 15, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @init_palette.s_table_rgb, i64 0, i64 0))
ret void
}
int test_imm_C3int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xc3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C3int64_highword_mem>:
testb  $0xc3,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 195
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_C3int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 837518622720
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x35() {
  Assert_real((isalnum(53)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              270, ("isalnum should be 1 for 5"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x35>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x10e,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x35>:
push   %rax
mov    $0x35,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x10e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for 5\00"
define void @t_isalnum_0x35() {
%1 = call i32 @isalnum(i32 53)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for 5\00"
define void @t_isalnum_0x35() {
%1 = tail call i32 @isalnum(i32 53)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long bit_set(register unsigned long value,
                      register unsigned long pos) {
  return (value |= (1 << (pos)));
}


x86 assembly (clang, -O0):
<bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bit_set(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = or i64 %9, %8
store i64 %10, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @bit_set(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = or i64 %5, %0
ret i64 %6
}
int Close_Socket(void) { return 0; }


x86 assembly (clang, -O0):
<Close_Socket>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close_Socket>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Close_Socket() {
ret i32 0
}

LLVM IR (-O2):
define i32 @Close_Socket() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fdecstp() {
  db(0xD9);
  db(0xF6);
}


x86 assembly (clang, -O0):
<fdecstp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf6,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdecstp>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf6,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fdecstp() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 246)
ret void
}

LLVM IR (-O2):
define void @fdecstp() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 246)
ret void
}
/* Variables and functions */
int strlen(char const *);
int func(const char *str) { return strlen(str); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @func(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void addFooter(FILE *fp) {
  fprintf(fp,
          "<p><font face='Verdana, Arial, Helvetica, sans-serif' size='2' "
          "color='#666600'>"
          "Generated by <a href='http://www.enderunix.org/isoqlog/' "
          "target='_blank'>%s</a>"
          ", <a href='http://www.enderunix.org'>EnderUNIX software development "
          "team @Istanbul/Turkey</a></font></p>\n"
          "<p><a href='http://validator.w3.org/check/referer'>\n"
          "<img border='0' src='http://www.w3.org/Icons/valid-html401' "
          "alt='Valid HTML 4.01!' height='31' width='88'></a>\n"
          "</p>\n",
          "EnderUNIX Isoqlog 2.2-BETA");
}


x86 assembly (clang, -O0):
<addFooter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0x1082(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addFooter>:
lea    0xee9(%rip),%rsi
lea    0x1092(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [432 x i8] c"<p><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color=''>Generated by <a href='http://www.enderunix.org/isoqlog/' target='_blank'>%s</a>, <a href='http://www.enderunix.org'>EnderUNIX software development team @Istanbul/Turkey</a></font></p>\0A<p><a href='http://validator.w3.org/check/referer'>\0A<img border='0' src='http://www.w3.org/Icons/valid-html401' alt='Valid HTML 4.01!' height='31' width='88'></a>\0A</p>\0A\00"
@.str.1 = [27 x i8] c"EnderUNIX Isoqlog 2.2-BETA\00"
define void @addFooter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([432 x i8], [432 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [432 x i8] c"<p><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color=''>Generated by <a href='http://www.enderunix.org/isoqlog/' target='_blank'>%s</a>, <a href='http://www.enderunix.org'>EnderUNIX software development team @Istanbul/Turkey</a></font></p>\0A<p><a href='http://validator.w3.org/check/referer'>\0A<img border='0' src='http://www.w3.org/Icons/valid-html401' alt='Valid HTML 4.01!' height='31' width='88'></a>\0A</p>\0A\00"
@.str.1 = [27 x i8] c"EnderUNIX Isoqlog 2.2-BETA\00"
define void @addFooter(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([432 x i8], [432 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xf6() {
  Assert_real((isgraph(246) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1235, ("isgraph should be 0 for 0xf6"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xf6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf6,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4d3,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d3,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf6\00"
define void @t_isgraph_0xf6() {
%1 = call i64 @isgraph(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf6\00"
define void @t_isgraph_0xf6() {
%1 = tail call i64 @isgraph(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ set_brightness(int /*<<< orphan*/ *, int /*<<< orphan*/);
void reset_led(FILE *led_file) { set_brightness(led_file, 0); }


x86 assembly (clang, -O0):
<reset_led>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <set_brightness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_led>:
xor    %esi,%esi
jmp    1030 <set_brightness@plt>

LLVM IR (-O0):
define void @reset_led(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @set_brightness(i32* %3, i32 0)
ret void
}

LLVM IR (-O2):
define void @reset_led(i32* %0) {
%2 = tail call i32 @set_brightness(i32* %0, i32 0)
ret void
}
/* Variables and functions */
int read_spi_register(int);
int spi_status() { return read_spi_register(0x64); }


x86 assembly (clang, -O0):
<spi_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <read_spi_register@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_status>:
mov    $0x64,%edi
jmp    1030 <read_spi_register@plt>

LLVM IR (-O0):
define i32 @spi_status() {
%1 = call i32 @read_spi_register(i32 100)
ret i32 %1
}

LLVM IR (-O2):
define i32 @spi_status() {
%1 = tail call i32 @read_spi_register(i32 100)
ret i32 %1
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int usec() {
  struct timeval timevals;
  gettimeofday(&timevals, NULL);
  return (int)timevals.tv_usec;
}


x86 assembly (clang, -O0):
<usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i32 @usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i32 @usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
char _Locale_decimal_point(struct _Locale_numeric *__DUMMY_PAR) { return '.'; }


x86 assembly (clang, -O0):
<_Locale_decimal_point>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2e,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_decimal_point>:
mov    $0x2e,%al
ret

LLVM IR (-O0):
%struct._Locale_numeric = type opaque
define signext i8 @_Locale_decimal_point(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret i8 46
}

LLVM IR (-O2):
%struct._Locale_numeric = type opaque
define signext i8 @_Locale_decimal_point(%struct._Locale_numeric* nocapture readnone %0) {
ret i8 46
}
int test_imm_E3uint8_mem(unsigned char *val) {
  return ((*val) & (0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xe3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E3uint8_mem>:
testb  $0xe3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E3uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 227
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E3uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -29
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int stop() { return write_block(120, 0, 0, 0); }


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <write_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop>:
mov    $0x78,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @stop() {
%1 = call i32 @write_block(i32 120, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @stop() {
%1 = tail call i32 @write_block(i32 120, i32 0, i32 0, i32 0)
ret i32 %1
}
wn3(a, b, c) {
  wn(a);
  nl();
  wn(b);
  nl();
  wn(c);
  nl();
}


x86 assembly (clang, -O0):
<wn3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <wn@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <wn@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x10(%rbp),%edi
mov    $0x0,%al
call   1040 <wn@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wn3>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
xor    %eax,%eax
call   1040 <wn@plt>
xor    %eax,%eax
call   1030 <nl@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <wn@plt>
xor    %eax,%eax
call   1030 <nl@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <wn@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <nl@plt>

LLVM IR (-O0):
define i32 @wn3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = call i32 (i32, ...) bitcast (i32 (...)* @wn to i32 (i32, ...)*)(i32 %8)
%10 = call i32 (...) @nl()
%11 = load i32, i32* %6
%12 = call i32 (i32, ...) bitcast (i32 (...)* @wn to i32 (i32, ...)*)(i32 %11)
%13 = call i32 (...) @nl()
%14 = load i32, i32* %7
%15 = call i32 (i32, ...) bitcast (i32 (...)* @wn to i32 (i32, ...)*)(i32 %14)
%16 = call i32 (...) @nl()
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @wn3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @wn to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (...) @nl()
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @wn to i32 (i32, ...)*)(i32 %1)
%7 = tail call i32 (...) @nl()
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @wn to i32 (i32, ...)*)(i32 %2)
%9 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
int _mx_strbeginswith(char *, char const *, char **, int /*<<< orphan*/);
int mx_strbeginswith(char *str, const char *start, char **endptr) {
  return _mx_strbeginswith(str, start, endptr, 0);
}


x86 assembly (clang, -O0):
<mx_strbeginswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <_mx_strbeginswith@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_strbeginswith>:
xor    %ecx,%ecx
jmp    1030 <_mx_strbeginswith@plt>

LLVM IR (-O0):
define i32 @mx_strbeginswith(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
%10 = call i32 @_mx_strbeginswith(i8* %7, i8* %8, i8** %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mx_strbeginswith(i8* %0, i8* %1, i8** %2) {
%4 = tail call i32 @_mx_strbeginswith(i8* %0, i8* %1, i8** %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int random();
int rand_key_int(int nonrepeat, int pos) {
  int r;
  r = random() - 0x40000000;
  r += pos - r % nonrepeat;
  return r;
}


x86 assembly (clang, -O0):
<rand_key_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
sub    $0x40000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_key_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
lea    -0x40000000(%rcx),%eax
cltd
idiv   %ebp
sub    %edx,%ebx
lea    (%rbx,%rcx,1),%eax
add    $0xc0000000,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_key_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @random()
%7 = sub nsw i32 %6, 1073741824
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = srem i32 %9, %10
%12 = sub nsw i32 %8, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @rand_key_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random()
%4 = add nsw i32 %3, -1073741824
%5 = srem i32 %4, %0
%6 = sub i32 %1, %5
%7 = add nsw i32 %6, %4
ret i32 %7
}
int func(int v, int m) { return (v & m != 0); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmpl   $0x0,-0x8(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @func(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = and i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void close_file(FILE *file) {
  if (file) {
    fprintf(stdout, "[UNINIT] File closed on 0x%p\n", file);
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <close_file+0x39>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_file>:
test   %rdi,%rdi
je     114a <close_file+0x2a>
push   %rbx
mov    %rdi,%rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [30 x i8] c"[UNINIT] File closed on 0x%p\0A\00"
define void @close_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [30 x i8] c"[UNINIT] File closed on 0x%p\0A\00"
define void @close_file(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32* %0)
%6 = tail call i32 @fclose(i32* %0)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int fpu_control_t;

/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int);
int __fegetround(void) {
  fpu_control_t cw;
  _FPU_GETCW(cw);
  return cw & 0x1;
}


x86 assembly (clang, -O0):
<__fegetround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fegetround>:
push   %rax
call   1030 <_FPU_GETCW@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__fegetround() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @_FPU_GETCW(i32 %2)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @__fegetround() {
%1 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mp2_920_think();
int /*<<< orphan*/ usleep(int);
void mp2_920_sleep_ms(unsigned int uMs) {
  mp2_920_think();
  usleep(1000 * uMs);
}


x86 assembly (clang, -O0):
<mp2_920_sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <mp2_920_think@plt>
imul   $0x3e8,-0x4(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2_920_sleep_ms>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <mp2_920_think@plt>
imul   $0x3e8,%ebx,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @mp2_920_sleep_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @mp2_920_think()
%4 = load i32, i32* %2
%5 = mul i32 1000, %4
%6 = call i32 @usleep(i32 %5)
ret void
}

LLVM IR (-O2):
define void @mp2_920_sleep_ms(i32 %0) {
%2 = tail call i32 (...) @mp2_920_think()
%3 = mul i32 %0, 1000
%4 = tail call i32 @usleep(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char const *, char);
int /*<<< orphan*/ *strstr(char const *, char *);
int partially_validate_snap_name(const char *snap_name) {
  if (strstr(snap_name, "..") != NULL) {
    return -1;
  }
  if (strchr(snap_name, '/') != NULL) {
    return -1;
  }
}


x86 assembly (clang, -O0):
<partially_validate_snap_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1152 <partially_validate_snap_name+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <partially_validate_snap_name+0x51>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1171 <partially_validate_snap_name+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partially_validate_snap_name>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
jne    1142 <partially_validate_snap_name+0x22>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"..\00"
define i32 @partially_validate_snap_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strstr(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32* @strchr(i8* %9, i8 signext 47)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 -1, i32* %2
br label %13
13: ; preds = %7, %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
define i32 @partially_validate_snap_name(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32* @strchr(i8* %0, i8 signext 47)
br label %6
6: ; preds = %4, %1
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stdin;
void c_stdin_(FILE **fp) { *fp = stdin; }


x86 assembly (clang, -O0):
<c_stdin_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_stdin_>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@stdin = global i32* null
define void @c_stdin_(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32*, i32** @stdin
%4 = load i32**, i32*** %2
store i32* %3, i32** %4
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
define void @c_stdin_(i32** nocapture writeonly %0) {
%2 = load i32*, i32** @stdin
store i32* %2, i32** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsxfrm(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void uninitvar_wcsxfrm(void) {
  wchar_t *ds;
  wchar_t *ss;
  size_t n;
  (void)wcsxfrm(ds, ss, n);
}


x86 assembly (clang, -O0):
<uninitvar_wcsxfrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wcsxfrm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wcsxfrm>:
jmp    1030 <wcsxfrm@plt>

LLVM IR (-O0):
define void @uninitvar_wcsxfrm() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i64
%4 = load i32*, i32** %1
%5 = load i32*, i32** %2
%6 = load i64, i64* %3
%7 = call i32 @wcsxfrm(i32* %4, i32* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcsxfrm() {
%1 = tail call i32 @wcsxfrm(i32* undef, i32* undef, i64 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void everytrace_exit(int retcode) {
  fprintf(stderr, "_EVERYTRACE_ DUMP: Exiting with return code: %d\n", retcode);
  fflush(stdout);
  fflush(stderr);
  int *ptr = 0;
  *ptr = 17;
}


x86 assembly (clang, -O0):
<everytrace_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x11,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<everytrace_exit>:
push   %rbx
mov    %edi,%edx
mov    0x2eb6(%rip),%rbx
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"_EVERYTRACE_ DUMP: Exiting with return code: %d\0A\00"
@stdout = global i32 0
define void @everytrace_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* @stderr
%5 = load i32, i32* %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fflush(i32 %9)
store i32* null, i32** %3
%11 = load i32*, i32** %3
store i32 17, i32* %11
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"_EVERYTRACE_ DUMP: Exiting with return code: %d\0A\00"
@stdout = global i32 0
define void @everytrace_exit(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
unreachable
}
int compare_names(file1, file2) void const *file1, *file2;
{
  return filename_cmp(*(char const *const *)file1, *(char const *const *)file2);
}


x86 assembly (clang, -O0):
<compare_names>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x0,%al
call   1030 <filename_cmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_names>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <filename_cmp@plt>

LLVM IR (-O0):
define i32 @compare_names(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @filename_cmp to i32 (i8*, i8*, ...)*)(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_names(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @filename_cmp to i32 (i8*, i8*, ...)*)(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
int read(int, void *, int);
void dev_read(int fd, void *buf, int count) {
  int i;
  i = read(fd, buf, count);
  if (i != count) {
    printf("Read failed %d vs %d\n", i, count);
    exit(6);
  }
}


x86 assembly (clang, -O0):
<dev_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     117c <dev_read+0x4c>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    $0x6,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_read>:
push   %rbx
mov    %edx,%ebx
call   1040 <read@plt>
cmp    %ebx,%eax
jne    113e <dev_read+0xe>
pop    %rbx
ret
lea    0xebb(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    $0x6,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Read failed %d vs %d\0A\00"
define void @dev_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
%19 = call i32 @exit(i32 6)
unreachable
20: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Read failed %d vs %d\0A\00"
define void @dev_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %2)
%8 = tail call i32 @exit(i32 6)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EmitLn(char *);
int /*<<< orphan*/ Match(char);
int /*<<< orphan*/ Term();
void Add() {
  Match('+');
  Term();
  EmitLn("addl (%esp), %eax");
  EmitLn("addl $4, %esp");
}


x86 assembly (clang, -O0):
<Add>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1040 <Match@plt>
mov    $0x0,%al
call   1030 <Term@plt>
lea    0xeb4(%rip),%rdi
call   1050 <EmitLn@plt>
lea    0xeba(%rip),%rdi
call   1050 <EmitLn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Add>:
push   %rax
mov    $0x2b,%edi
call   1040 <Match@plt>
xor    %eax,%eax
call   1030 <Term@plt>
lea    0xeb7(%rip),%rdi
call   1050 <EmitLn@plt>
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1050 <EmitLn@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"addl (%esp), %eax\00"
@.str.1 = [14 x i8] c"addl $4, %esp\00"
define void @Add() {
%1 = call i32 @Match(i8 signext 43)
%2 = call i32 (...) @Term()
%3 = call i32 @EmitLn(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @EmitLn(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"addl (%esp), %eax\00"
@.str.1 = [14 x i8] c"addl $4, %esp\00"
define void @Add() {
%1 = tail call i32 @Match(i8 signext 43)
%2 = tail call i32 (...) @Term()
%3 = tail call i32 @EmitLn(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @EmitLn(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
unsigned int sleep(unsigned int);
unsigned int snooze(unsigned int secs) {
  unsigned sleep_secs;
  sleep_secs = sleep(secs);
  printf("Slept for %u of %u secs\n", secs - sleep_secs, secs);
  return sleep_secs;
}


x86 assembly (clang, -O0):
<snooze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sleep@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
sub    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snooze>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <sleep@plt>
mov    %eax,%ebp
mov    %ebx,%esi
sub    %eax,%esi
lea    0xec9(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Slept for %u of %u secs\0A\00"
define i32 @snooze(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sleep(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [25 x i8] c"Slept for %u of %u secs\0A\00"
define i32 @snooze(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
%3 = sub i32 %0, %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %0)
ret i32 %2
}
void inc_zcache_obj_count(void) {}


x86 assembly (clang, -O0):
<inc_zcache_obj_count>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_zcache_obj_count>:
ret

LLVM IR (-O0):
define void @inc_zcache_obj_count() {
ret void
}

LLVM IR (-O2):
define void @inc_zcache_obj_count() {
ret void
}