xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x77() {
  Assert_real((iscntrl(119) == 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_iscntrl.c",
              600, ("iscntrl should be 0 for w"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x77>:
push   %rax
mov    $0x77,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x258,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for w\00"
define void @t_iscntrl_0x77() {
%1 = call i64 @iscntrl(i32 119)
%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 600, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for w\00"
define void @t_iscntrl_0x77() {
%1 = tail call i64 @iscntrl(i32 119)
%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 600, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int japi_getitemcount(int);
int j_getitemcount(int arg0) { return (japi_getitemcount(arg0)); }


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

x86 assembly (clang, -O2):
<j_getitemcount>:
jmp    1030 <japi_getitemcount@plt>

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

LLVM IR (-O2):
define i32 @j_getitemcount(i32 %0) {
%2 = tail call i32 @japi_getitemcount(i32 %0)
ret i32 %2
}
void recon_unregister_pcmcia_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @recon_unregister_pcmcia_callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void oscap_print_depth(int depth) {
  while (depth--)
    printf("  ");
}


x86 assembly (clang, -O0):
<oscap_print_depth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <oscap_print_depth+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <oscap_print_depth+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oscap_print_depth>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <oscap_print_depth+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <oscap_print_depth+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c" \00"
define void @oscap_print_depth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @oscap_print_depth(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pause() {
  printf("Presione enter para continuar ...");
  getchar();
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Presione enter para continuar ...\00"
define void @pause() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Presione enter para continuar ...\00"
define void @pause() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_wrctl(int, int);
void _Nios2_Set_ctlreg_tlbacc(uint32_t value) {
  __builtin_wrctl(9, (int)value);
}


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

x86 assembly (clang, -O2):
<_Nios2_Set_ctlreg_tlbacc>:
mov    %rdi,%rsi
mov    $0x9,%edi
jmp    1030 <__builtin_wrctl@plt>

LLVM IR (-O0):
define void @_Nios2_Set_ctlreg_tlbacc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @__builtin_wrctl(i32 9, i32 %4)
ret void
}

LLVM IR (-O2):
define void @_Nios2_Set_ctlreg_tlbacc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @__builtin_wrctl(i32 9, i32 %2)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_target_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(5, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_target_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x5,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_target_solutions_to_container>:
mov    $0x5,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_target_solutions_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 5, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_target_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 5, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, char, char);
int main(void) {
  char c;
  c = 0;
  while (1) {
    char n = c + 1;
    printf("c=%d , n=%d\n", c, n);
    assert(n > c);
    c = n;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xeb6(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
movsbl -0x6(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
mov    %al,-0x7(%rbp)
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
jmp    1133 <main+0x13>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
movsbl %bl,%esi
add    $0x1,%bl
movsbl %bl,%ebp
mov    %r14,%rdi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %edi,%edi
cmp    $0x80,%bpl
setne  %dil
call   1040 <assert@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"c=%d , n=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
br label %4
4: ; preds = %0, %4
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %2
%10 = load i8, i8* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %9, i8 signext %10)
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp sgt i32 %13, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8, i8* %3
store i8 %19, i8* %2
br label %4
}

LLVM IR (-O2):
@.str = [13 x i8] c"c=%d , n=%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ 0, %0 ], [ %3, %1 ]
%3 = add i8 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %3)
%5 = icmp ne i8 %2, 127
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br label %1
}
unsigned long image_copy_end(void) {
  extern char __image_copy_end[];
  return (unsigned long)&__image_copy_end;
}


x86 assembly (clang, -O0):
<image_copy_end>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<image_copy_end>:
mov    0x2ed1(%rip),%rax
ret

LLVM IR (-O0):
@__image_copy_end = external global [0 x i8]
define i64 @image_copy_end() {
ret i64 ptrtoint ([0 x i8]* @__image_copy_end to i64)
}

LLVM IR (-O2):
@__image_copy_end = external global [0 x i8]
define i64 @image_copy_end() {
ret i64 ptrtoint ([0 x i8]* @__image_copy_end to i64)
}
int test_imm_DCint16_mem(short *val) {
  return ((*val) & (0xDC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DCint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 220
%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_DCint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 220
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ glFinish();
int /*<<< orphan*/ printf(char *, ...);
void trace_glFinish(void) {
  printf("%20s(", "glFinish");
  printf(");\n");
  glFinish();
}


x86 assembly (clang, -O0):
<trace_glFinish>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <glFinish@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_glFinish>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFinish@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [9 x i8] c"glFinish\00"
@.str.2 = [4 x i8] c");\0A\00"
define void @trace_glFinish() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (...) @glFinish()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [9 x i8] c"glFinish\00"
@str = [3 x i8] c");\00"
define void @trace_glFinish() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @glFinish()
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRE5_set(void) { return U_WMRCORENONE_set("U_WMRE5"); }


x86 assembly (clang, -O0):
<U_WMRE5_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRE5_set>:
lea    0xee9(%rip),%rdi
jmp    1030 <U_WMRCORENONE_set@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE5\00"
define i8* @U_WMRE5_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE5\00"
define i8* @U_WMRE5_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int fn2(int x, int y) {
  int tem1 = y | x;
  int tem2 = ~(x & y);
  return tem1 & tem2;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
%13 = xor i32 %12, -1
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ matNd_setRow(double *, double const *, int const, int);
void mat3d_setRow(double matrix[9], const double v[3], const int row) {
  matNd_setRow(matrix, v, row, 3);
}


x86 assembly (clang, -O0):
<mat3d_setRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x3,%ecx
call   1030 <matNd_setRow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3d_setRow>:
mov    $0x3,%ecx
jmp    1030 <matNd_setRow@plt>

LLVM IR (-O0):
define void @mat3d_setRow(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = call i32 @matNd_setRow(double* %7, double* %8, i32 %9, i32 3)
ret void
}

LLVM IR (-O2):
define void @mat3d_setRow(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @matNd_setRow(double* %0, double* %1, i32 %2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int openBus(char *busFileName) { return open(busFileName, O_RDWR); }


x86 assembly (clang, -O0):
<openBus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openBus>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @openBus(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @openBus(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ run();
int main() {
  run();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run()
ret i32 0
}
float clampf(float v, float min, float max) {
  return v < min ? min : (v > max ? max : v);
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clampf+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <clampf+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <clampf+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <clampf+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ insert_initial_environment();
int /*<<< orphan*/ insert_initial_symbols();
void prepare_execution_context(void) {
  insert_initial_symbols();
  insert_initial_environment();
}


x86 assembly (clang, -O0):
<prepare_execution_context>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <insert_initial_symbols@plt>
mov    $0x0,%al
call   1040 <insert_initial_environment@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_execution_context>:
push   %rax
xor    %eax,%eax
call   1030 <insert_initial_symbols@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <insert_initial_environment@plt>

LLVM IR (-O0):
define void @prepare_execution_context() {
%1 = call i32 (...) @insert_initial_symbols()
%2 = call i32 (...) @insert_initial_environment()
ret void
}

LLVM IR (-O2):
define void @prepare_execution_context() {
%1 = tail call i32 (...) @insert_initial_symbols()
%2 = tail call i32 (...) @insert_initial_environment()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) oom_die(const char *argv0) {
  fprintf(stderr, "%s: out of memory\n", argv0);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<oom_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oom_die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"%s: out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @oom_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"%s: out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define void @oom_die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int slow_server(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc != 1 + 1)
    return 7;
  return -slow_server(atoi(argv[1]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x7,-0x4(%rbp)
jmp    1169 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <slow_server@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x7,%eax
cmp    $0x2,%edi
jne    1141 <main+0x21>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <slow_server@plt>
neg    %eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 7, i32* %3
br label %16
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
%14 = call i32 @slow_server(i32 %13)
%15 = sub nsw i32 0, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @slow_server(i32 %7)
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 7, %2 ]
ret i32 %11
}
/* Variables and functions */
void *dcmemset(void *ptr, int value, size_t num) {
  int c = value;
  size_t i = 0;
  unsigned char *p = (unsigned char *)ptr;
  for (i = 0; i < num; i++) {
    *p = (unsigned char)c;
    p++;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<dcmemset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1163 <dcmemset+0x63>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x30(%rbp),%rax
mov    %cl,(%rax)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    112d <dcmemset+0x2d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcmemset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <dcmemset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @dcmemset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%10 = load i32, i32* %5
store i32 %10, i32* %7
store i64 0, i64* %8
%11 = load i8*, i8** %4
store i8* %11, i8** %9
store i64 0, i64* %8
br label %12
12: ; preds = %22, %3
%13 = load i64, i64* %8
%14 = load i64, i64* %6
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = load i32, i32* %7
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %9
store i8 %18, i8* %19
%20 = load i8*, i8** %9
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %9
br label %22
22: ; preds = %16
%23 = load i64, i64* %8
%24 = add i64 %23, 1
store i64 %24, i64* %8
br label %12
25: ; preds = %12
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @dcmemset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void divert(int sig) { printf("signal received=%d\n", sig); }


x86 assembly (clang, -O0):
<divert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divert>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"signal received=%d\0A\00"
define void @divert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"signal received=%d\0A\00"
define void @divert(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char safely_get_character(const char *str, int offset, int pos, int str_len) {
  if (offset + pos < str_len) {
    return str[offset + pos];
  } else {
    exit(1);
  }
}


x86 assembly (clang, -O0):
<safely_get_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114b <safely_get_character+0x3b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<safely_get_character>:
push   %rax
add    %edx,%esi
cmp    %ecx,%esi
jge    111f <safely_get_character+0xf>
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
pop    %rcx
ret
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define signext i8 @safely_get_character(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %8
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
%21 = load i8, i8* %20
ret i8 %21
22: ; preds = %4
%23 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define signext i8 @safely_get_character(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, %1
%6 = icmp slt i32 %5, %3
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
ret i8 %10
11: ; preds = %4
%12 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x16() {
  Assert_real((isxdigit(22) == 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_isxdigit.c",
              115, ("isxdigit should be 0 for 0x16"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x16>:
push   %rax
mov    $0x16,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x73,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x16\00"
define void @t_isxdigit_0x16() {
%1 = call i64 @isxdigit(i32 22)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x16\00"
define void @t_isxdigit_0x16() {
%1 = tail call i64 @isxdigit(i32 22)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
void skip_f_l(int fd) {
  char tmp;
  while (read(fd, &tmp, 1))
    if (tmp == '\n')
      break;
}


x86 assembly (clang, -O0):
<skip_f_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
je     114d <skip_f_l+0x3d>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1148 <skip_f_l+0x38>
jmp    114d <skip_f_l+0x3d>
jmp    111b <skip_f_l+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_f_l>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x7(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
je     113b <skip_f_l+0x2b>
cmpb   $0xa,0x7(%rsp)
jne    1120 <skip_f_l+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @skip_f_l(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = call i64 @read(i32 %5, i8* %3, i32 1)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %14
13: ; preds = %8
br label %4
14: ; preds = %12, %4
ret void
}

LLVM IR (-O2):
define void @skip_f_l(i32 %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = call i64 @read(i32 %0, i8* %2, i32 1)
%5 = icmp eq i64 %4, 0
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 10
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int build_niquery(int /*<<< orphan*/ *, struct in6_addr *, int);
int send_probe(int, int /*<<< orphan*/ *, struct in6_addr *, int,
               int /*<<< orphan*/);
int query_ipv4(int sock, uint8_t *buf, struct in6_addr *addr) {
  int cc;
  cc = build_niquery(buf, addr, 4);
  return send_probe(sock, buf, addr, cc, 0);
}


x86 assembly (clang, -O0):
<query_ipv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1040 <build_niquery@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <send_probe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_ipv4>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x4,%edx
call   1040 <build_niquery@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <send_probe@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @query_ipv4(i32 %0, i32* %1, %struct.in6_addr* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.in6_addr*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.in6_addr* %2, %struct.in6_addr** %6
%8 = load i32*, i32** %5
%9 = load %struct.in6_addr*, %struct.in6_addr** %6
%10 = call i32 @build_niquery(i32* %8, %struct.in6_addr* %9, i32 4)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32*, i32** %5
%13 = load %struct.in6_addr*, %struct.in6_addr** %6
%14 = load i32, i32* %7
%15 = call i32 @send_probe(i32 %11, i32* %12, %struct.in6_addr* %13, i32 %14, i32 0)
ret i32 %15
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @query_ipv4(i32 %0, i32* %1, %struct.in6_addr* %2) {
%4 = tail call i32 @build_niquery(i32* %1, %struct.in6_addr* %2, i32 4)
%5 = tail call i32 @send_probe(i32 %0, i32* %1, %struct.in6_addr* %2, i32 %4, i32 0)
ret i32 %5
}
unsigned long long foo(int a, unsigned int b, unsigned int c) {
  return a ? b : c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <foo+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <foo+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

LLVM IR (-O0):
define i64 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32, i32* %5
br label %13
11: ; preds = %3
%12 = load i32, i32* %6
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = zext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @foo(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
%6 = zext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x19_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x19_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x19_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x19_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x19_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ d9_to_line(unsigned long long, int);
int first_one(int /*<<< orphan*/);
int d9_flip_index(int x) { return first_one(d9_to_line(1ULL << x, x)); }


x86 assembly (clang, -O0):
<d9_flip_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%edi
shl    %cl,%rdi
mov    -0x4(%rbp),%esi
call   1030 <d9_to_line@plt>
mov    %eax,%edi
call   1040 <first_one@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d9_flip_index>:
push   %rax
mov    %edi,%ecx
mov    $0x1,%edi
shl    %cl,%rdi
mov    %ecx,%esi
call   1030 <d9_to_line@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <first_one@plt>

LLVM IR (-O0):
define i32 @d9_flip_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 1, %4
%6 = load i32, i32* %2
%7 = call i32 @d9_to_line(i64 %5, i32 %6)
%8 = call i32 @first_one(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @d9_flip_index(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nuw i64 1, %2
%4 = tail call i32 @d9_to_line(i64 %3, i32 %0)
%5 = tail call i32 @first_one(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void smp_rmb() { barrier(); }


x86 assembly (clang, -O0):
<smp_rmb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <barrier@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_rmb>:
xor    %eax,%eax
jmp    1030 <barrier@plt>

LLVM IR (-O0):
define void @smp_rmb() {
%1 = call i32 (...) @barrier()
ret void
}

LLVM IR (-O2):
define void @smp_rmb() {
%1 = tail call i32 (...) @barrier()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void uninit_fgetpos(void) {
  FILE *fp;
  fpos_t pos;
  fpos_t *ppos;
  fgetpos(fp, &pos);
  fp = fopen("filename", "rt");
  fgetpos(fp, ppos);
  fclose(fp);
}


x86 assembly (clang, -O0):
<uninit_fgetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <fgetpos@plt>
lea    0xeb4(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fgetpos@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninit_fgetpos>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
call   1040 <fgetpos@plt>
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <fgetpos@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninit_fgetpos() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32*
%4 = load i32*, i32** %1
%5 = call i32 @fgetpos(i32* %4, i32* %2)
%6 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = load i32*, i32** %3
%9 = call i32 @fgetpos(i32* %7, i32* %8)
%10 = load i32*, i32** %1
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninit_fgetpos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @fgetpos(i32* undef, i32* %1)
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fgetpos(i32* %4, i32* undef)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef size_t int32_t;

/* Variables and functions */
uint64_t quick_pow10(int32_t n) {
  static uint64_t pow10[11] = {1,         10,         100,        1000,
                               10000,     100000,     1000000,    10000000,
                               100000000, 1000000000, 10000000000};
  if (n < 0)
    return 1;
  else
    return pow10[n];
}


x86 assembly (clang, -O0):
<quick_pow10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jae    111f <quick_pow10+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1130 <quick_pow10+0x30>
mov    -0x10(%rbp),%rcx
lea    0x2f06(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_pow10>:
lea    0xef9(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@quick_pow10.pow10 = internal global [11 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000, i32 1410065408]
define i32 @quick_pow10(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ult i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %11
7: ; preds = %1
%8 = load i64, i64* %3
%9 = getelementptr inbounds [11 x i32], [11 x i32]* @quick_pow10.pow10, i64 0, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@quick_pow10.pow10 = internal unnamed_addr constant [11 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000, i32 1410065408]
define i32 @quick_pow10(i64 %0) {
%2 = getelementptr inbounds [11 x i32], [11 x i32]* @quick_pow10.pow10, i64 0, i64 %0
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_2Cuint32_mem(unsigned int *val) {
  return ((*val) & (0x2C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Cuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 44
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ stateMachineHandler();
int main() {
  stateMachineHandler();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @stateMachineHandler()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ruby_Init_Continuation_body();
void Init_continuation(void) { ruby_Init_Continuation_body(); }


x86 assembly (clang, -O0):
<Init_continuation>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ruby_Init_Continuation_body@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init_continuation>:
xor    %eax,%eax
jmp    1030 <ruby_Init_Continuation_body@plt>

LLVM IR (-O0):
define void @Init_continuation() {
%1 = call i32 (...) @ruby_Init_Continuation_body()
ret void
}

LLVM IR (-O2):
define void @Init_continuation() {
%1 = tail call i32 (...) @ruby_Init_Continuation_body()
ret void
}
/* Variables and functions */
int ic2;
long jc2;
int m(char *, int, long);
int call2(int pi2, long pj2) {
  volatile ic2 = pi2 + 64;
  volatile jc2 = pj2 - 64;
  return m("call2", ic2, jc2);
}


x86 assembly (clang, -O0):
<call2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x40,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
movslq %eax,%rdx
lea    0xebd(%rip),%rdi
call   1030 <m@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call2>:
add    $0x40,%edi
mov    %edi,-0x4(%rsp)
add    $0xffffffc0,%esi
mov    %esi,-0x8(%rsp)
mov    -0x4(%rsp),%esi
movslq -0x8(%rsp),%rdx
lea    0xed2(%rip),%rdi
jmp    1030 <m@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"call2\00"
@ic2 = global i32 0
@jc2 = global i64 0
define i32 @call2(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 64
store volatile i32 %8, i32* %5
%9 = load i64, i64* %4
%10 = sub nsw i64 %9, 64
%11 = trunc i64 %10 to i32
store volatile i32 %11, i32* %6
%12 = load volatile i32, i32* %5
%13 = load volatile i32, i32* %6
%14 = sext i32 %13 to i64
%15 = call i32 @m(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"call2\00"
@ic2 = global i32 0
@jc2 = global i64 0
define i32 @call2(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = add nsw i32 %0, 64
store volatile i32 %6, i32* %3
%7 = bitcast i32* %4 to i8*
%8 = trunc i64 %1 to i32
%9 = add i32 %8, -64
store volatile i32 %9, i32* %4
%10 = load volatile i32, i32* %3
%11 = load volatile i32, i32* %4
%12 = sext i32 %11 to i64
%13 = tail call i32 @m(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10, i64 %12)
ret i32 %13
}
void X509_CRL_new(void) {}


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

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

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

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