xunge/DecIR huggingface dataset:
int tlsf_ffs(unsigned int word) { return __builtin_ffs(word) - 1; }


x86 assembly (clang, -O0):
<tlsf_ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
bsf    %edx,%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlsf_ffs>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tlsf_ffs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = add i32 %4, 1
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @tlsf_ffs(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 -1, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printUsage(const char *name) { printf("Usage: %s [-h | -v]\n", name); }


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

x86 assembly (clang, -O2):
<printUsage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [-h | -v]\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [-h | -v]\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long long);
void writeValue(const char *fname, void *dataptr) {
  long long data = (long long)*((long long *)dataptr);
  FILE *fp;
  fp = fopen(fname, "a");
  fprintf(fp, "%lld,\n", data);
  fclose(fp);
}


x86 assembly (clang, -O0):
<writeValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeValue>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [7 x i8] c"%lld,\0A\00"
define void @writeValue(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %3
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = load i64, i64* %5
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %13)
%15 = load i32*, i32** %6
%16 = call i32 @fclose(i32* %15)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [7 x i8] c"%lld,\0A\00"
define void @writeValue(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = load i64, i64* %3
%5 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %4)
%7 = tail call i32 @fclose(i32* %5)
ret void
}
/* Variables and functions */
char *strnpbrk(char const *, size_t, char *);
size_t patternSeparatorPos(const char *pattern, size_t len) {
  char *separator = strnpbrk(pattern, len, "?:[]");
  if (separator == NULL) {
    return len;
  } else {
    return separator - pattern;
  }
}


