xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *memdup(void *src, int len) {
  void *res = malloc(len);
  if (res)
    memcpy(res, src, len);
  return res;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <memdup+0x36>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1145 <memdup+0x25>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
double d_abs(double num) { return num >= 0 ? num : -num; }


x86 assembly (clang, -O0):
<d_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <d_abs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <d_abs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_abs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @d_abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @d_abs(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ assertEquals(int, int);
void assertEqualsArray(int *expected, int *actual, int length) {
  for (int i = 0; i < length; i++) {
    assertEquals(expected[i], actual[i]);
  }
}


x86 assembly (clang, -O0):
<assertEqualsArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <assertEqualsArray+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <assertEquals@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <assertEqualsArray+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertEqualsArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <assertEqualsArray+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
call   1030 <assertEquals@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <assertEqualsArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @assertEqualsArray(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %15, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %1, i64 %9
%13 = load i32, i32* %12
%14 = tail call i32 @assertEquals(i32 %11, i32 %13)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %8
}
/* Variables and functions */
int /*<<< orphan*/ binary_search(int);
int main(void) {
  binary_search(8);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <binary_search@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @binary_search(i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_display(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Enter positive enter to check:\n");
  scanf("%d", &num);
  check_display(num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <check_display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <check_display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter positive enter to check:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @check_display(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [31 x i8] c"Enter positive enter to check:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @check_display(i32 %5)
ret i32 0
}
int octave_o_creat_wrapper(void) { return -1; }


x86 assembly (clang, -O0):
<octave_o_creat_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_o_creat_wrapper>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @octave_o_creat_wrapper() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @octave_o_creat_wrapper() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ system(char *);
void error(char *err) {
  printf("ERROR: %s!\n", err);
  system("pause");
  return;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"ERROR: %s!\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"ERROR: %s!\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int external_add(int a, int b) { return (a + b); }


x86 assembly (clang, -O0):
<external_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<external_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @external_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @external_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int test_imm_06uint16_mem(unsigned short *val) {
  return ((*val) & (-0x06 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_06uint16_mem>:
movzwl (%rdi),%eax
test   $0xfffa,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_06uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -6
%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_06uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -6
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int slk_attrset(unsigned int);
int wrap_slk_attrset(unsigned int attrs) { return slk_attrset(attrs); }


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

x86 assembly (clang, -O2):
<wrap_slk_attrset>:
jmp    1030 <slk_attrset@plt>

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

LLVM IR (-O2):
define i32 @wrap_slk_attrset(i32 %0) {
%2 = tail call i32 @slk_attrset(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int string_ln(char *);
int main() {
  char str[20];
  int length;
  printf("\nEnter any string : ");
  length = string_ln(str);
  printf("The length of the given string %s is : %d", str, length);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <string_ln@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <string_ln@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0AEnter any string : \00"
@.str.1 = [42 x i8] c"The length of the given string %s is : %d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @string_ln(i8* %4)
store i32 %5, i32* %2
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0AEnter any string : \00"
@.str.1 = [42 x i8] c"The length of the given string %s is : %d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @string_ln(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %4)
ret i32 0
}
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch) {
  free((m[nrl] + ncl - 1));
  free((m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_imatrix(i32** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32** %0, i32*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i32**, i32*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i32*, i32** %11, i64 %12
%14 = load i32*, i32** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 -1
%18 = bitcast i32* %17 to i8*
%19 = load i32**, i32*** %6
%20 = load i64, i64* %7
%21 = getelementptr inbounds i32*, i32** %19, i64 %20
%22 = getelementptr inbounds i32*, i32** %21, i64 -1
%23 = bitcast i32** %22 to i8*
ret void
}

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = bitcast i32* %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds i32*, i32** %6, i64 -1
%12 = bitcast i32** %11 to i8*
tail call void @free(i8* %12)
ret void
}
/* Type definitions */
struct hasht {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t hasht_used(struct hasht *);
void test_hasht_used(struct hasht *t, size_t s) { assert(hasht_used(t) == s); }


x86 assembly (clang, -O0):
<test_hasht_used>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hasht_used@plt>
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hasht_used>:
push   %rbx
mov    %rsi,%rbx
call   1040 <hasht_used@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.hasht = type { i32 }
define void @test_hasht_used(%struct.hasht* %0, i64 %1) {
%3 = alloca %struct.hasht*
%4 = alloca i64
store %struct.hasht* %0, %struct.hasht** %3
store i64 %1, i64* %4
%5 = load %struct.hasht*, %struct.hasht** %3
%6 = call i64 @hasht_used(%struct.hasht* %5)
%7 = load i64, i64* %4
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.hasht = type { i32 }
define void @test_hasht_used(%struct.hasht* %0, i64 %1) {
%3 = tail call i64 @hasht_used(%struct.hasht* %0)
%4 = icmp eq i64 %3, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int Idgt = 11;
  double fdgt = 4.6;
  printf(
      "\vUsando el formato (tiponombre)valor, podemos cambiar el formato.\n");
  printf("Por ejemplo Idgt=11 cambia float: %f\n\v", (float)Idgt);
  printf("Por ejemplo fdgt=4.6 cambia double: %i\n\v", (int)fdgt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xefa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%esi
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"\0BUsando el formato (tiponombre)valor, podemos cambiar el formato.\0A\00"
@.str.1 = [39 x i8] c"Por ejemplo Idgt=11 cambia float: %f\0A\0B\00"
@.str.2 = [41 x i8] c"Por ejemplo fdgt=4.6 cambia double: %i\0A\0B\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 11, i32* %2
store double 4.600000e+00, double* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = load double, double* %3
%10 = fptosi double %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [39 x i8] c"Por ejemplo Idgt=11 cambia float: %f\0A\0B\00"
@.str.2 = [41 x i8] c"Por ejemplo fdgt=4.6 cambia double: %i\0A\0B\00"
@str = [66 x i8] c"\0BUsando el formato (tiponombre)valor, podemos cambiar el formato.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double 1.100000e+01)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int _test_ready(int argc, char **argv) {
  (void)argc;
  (void)argv;
  puts("READY");
  return 0;
}


x86 assembly (clang, -O0):
<_test_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_ready>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"READY\00"
define i32 @_test_ready(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"READY\00"
define i32 @_test_ready(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ log_flush();
void panic(void) {
  log_flush();
  (void)kill(getpid(), SIGABRT);
  _exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <log_flush@plt>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
call   1060 <kill@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
xor    %eax,%eax
call   1040 <log_flush@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    0x2e8a(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1060 <kill@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @panic() {
%1 = call i32 (...) @log_flush()
%2 = call i32 (...) @getpid()
%3 = load i32, i32* @SIGABRT
%4 = call i32 @kill(i32 %2, i32 %3)
%5 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @panic() {
%1 = tail call i32 (...) @log_flush()
%2 = tail call i32 (...) @getpid()
%3 = load i32, i32* @SIGABRT
%4 = tail call i32 @kill(i32 %2, i32 %3)
%5 = tail call i32 @_exit(i32 1)
unreachable
}
int magic_version(void) { return 519; }


x86 assembly (clang, -O0):
<magic_version>:
push   %rbp
mov    %rsp,%rbp
mov    $0x207,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<magic_version>:
mov    $0x207,%eax
ret

LLVM IR (-O0):
define i32 @magic_version() {
ret i32 519
}

LLVM IR (-O2):
define i32 @magic_version() {
ret i32 519
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ read_file(int);
int ro_openat(int, char *);
void ebuild_headler(int fd, char *name) {
  int next_fd = ro_openat(fd, name);
  read_file(next_fd);
  close(next_fd);
}


x86 assembly (clang, -O0):
<ebuild_headler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ro_openat@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <read_file@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebuild_headler>:
push   %rbx
call   1030 <ro_openat@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <read_file@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @ebuild_headler(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @ro_openat(i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @read_file(i32 %9)
%11 = load i32, i32* %5
%12 = call i32 @close(i32 %11)
ret void
}

LLVM IR (-O2):
define void @ebuild_headler(i32 %0, i8* %1) {
%3 = tail call i32 @ro_openat(i32 %0, i8* %1)
%4 = tail call i32 @read_file(i32 %3)
%5 = tail call i32 @close(i32 %3)
ret void
}
unsigned short t4(unsigned short a, unsigned short b) {
  printf("%s: a: %u\n", __func__, a);
  printf("%s: b: %u\n", __func__, b);
  return a + b;
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%edx
lea    0xecf(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movzwl -0x4(%rbp),%edx
lea    0xec4(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee1(%rip),%rdi
lea    0xee5(%rip),%r14
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s: a: %u\0A\00"
@__func__.t4 = [3 x i8] c"t4\00"
@.str.1 = [11 x i8] c"%s: b: %u\0A\00"
define zeroext i16 @t4(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t4, i64 0, i64 0), i32 %6)
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t4, i64 0, i64 0), i32 %9)
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i16, i16* %4
%14 = zext i16 %13 to i32
%15 = add nsw i32 %12, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s: a: %u\0A\00"
@__func__.t4 = [3 x i8] c"t4\00"
@.str.1 = [11 x i8] c"%s: b: %u\0A\00"
define zeroext i16 @t4(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t4, i64 0, i64 0), i32 %3)
%5 = zext i16 %1 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t4, i64 0, i64 0), i32 %5)
%7 = add i16 %1, %0
ret i16 %7
}
/* Variables and functions */
long double __qatan2d(long double, long double);
long double intr_wrap_025(long double p1, long double p2) {
  return __qatan2d(p1, p2);
}


x86 assembly (clang, -O0):
<intr_wrap_025>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <__qatan2d@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_025>:
jmp    1030 <__qatan2d@plt>

LLVM IR (-O0):
define x86_fp80 @intr_wrap_025(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @__qatan2d(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_025(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @__qatan2d(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int syscall(int, int, int /*<<< orphan*/, int);
void set_ioprio(int prio) {
  if (syscall(251, 2, 0, prio) == -1)
    perror("Can not set IO priority to idle class");
}


x86 assembly (clang, -O0):
<set_ioprio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xfb,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
jne    1154 <set_ioprio+0x34>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ioprio>:
push   %rax
mov    %edi,%ecx
mov    $0xfb,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
je     113b <set_ioprio+0x1b>
pop    %rax
ret
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Can not set IO priority to idle class\00"
define void @set_ioprio(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @syscall(i32 251, i32 2, i32 0, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Can not set IO priority to idle class\00"
define void @set_ioprio(i32 %0) {
%2 = tail call i32 @syscall(i32 251, i32 2, i32 0, i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ width;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
unsigned short get_XFontSetExtents_max_ink_extent_width(void *_p) {
  return (unsigned short)((XFontSetExtents *)_p)->max_ink_extent.width;
}


x86 assembly (clang, -O0):
<get_XFontSetExtents_max_ink_extent_width>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XFontSetExtents_max_ink_extent_width>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define zeroext i16 @get_XFontSetExtents_max_ink_extent_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @get_XFontSetExtents_max_ink_extent_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
unsigned short get_unaligned_uint16(const void *p) {
  const struct { unsigned short d; } __attribute__((packed)) *pp = p;
  return pp->d;
}


x86 assembly (clang, -O0):
<get_unaligned_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzwl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_uint16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.anon = type { i16 }
define zeroext i16 @get_unaligned_uint16(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i16, i16* %7
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @get_unaligned_uint16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i16*
%3 = load i16, i16* %2
ret i16 %3
}
void A_init() {}


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

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

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

LLVM IR (-O2):
define void @A_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ child_log(char *, char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *freopen(char const *, char const *, int /*<<< orphan*/ *);
void reassociate_file(const char *path, const char *mode, FILE *file) {
  if (freopen(path, mode, file) == NULL) {
    child_log("Child: Could not reassociate file to %s\n", path);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<reassociate_file>:
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
call   1040 <freopen@plt>
cmp    $0x0,%rax
jne    1179 <reassociate_file+0x49>
mov    -0x8(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <child_log@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reassociate_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <freopen@plt>
test   %rax,%rax
je     1140 <reassociate_file+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <child_log@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Child: Could not reassociate file to %s\0A\00"
define void @reassociate_file(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i32* @freopen(i8* %7, i8* %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = call i32 @child_log(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Child: Could not reassociate file to %s\0A\00"
define void @reassociate_file(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32* @freopen(i8* %0, i8* %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @child_log(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %3
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ htole32(scalar_t__);
scalar_t__ multiply_mod(int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ pow_mod(int, int);
int /*<<< orphan*/ reciprocal_mod(int /*<<< orphan*/);
scalar_t__ reverse_bits(scalar_t__);
uint32_t reverse_crc32(uint32_t delta, uint64_t endDistance) {
  delta = reverse_bits(delta);
  delta = (uint32_t)multiply_mod(reciprocal_mod(pow_mod(2, endDistance * 8)),
                                 delta);
  delta = reverse_bits(delta);
  return htole32(delta);
}


x86 assembly (clang, -O0):
<reverse_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <reverse_bits@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
shl    $0x3,%esi
mov    $0x2,%edi
call   1070 <pow_mod@plt>
mov    %eax,%edi
call   1040 <reciprocal_mod@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1060 <multiply_mod@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <reverse_bits@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <htole32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_crc32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1050 <reverse_bits@plt>
mov    %rax,%r14
shl    $0x3,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1070 <pow_mod@plt>
mov    %eax,%edi
call   1040 <reciprocal_mod@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1060 <multiply_mod@plt>
mov    %rax,%rdi
call   1050 <reverse_bits@plt>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <htole32@plt>

LLVM IR (-O0):
define i64 @reverse_crc32(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = call i64 @reverse_bits(i64 %5)
store i64 %6, i64* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = call i32 @pow_mod(i32 2, i32 %8)
%10 = call i32 @reciprocal_mod(i32 %9)
%11 = load i64, i64* %3
%12 = call i64 @multiply_mod(i32 %10, i64 %11)
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = call i64 @reverse_bits(i64 %13)
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = call i64 @htole32(i64 %15)
ret i64 %16
}

LLVM IR (-O2):
define i64 @reverse_crc32(i64 %0, i32 %1) {
%3 = tail call i64 @reverse_bits(i64 %0)
%4 = shl nsw i32 %1, 3
%5 = tail call i32 @pow_mod(i32 2, i32 %4)
%6 = tail call i32 @reciprocal_mod(i32 %5)
%7 = tail call i64 @multiply_mod(i32 %6, i64 %3)
%8 = tail call i64 @reverse_bits(i64 %7)
%9 = tail call i64 @htole32(i64 %8)
ret i64 %9
}
void __SLIC_fun_local_irq_enable_entry(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @__SLIC_fun_local_irq_enable_entry() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_array(int **, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ quicksort(int *, int /*<<< orphan*/, int);
int main() {
  int *arr = NULL, size = 16;
  create_array(&arr, size);
  print_array(arr, size);
  quicksort(arr, 0, size - 1);
  print_array(arr, size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <create_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1050 <create_array@plt>
mov    (%rsp),%rdi
mov    $0x10,%esi
call   1030 <print_array@plt>
mov    (%rsp),%rdi
xor    %esi,%esi
mov    $0xf,%edx
call   1040 <quicksort@plt>
mov    (%rsp),%rdi
mov    $0x10,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
store i32* null, i32** %1
store i32 16, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @create_array(i32** %1, i32 %3)
%5 = load i32*, i32** %1
%6 = load i32, i32* %2
%7 = call i32 @print_array(i32* %5, i32 %6)
%8 = load i32*, i32** %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = call i32 @quicksort(i32* %8, i32 0, i32 %10)
%12 = load i32*, i32** %1
%13 = load i32, i32* %2
%14 = call i32 @print_array(i32* %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%3 = call i32 @create_array(i32** %1, i32 16)
%4 = load i32*, i32** %1
%5 = call i32 @print_array(i32* %4, i32 16)
%6 = load i32*, i32** %1
%7 = call i32 @quicksort(i32* %6, i32 0, i32 15)
%8 = load i32*, i32** %1
%9 = call i32 @print_array(i32* %8, i32 16)
ret i32 0
}
/* Variables and functions */
int open(char const *, int);
int lfopen(const char *device, int flags) {
  int fd = open(device, flags);
  return fd;
}


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

x86 assembly (clang, -O2):
<lfopen>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @lfopen(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %3
}
void strtokens(char **str) {
  char *s;
  s = *str;
  while (*s) {
    if (*s == '\'')
      *s = '"';
    *s++;
  }
}


x86 assembly (clang, -O0):
<strtokens>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strtokens+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
jne    1137 <strtokens+0x37>
mov    -0x10(%rbp),%rax
movb   $0x22,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <strtokens+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtokens>:
mov    (%rdi),%rax
jmp    1117 <strtokens+0x17>
cs nopw 0x0(%rax,%rax,1)
nop
movb   $0x22,(%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x27,%cl
je     1110 <strtokens+0x10>
test   %cl,%cl
jne    1113 <strtokens+0x13>
ret

LLVM IR (-O0):
define void @strtokens(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
store i8* %5, i8** %3
br label %6
6: ; preds = %17, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 39
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %3
store i8 34, i8* %16
br label %17
17: ; preds = %15, %10
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8, i8* %18
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @strtokens(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %7, %1
%4 = phi i8* [ %2, %1 ], [ %8, %7 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 39, label %6
]
6: ; preds = %3
store i8 34, i8* %4
br label %7
7: ; preds = %3, %6
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FTM3_DriverIRQHandler();
__attribute__((weak)) void FTM3_IRQHandler(void) { FTM3_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @FTM3_IRQHandler() {
%1 = call i32 (...) @FTM3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @FTM3_IRQHandler() {
%1 = tail call i32 (...) @FTM3_DriverIRQHandler()
ret void
}
/* Variables and functions */
int if_readconf();
int if_readlist_proc(int /*<<< orphan*/ *);
int if_readlist(void) {
  int err = if_readlist_proc(NULL);
  if (!err)
    err = if_readconf();
  return err;
}


x86 assembly (clang, -O0):
<if_readlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <if_readlist_proc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <if_readlist+0x28>
mov    $0x0,%al
call   1040 <if_readconf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_readlist>:
push   %rax
xor    %edi,%edi
call   1030 <if_readlist_proc@plt>
test   %eax,%eax
je     112e <if_readlist+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <if_readconf@plt>

LLVM IR (-O0):
define i32 @if_readlist() {
%1 = alloca i32
%2 = call i32 @if_readlist_proc(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @if_readconf()
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @if_readlist() {
%1 = tail call i32 @if_readlist_proc(i32* null)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @if_readconf()
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %1, %0 ], [ %4, %3 ]
ret i32 %6
}
/* Variables and functions */
size_t Base64_EncodedLength(char const *src, size_t srcLength) {
  return ((srcLength + 2) / 3 * 4) + 1;
}


x86 assembly (clang, -O0):
<Base64_EncodedLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base64_EncodedLength>:
lea    0x2(%rsi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @Base64_EncodedLength(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = add i64 %5, 2
%7 = udiv i64 %6, 3
%8 = mul i64 %7, 4
%9 = add i64 %8, 1
ret i64 %9
}

LLVM IR (-O2):
define i64 @Base64_EncodedLength(i8* nocapture readnone %0, i64 %1) {
%3 = add i64 %1, 2
%4 = udiv i64 %3, 3
%5 = shl i64 %4, 2
%6 = or i64 %5, 1
ret i64 %6
}
/* Variables and functions */
void *malloc(int);
int main() {
  int i = 3;
  int j = 4;
  void *tmp = malloc(sizeof(int *) * 2);
  int *ptrI = &i;
  int *ptrj = &j;
  int *tmpfst = *((int **)tmp);
  int *tmpsnd = *(((int **)tmp) + 1);
  tmpfst = ptrI;
  tmpsnd = ptrj;
  int *snd = *((int **)tmp + 1);
  if (*tmpfst == 3 && *tmpsnd == 4) {
    return 0;
  }
ERROR:
  goto ERROR;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
cmpl   $0x3,(%rax)
jne    11a0 <main+0x90>
mov    -0x38(%rbp),%rax
cmpl   $0x4,(%rax)
jne    11a0 <main+0x90>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret
jmp    11a5 <main+0x95>
jmp    11a5 <main+0x95>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
%10 = call i8* @malloc(i32 16)
store i8* %10, i8** %4
store i32* %2, i32** %5
store i32* %3, i32** %6
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32**
%13 = load i32*, i32** %12
store i32* %13, i32** %7
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i32**
%16 = getelementptr inbounds i32*, i32** %15, i64 1
%17 = load i32*, i32** %16
store i32* %17, i32** %8
%18 = load i32*, i32** %5
store i32* %18, i32** %7
%19 = load i32*, i32** %6
store i32* %19, i32** %8
%20 = load i8*, i8** %4
%21 = bitcast i8* %20 to i32**
%22 = getelementptr inbounds i32*, i32** %21, i64 1
%23 = load i32*, i32** %22
store i32* %23, i32** %9
%24 = load i32*, i32** %7
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 3
br i1 %26, label %27, label %32
27: ; preds = %0
%28 = load i32*, i32** %8
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 4
br i1 %30, label %31, label %32
31: ; preds = %27
ret i32 0
32: ; preds = %27, %0
br label %33
33: ; preds = %33, %32
br label %33
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}