x86 assembly (clang, -O0):
<patternSeparatorPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <strnpbrk@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1150 <patternSeparatorPos+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <patternSeparatorPos+0x4f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<patternSeparatorPos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdx
call   1030 <strnpbrk@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"?:[]\00"
define i64 @patternSeparatorPos(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @strnpbrk(i8* %7, i64 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i64, i64* %5
store i64 %13, i64* %3
br label %20
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i8*, i8** %4
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
store i64 %19, i64* %3
br label %20
20: ; preds = %14, %12
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"?:[]\00"
define i64 @patternSeparatorPos(i8* %0, i64 %1) {
%3 = tail call i8* @strnpbrk(i8* %0, i64 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char s[] = "hello world";
  printf("%s \n", s);
  reverse(s);
  printf("%s \n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0xec7(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s = [12 x i8] c"hello world\00"
@.str = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
store i32 0, i32* %1
%3 = bitcast [12 x i8]* %2 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%7 = call i32 @reverse(i8* %6)
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [12 x i8] c"hello world\00"
@.str = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int execute_chmod() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_chmod() {
ret i32 0
}
int compareints(const void *a, const void *b) {
  return (*(int *)a - *(int *)b);
}


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

x86 assembly (clang, -O2):
<compareints>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @compareints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
double ceil(double);
double ceilw(double v) { return ceil(v); }


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

x86 assembly (clang, -O2):
<ceilw>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @ceilw(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @ceilw(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
/* Variables and functions */
size_t strlen(char *);
char *strncat(char *, char const *, size_t);
char *entrustash_strncat(char *dest, size_t dest_size, char const *src,
                         size_t count) {
  return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count)
                                               : NULL;
}


x86 assembly (clang, -O0):
<entrustash_strncat>:
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    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x20(%rbp),%rax
add    $0x1,%rax
cmp    -0x10(%rbp),%rax
ja     116d <entrustash_strncat+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <strncat@plt>
mov    %rax,-0x28(%rbp)
jmp    1178 <entrustash_strncat+0x58>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1178 <entrustash_strncat+0x58>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entrustash_strncat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %r14,%rax
add    $0x1,%rax
cmp    %r12,%rax
jbe    1149 <entrustash_strncat+0x29>
xor    %ebx,%ebx
jmp    1157 <entrustash_strncat+0x37>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <strncat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @entrustash_strncat(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = load i64, i64* %8
%12 = add i64 %10, %11
%13 = add i64 %12, 1
%14 = load i64, i64* %6
%15 = icmp ule i64 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i8* @strncat(i8* %17, i8* %18, i64 %19)
br label %22
21: ; preds = %4
br label %22
22: ; preds = %21, %16
%23 = phi i8* [ %20, %16 ], [ null, %21 ]
ret i8* %23
}

LLVM IR (-O2):
define i8* @entrustash_strncat(i8* %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add i64 %3, 1
%7 = add i64 %6, %5
%8 = icmp ugt i64 %7, %1
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i8* @strncat(i8* dereferenceable(1) %0, i8* %2, i64 %3)
br label %11
11: ; preds = %4, %9
%12 = phi i8* [ %0, %9 ], [ null, %4 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ goldbachConjecture(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  do {
    printf("please enter a number:");
    int number = 0;
    scanf("%d", &number);
    goldbachConjecture(number);
  } while (1);
  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>
movl   $0x0,-0x8(%rbp)
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <goldbachConjecture@plt>
mov    $0x1,%al
test   $0x1,%al
jne    113f <main+0xf>
jmp    1179 <main+0x49>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
lea    0xed0(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
movl   $0x0,0xc(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <goldbachConjecture@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [23 x i8] c"please enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @goldbachConjecture(i32 %6)
br label %8
8: ; preds = %3
br i1 true, label %3, label %9
9: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"please enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @goldbachConjecture(i32 %6)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void hello(const char *name) { printf("Hello %s!\n", name); }


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

x86 assembly (clang, -O2):
<hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hello %s!\0A\00"
define void @hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char charToLettre(char);
char *malloc(int);
char *charToHexa(char valeur) {
  char dizaine = ((unsigned char)valeur) / 16;
  char unite = ((unsigned char)valeur) % 16;
  char *hexa = malloc(2 * sizeof(char));
  hexa[0] = charToLettre(dizaine);
  hexa[1] = charToLettre(unite);
  return hexa;
}


x86 assembly (clang, -O0):
<charToHexa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x3(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <charToLettre@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x3(%rbp),%edi
call   1030 <charToLettre@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToHexa>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    %ebp,%ebx
shr    $0x4,%bl
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
movzbl %bl,%edi
call   1030 <charToLettre@plt>
mov    %al,(%r14)
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <charToLettre@plt>
mov    %al,0x1(%r14)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @charToHexa(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = sdiv i32 %7, 16
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = srem i32 %11, 16
%13 = trunc i32 %12 to i8
store i8 %13, i8* %4
%14 = call i8* @malloc(i32 2)
store i8* %14, i8** %5
%15 = load i8, i8* %3
%16 = call signext i8 @charToLettre(i8 signext %15)
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 %16, i8* %18
%19 = load i8, i8* %4
%20 = call signext i8 @charToLettre(i8 signext %19)
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @charToHexa(i8 signext %0) {
%2 = lshr i8 %0, 4
%3 = and i8 %0, 15
%4 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%5 = tail call signext i8 @charToLettre(i8 signext %2)
store i8 %5, i8* %4
%6 = tail call signext i8 @charToLettre(i8 signext %3)
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %7
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void init_comment() { printf("> "); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"> \00"
define void @init_comment() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define void @init_comment() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Z8(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", Z8("input.txt", "out.txt")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <Z8@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
lea    0xede(%rip),%rsi
call   1040 <Z8@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"input.txt\00"
@.str.2 = [8 x i8] c"out.txt\00"
define i32 @main() {
%1 = call i32 @Z8(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"input.txt\00"
@.str.2 = [8 x i8] c"out.txt\00"
define i32 @main() {
%1 = tail call i32 @Z8(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void the_for() {
  for (int i = 0; i < 5; i = i + 1) {
    printf("OK i is now equal to: %d\n", i);
  }
}


x86 assembly (clang, -O0):
<the_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1146 <the_for+0x36>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <the_for+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<the_for>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"OK i is now equal to: %d\0A\00"
define void @the_for() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"OK i is now equal to: %d\0A\00"
define void @the_for() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
void test_sample(void) {}


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

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

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

LLVM IR (-O2):
define void @test_sample() {
ret void
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ perror(char *);
int file_close(int fd) {
  if (close(fd) < 0) {
    perror("libsoc-file-debug");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1155 <file_close+0x35>
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <file_close+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_close>:
push   %rax
call   1030 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1132 <file_close+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"libsoc-file-debug\00"
define i32 @file_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [18 x i8] c"libsoc-file-debug\00"
define i32 @file_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printSoundLoadError() { fprintf(stderr, "Could not load sound\n"); }


x86 assembly (clang, -O0):
<printSoundLoadError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSoundLoadError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Could not load sound\0A\00"
define void @printSoundLoadError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Could not load sound\0A\00"
define void @printSoundLoadError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
void Comp0_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Comp0_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Comp0_Handler+0x9>
jmp    1109 <Comp0_Handler+0x9>

x86 assembly (clang, -O2):
<Comp0_Handler>:
jmp    1100 <Comp0_Handler>

LLVM IR (-O0):
define void @Comp0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Comp0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x6c() {
  Assert_real((isxdigit(108) == 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",
              545, ("isxdigit should be 0 for l"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x6c>:
push   %rax
mov    $0x6c,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x221,%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 = [27 x i8] c"isxdigit should be 0 for l\00"
define void @t_isxdigit_0x6c() {
%1 = call i64 @isxdigit(i32 108)
%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 545, i8* getelementptr inbounds ([27 x i8], [27 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 = [27 x i8] c"isxdigit should be 0 for l\00"
define void @t_isxdigit_0x6c() {
%1 = tail call i64 @isxdigit(i32 108)
%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 545, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGPDFScannerRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGPDFScannerRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGPDFScannerRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  double tv_sec;
  int tv_usec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
double myutime() {
  struct rusage usage;
  getrusage(RUSAGE_SELF, &usage);
  return usage.ru_utime.tv_sec + usage.ru_utime.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<myutime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myutime>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <getrusage@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i32 }
@RUSAGE_SELF = global i32 0
define double @myutime() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %11
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { double, i32 }
@RUSAGE_SELF = global i32 0
define double @myutime() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int SBIUsage(void) {
  printf("\nTo create a Secure Boot Image:\n");
  printf("secimage: -out <output binary> [-hmac hmac_binary_key] <-config "
         "configfile>");
  printf("\n\t\t[-bl input binary]\n");
  return 0;
}


x86 assembly (clang, -O0):
<SBIUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SBIUsage>:
push   %rax
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0ATo create a Secure Boot Image:\0A\00"
@.str.1 = [76 x i8] c"secimage: -out <output binary> [-hmac hmac_binary_key] <-config configfile>\00"
@.str.2 = [23 x i8] c"\0A\09\09[-bl input binary]\0A\00"
define i32 @SBIUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [76 x i8] c"secimage: -out <output binary> [-hmac hmac_binary_key] <-config configfile>\00"
@str = [32 x i8] c"\0ATo create a Secure Boot Image:\00"
@str.3 = [22 x i8] c"\0A\09\09[-bl input binary]\00"
define i32 @SBIUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xkey_display(void *_p) {
  return (void *)((XEvent *)_p)->xkey.display;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xkey_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xkey_display(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 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xkey_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void I2CMasterIntEnableEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<I2CMasterIntEnableEx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntEnableEx>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x10(%rcx)
ret

LLVM IR (-O0):
define void @I2CMasterIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 16
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 16
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS12_SAFEBAG;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_SAFEBAG_it;
int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKCS12_SAFEBAG_it);
}


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

x86 assembly (clang, -O2):
<i2d_PKCS12_SAFEBAG>:
mov    0x2ee1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@PKCS12_SAFEBAG_it = global i32 0
define i32 @i2d_PKCS12_SAFEBAG(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 @ASN1_item_i2d(i32* %5, i8** %6, i32* @PKCS12_SAFEBAG_it)
ret i32 %7
}

LLVM IR (-O2):
@PKCS12_SAFEBAG_it = global i32 0
define i32 @i2d_PKCS12_SAFEBAG(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PKCS12_SAFEBAG_it)
ret i32 %3
}
int fa_bit2byte(int bit) { return ((bit + 8 - 1) / 8); }


x86 assembly (clang, -O0):
<fa_bit2byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
sub    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_bit2byte>:
lea    0x7(%rdi),%ecx
lea    0xe(%rdi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @fa_bit2byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 8
%5 = sub nsw i32 %4, 1
%6 = sdiv i32 %5, 8
ret i32 %6
}

LLVM IR (-O2):
define i32 @fa_bit2byte(i32 %0) {
%2 = add nsw i32 %0, 7
%3 = sdiv i32 %2, 8
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void force_unwind() { abort(); }


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

x86 assembly (clang, -O2):
<force_unwind>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @force_unwind() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @force_unwind() {
%1 = tail call i32 (...) @abort()
unreachable
}
void g_node_is_ancestor() {}


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

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

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

LLVM IR (-O2):
define void @g_node_is_ancestor() {
ret void
}
/* Variables and functions */
float exp2(float);
float EXP2(float x) { return exp2(x); }


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

x86 assembly (clang, -O2):
<EXP2>:
jmp    1030 <exp2@plt>

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

LLVM IR (-O2):
define float @EXP2(float %0) {
%2 = tail call float @exp2(float %0)
ret float %2
}
int strcmp(char const *lhs, char const *rhs) {
  return __builtin_strcmp(lhs, rhs);
}


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

x86 assembly (clang, -O2):
<strcmp>:
jmp    1100 <strcmp>

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
main() { return (int[]){1, 2, 3, 4}[2] + f(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 2, i32* %4
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32 3, i32* %5
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 4, i32* %6
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%8 = load i32, i32* %7
%9 = call i32 (...) @f()
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = add nsw i32 %1, 3
ret i32 %2
}
/* Variables and functions */
char *Ident(char *);
__attribute__((no)) char *Func1() {
  char local[1 << 12];
  return Ident(local);
}


x86 assembly (clang, -O0):
<Func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1000,%rsp
lea    -0x1000(%rbp),%rdi
call   1030 <Ident@plt>
add    $0x1000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Func1>:
sub    $0x1008,%rsp
mov    %rsp,%rdi
call   1030 <Ident@plt>
add    $0x1008,%rsp
ret

LLVM IR (-O0):
define i8* @Func1() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i8* @Ident(i8* %2)
ret i8* %3
}

LLVM IR (-O2):
define i8* @Func1() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = call i8* @Ident(i8* %2)
ret i8* %3
}
int CharSimpleOp(char c) {
  return (c == '(') || (c == '<') || (c == ')') || (c == ';');
}


x86 assembly (clang, -O0):
<CharSimpleOp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x28,%ecx
mov    %al,-0x2(%rbp)
je     114d <CharSimpleOp+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3c,%ecx
mov    %al,-0x2(%rbp)
je     114d <CharSimpleOp+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x29,%ecx
mov    %al,-0x2(%rbp)
je     114d <CharSimpleOp+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x3b,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharSimpleOp>:
cmp    $0x3c,%dil
ja     1120 <CharSimpleOp+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x1000030000000000,%rdx
bt     %rcx,%rdx
jae    1120 <CharSimpleOp+0x20>
ret
xor    %eax,%eax
cmp    $0x3b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @CharSimpleOp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 40
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 60
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 41
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 59
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @CharSimpleOp(i8 signext %0) {
switch i8 %0, label %2 [
i8 60, label %5
i8 41, label %5
i8 40, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 59
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
float min(float a, float b, float c) {
  float min;
  min = a <= b ? a : b;
  min = min <= c ? min : c;
  return min;
}


x86 assembly (clang, -O0):
<min>:
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
jb     1135 <min+0x35>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    113f <min+0x3f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     116b <min+0x6b>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1175 <min+0x75>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @min(float %0, float %1, float %2) {
%4 = fcmp ole float %0, %1
%5 = select i1 %4, float %0, float %1
%6 = fcmp ole float %5, %2
%7 = select i1 %6, float %5, float %2
ret float %7
}
void hal_system_start(void *img_start) {
  __attribute__((noreturn)) void (*fn)(void) = img_start;
  fn();
}


x86 assembly (clang, -O0):
<hal_system_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)

x86 assembly (clang, -O2):
<hal_system_start>:
push   %rax
call   *%rdi

LLVM IR (-O0):
define void @hal_system_start(i8* %0) {
%2 = alloca i8*
%3 = alloca void ()*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to void ()*
store void ()* %5, void ()** %3
%6 = load void ()*, void ()** %3
unreachable
}

LLVM IR (-O2):
define void @hal_system_start(i8* nocapture %0) {
%2 = bitcast i8* %0 to void ()*
tail call void %2()
unreachable
}