xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cpuidVendor();
int /*<<< orphan*/ uioPrint(int /*<<< orphan*/);
int /*<<< orphan*/ uioPrintChar(char);
void cpuidShowVendor(void) {
  uioPrint(cpuidVendor());
  uioPrintChar('\n');
}


x86 assembly (clang, -O0):
<cpuidShowVendor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cpuidVendor@plt>
mov    %eax,%edi
call   1040 <uioPrint@plt>
mov    $0xa,%edi
call   1050 <uioPrintChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuidShowVendor>:
push   %rax
xor    %eax,%eax
call   1030 <cpuidVendor@plt>
mov    %eax,%edi
call   1040 <uioPrint@plt>
mov    $0xa,%edi
pop    %rax
jmp    1050 <uioPrintChar@plt>

LLVM IR (-O0):
define void @cpuidShowVendor() {
%1 = call i32 (...) @cpuidVendor()
%2 = call i32 @uioPrint(i32 %1)
%3 = call i32 @uioPrintChar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @cpuidShowVendor() {
%1 = tail call i32 (...) @cpuidVendor()
%2 = tail call i32 @uioPrint(i32 %1)
%3 = tail call i32 @uioPrintChar(i8 signext 10)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int be_child();
int be_parent(scalar_t__);
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  pid_t child = fork();
  if (child < 0) {
    printf("oh no, can't fork()\n");
    return 1;
  }
  if (child == 0) {
    return be_child();
  } else {
    return be_parent(child);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    117d <main+0x3d>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a3 <main+0x63>
cmpq   $0x0,-0x10(%rbp)
jne    1197 <main+0x57>
mov    $0x0,%al
call   1050 <be_child@plt>
mov    %eax,-0x4(%rbp)
jmp    11a3 <main+0x63>
mov    -0x10(%rbp),%rdi
call   1030 <be_parent@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
js     1158 <main+0x18>
je     116b <main+0x2b>
mov    %rax,%rdi
pop    %rax
jmp    1030 <be_parent@plt>
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1050 <be_child@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"oh no, can't fork()\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %16
8: ; preds = %0
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @be_child()
store i32 %12, i32* %1
br label %16
13: ; preds = %8
%14 = load i64, i64* %2
%15 = call i32 @be_parent(i64 %14)
store i32 %15, i32* %1
br label %16
16: ; preds = %13, %11, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@str = [20 x i8] c"oh no, can't fork()\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %11
5: ; preds = %0
%6 = icmp eq i64 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (...) @be_child()
br label %11
9: ; preds = %5
%10 = tail call i32 @be_parent(i64 %1)
br label %11
11: ; preds = %9, %7, %3
%12 = phi i32 [ 1, %3 ], [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
void plat_midi_close(void) {}


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

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

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

LLVM IR (-O2):
define void @plat_midi_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int toBeTested();
void main() {
  if (toBeTested() == 2) {
    putchar('A');
  } else {
    putchar('B');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <toBeTested@plt>
cmp    $0x2,%eax
jne    1143 <main+0x23>
mov    $0x41,%edi
call   1030 <putchar@plt>
jmp    114d <main+0x2d>
mov    $0x42,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <toBeTested@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    $0x42,%edi
sub    %ecx,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @toBeTested()
%2 = icmp eq i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @putchar(i8 signext 65)
br label %7
5: ; preds = %0
%6 = call i32 @putchar(i8 signext 66)
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @toBeTested()
%2 = icmp eq i32 %1, 2
%3 = select i1 %2, i8 65, i8 66
%4 = tail call i32 @putchar(i8 signext %3)
ret void
}
void Hal_hook_rd_sgnarray(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgnarray() {
ret void
}
void show_file(char *str) {}


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

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

LLVM IR (-O0):
define void @show_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @show_file(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int CMOS_read(int, int);
int floppy_gettype(bool slave) {
  int reg = CMOS_read(0x10, false);
  if (!slave) {
    return reg >> 4;
  } else {
    return reg & 0xF;
  }
}


x86 assembly (clang, -O0):
<floppy_gettype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x10,%edi
xor    %esi,%esi
call   1030 <CMOS_read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1142 <floppy_gettype+0x32>
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <floppy_gettype+0x3b>
mov    -0xc(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floppy_gettype>:
push   %rbx
mov    %edi,%ebx
mov    $0x10,%edi
xor    %esi,%esi
call   1030 <CMOS_read@plt>
mov    %eax,%ecx
and    $0xf,%ecx
sar    $0x4,%eax
test   %ebx,%ebx
cmovne %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @floppy_gettype(i32 %0) {
%2 = tail call i32 @CMOS_read(i32 16, i32 0)
%3 = icmp eq i32 %0, 0
%4 = and i32 %2, 15
%5 = ashr i32 %2, 4
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, int);
void define_int(FILE *f, const char *str, int value) {
  fprintf(f, "#define %s %d\n", str, value);
}


x86 assembly (clang, -O0):
<define_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<define_int>:
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"#define %s %d\0A\00"
define void @define_int(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"#define %s %d\0A\00"
define void @define_int(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clockBegin();
int /*<<< orphan*/ clockEnd();
int /*<<< orphan*/ dataToInput();
int /*<<< orphan*/ delay();
void readBits(void) {
  clockBegin();
  dataToInput();
  delay();
  clockEnd();
}


x86 assembly (clang, -O0):
<readBits>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clockBegin@plt>
mov    $0x0,%al
call   1060 <dataToInput@plt>
mov    $0x0,%al
call   1040 <delay@plt>
mov    $0x0,%al
call   1050 <clockEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBits>:
push   %rax
xor    %eax,%eax
call   1030 <clockBegin@plt>
xor    %eax,%eax
call   1060 <dataToInput@plt>
xor    %eax,%eax
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <clockEnd@plt>

LLVM IR (-O0):
define void @readBits() {
%1 = call i32 (...) @clockBegin()
%2 = call i32 (...) @dataToInput()
%3 = call i32 (...) @delay()
%4 = call i32 (...) @clockEnd()
ret void
}

LLVM IR (-O2):
define void @readBits() {
%1 = tail call i32 (...) @clockBegin()
%2 = tail call i32 (...) @dataToInput()
%3 = tail call i32 (...) @delay()
%4 = tail call i32 (...) @clockEnd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill(int, int, int);
int /*<<< orphan*/ textSize(int);
void setup() {
  textSize(24);
  fill(255, 255, 255);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18,%edi
call   1040 <textSize@plt>
mov    $0xff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <fill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
mov    $0x18,%edi
call   1040 <textSize@plt>
mov    $0xff,%edi
mov    $0xff,%esi
mov    $0xff,%edx
pop    %rax
jmp    1030 <fill@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 @textSize(i32 24)
%2 = call i32 @fill(i32 255, i32 255, i32 255)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 @textSize(i32 24)
%2 = tail call i32 @fill(i32 255, i32 255, i32 255)
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int answer, userInt;
  printf("Enter an integer to factorize >");
  scanf("%d", &userInt);
  answer = factorial(userInt);
  printf("%d! = %d\n", userInt, answer);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
mov    0x4(%rsp),%esi
lea    0xebf(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter an integer to factorize >\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"%d! = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @factorial(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter an integer to factorize >\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"%d! = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) 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* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void empty_cycle(void) { usleep(1); }


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

x86 assembly (clang, -O2):
<empty_cycle>:
mov    $0x1,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @empty_cycle() {
%1 = call i32 @usleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @empty_cycle() {
%1 = tail call i32 @usleep(i32 1)
ret void
}
int range_gauss(float r, float w, int m) { return m; }


x86 assembly (clang, -O0):
<range_gauss>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @range_gauss(float %0, float %1, i32 %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %4
store float %1, float* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @range_gauss(float %0, float %1, i32 returned %2) {
ret i32 %2
}
int main(int argc, char *argv[]) {
  char *base, *result;
  base = (char *)0;
  result = base + 0;
  base = (char *)0;
  result = base + 1;
  base = (char *)1;
  result = base - 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%8 = load i8*, i8** %6
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8* %9, i8** %7
store i8* null, i8** %6
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %7
store i8* inttoptr (i64 1 to i8*), i8** %6
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 -1
store i8* %13, i8** %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int test_imm_68int64_highword_reg(long long val) {
  return ((val >> 32) & (0x68 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_68int64_highword_reg>:
movabs $0x6800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_68int64_highword_reg(i64 %0) {
%2 = and i64 %0, 446676598784
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_4Duint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Duint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x4d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Duint64_midword_reg>:
test   $0x4d0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Duint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5046272
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ crError(char *, unsigned int);
int /*<<< orphan*/ crMemset(void *, int /*<<< orphan*/, unsigned int);
void *malloc(unsigned int);
void *crCalloc(unsigned int nbytes) {
  void *ret = malloc(nbytes);
  if (!ret) {
    crError("Out of memory trying to (c)allocate %d bytes!", nbytes);
    abort();
  }
  crMemset(ret, 0, nbytes);
  return ret;
}


x86 assembly (clang, -O0):
<crCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1178 <crCalloc+0x38>
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1050 <crError@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1040 <crMemset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crCalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1060 <malloc@plt>
test   %rax,%rax
je     1168 <crCalloc+0x28>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <crMemset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe91(%rip),%rdi
mov    %ebp,%esi
call   1050 <crError@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Out of memory trying to (c)allocate %d bytes!\00"
define i8* @crCalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @crError(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = call i32 @crMemset(i8* %13, i32 0, i32 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [46 x i8] c"Out of memory trying to (c)allocate %d bytes!\00"
define i8* @crCalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @crError(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = tail call i32 @crMemset(i8* %2, i32 0, i32 %0)
ret i8* %2
}
void ularith_add_2ul_2ul(unsigned long *r1, unsigned long *r2,
                         const unsigned long a1, const unsigned long a2) {
  *r1 += a1;
  *r2 += a2 + (*r1 < a1);
}


x86 assembly (clang, -O0):
<ularith_add_2ul_2ul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    %rax,%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ularith_add_2ul_2ul>:
add    %rdx,(%rdi)
adc    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @ularith_add_2ul_2ul(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = load i64*, i64** %5
%11 = load i64, i64* %10
%12 = add i64 %11, %9
store i64 %12, i64* %10
%13 = load i64, i64* %8
%14 = load i64*, i64** %5
%15 = load i64, i64* %14
%16 = load i64, i64* %7
%17 = icmp ult i64 %15, %16
%18 = zext i1 %17 to i32
%19 = sext i32 %18 to i64
%20 = add i64 %13, %19
%21 = load i64*, i64** %6
%22 = load i64, i64* %21
%23 = add i64 %22, %20
store i64 %23, i64* %21
ret void
}

LLVM IR (-O2):
define void @ularith_add_2ul_2ul(i64* nocapture %0, i64* nocapture %1, i64 %2, i64 %3) {
%5 = load i64, i64* %0
%6 = add i64 %5, %2
store i64 %6, i64* %0
%7 = icmp ult i64 %6, %2
%8 = zext i1 %7 to i64
%9 = load i64, i64* %1
%10 = add i64 %9, %3
%11 = add i64 %10, %8
store i64 %11, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char const *strerror(int /*<<< orphan*/);
const char *get_errmsg() { return strerror(errno); }


x86 assembly (clang, -O0):
<get_errmsg>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_errmsg>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@errno = global i32 0
define i8* @get_errmsg() {
%1 = load i32, i32* @errno
%2 = call i8* @strerror(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @get_errmsg() {
%1 = load i32, i32* @errno
%2 = tail call i8* @strerror(i32 %1)
ret i8* %2
}
int f() {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
int fibonacci(int n) {
  if (n <= 1)
    return n;
  else
    return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fibonacci+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibonacci+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fibonacci+0x10>
mov    %ebx,%ecx
jmp    1144 <fibonacci+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fibonacci+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ recv(int, void *, size_t, int);
ssize_t Recv(int sockfd, void *buf, size_t len, int flags) {
  ssize_t rc;
  if ((rc = recv(sockfd, buf, len, flags)) < 0) {
    perror("recv");
    exit(1);
  }
  return (rc);
}


x86 assembly (clang, -O0):
<Recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <recv@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    117b <Recv+0x4b>
lea    0xe94(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Recv>:
push   %rax
call   1030 <recv@plt>
test   %eax,%eax
js     113c <Recv+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"recv\00"
define i32 @Recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret i32 %5
}
void abx500_pinctrl_ab8540_init(struct abx500_pinctrl_soc_data **soc) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.abx500_pinctrl_soc_data = type opaque
define void @abx500_pinctrl_ab8540_init(%struct.abx500_pinctrl_soc_data** %0) {
%2 = alloca %struct.abx500_pinctrl_soc_data**
store %struct.abx500_pinctrl_soc_data** %0, %struct.abx500_pinctrl_soc_data*** %2
ret void
}

LLVM IR (-O2):
%struct.abx500_pinctrl_soc_data = type opaque
define void @abx500_pinctrl_ab8540_init(%struct.abx500_pinctrl_soc_data** nocapture %0) {
ret void
}
/* Variables and functions */
long __ocml_rint_f32(float);
long int lrintf(float x) { return __ocml_rint_f32(x); }


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

x86 assembly (clang, -O2):
<lrintf>:
jmp    1030 <__ocml_rint_f32@plt>

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

LLVM IR (-O2):
define i64 @lrintf(float %0) {
%2 = tail call i64 @__ocml_rint_f32(float %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void printValue(char *value) {
  printf("\n%s\n\n", value);
  time_t t = time(NULL);
  struct tm *tm = localtime(&t);
  printf("%s\n", asctime(tm));
}


x86 assembly (clang, -O0):
<printValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printValue>:
push   %rax
mov    %rdi,%rsi
lea    0xeb5(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
lea    0xe92(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [6 x i8] c"\0A%s\0A\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @printValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @time(i32* null)
store i32 %7, i32* %3
%8 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %8, %struct.tm** %4
%9 = load %struct.tm*, %struct.tm** %4
%10 = call i8* @asctime(%struct.tm* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [6 x i8] c"\0A%s\0A\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @printValue(i8* %0) {
%2 = alloca i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call %struct.tm* @localtime(i32* %2)
%7 = call i8* @asctime(%struct.tm* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x7b() {
  Assert_real((isgraph(123)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              620, ("isgraph should be 1 for {"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for {\00"
define void @t_isgraph_0x7b() {
%1 = tail call i32 @isgraph(i32 123)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int dapversion(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @dapversion() {
ret i32 5
}

LLVM IR (-O2):
define i32 @dapversion() {
ret i32 5
}
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  i = 0;
  while (s[i]) {
    (*f)(&(s[i]));
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1148 <ft_striter+0x48>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
add    %rcx,%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ft_striter+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1120 <ft_striter+0x20>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1110 <ft_striter+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
tail call void %1(i8* %7)
%8 = add nuw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M907_f(char *s) {
  debug("M907_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M907_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M907_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M907_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M907_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M907_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M907_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void function_empty_type() { write("csv-task.csv", ",", NULL); }


x86 assembly (clang, -O0):
<function_empty_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_empty_type>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_type() {
%1 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_type() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *n;
  n = (int *)calloc(10, sizeof(int));
  printf("%d\n", n[0]);
  free(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @calloc(i32 10, i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %2
%10 = call i32 @free(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @calloc(i32 10, i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i32* %2)
ret i32 0
}
void set_asm(int *string, unsigned n) {
  asm("bts %[n], (%[string])"
      :
      : [string] "r"(string), [n] "r"(n)
      : "cc", "memory");
}


x86 assembly (clang, -O0):
<set_asm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
bts    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_asm>:
bts    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_asm(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
ret void
}

LLVM IR (-O2):
define void @set_asm(i32* %0, i32 %1) {
tail call void asm sideeffect "bts $1, ($0)", "r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* %0, i32 %1)
ret void
}
unsigned int combine_balanced_int(unsigned int a, unsigned int b) {
  return (a & 0xffff0000ll) | (b & 0x0000ffffll);
}


x86 assembly (clang, -O0):
<combine_balanced_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movabs $0xffff0000,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%ecx
and    $0xffff,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<combine_balanced_int>:
and    $0xffff0000,%edi
movzwl %si,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @combine_balanced_int(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 = zext i32 %5 to i64
%7 = and i64 %6, 4294901760
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = and i64 %9, 65535
%11 = or i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @combine_balanced_int(i32 %0, i32 %1) {
%3 = and i32 %0, -65536
%4 = and i32 %1, 65535
%5 = or i32 %4, %3
ret i32 %5
}
void change_arr_str(char arr[], char replaceStr, int len) {
  int temp;
  for (temp = 0; temp < len; temp++) {
    arr[temp] = replaceStr;
  }
}


x86 assembly (clang, -O0):
<change_arr_str>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1140 <change_arr_str+0x40>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <change_arr_str+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_arr_str>:
test   %edx,%edx
jle    1124 <change_arr_str+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @change_arr_str(i8* nocapture writeonly %0, i8 signext %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 %7
7: ; preds = %5, %3
ret void
}
void rct_reset_dma(void) {}


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

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

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

LLVM IR (-O2):
define void @rct_reset_dma() {
ret void
}
int test16(int a, int b, int c, int d, int e, int f) {
  int x = a != b;
  int y = c == 0;
  int z = d == e;
  return x == y && x == z;
}


x86 assembly (clang, -O0):
<test16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
jne    1166 <test16+0x66>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test16>:
cmp    %esi,%edi
setne  %al
test   %edx,%edx
setne  %dl
cmp    %r8d,%ecx
setne  %cl
xor    %al,%dl
xor    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test16(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = icmp ne i32 %16, %17
%19 = zext i1 %18 to i32
store i32 %19, i32* %13
%20 = load i32, i32* %9
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
store i32 %22, i32* %14
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
store i32 %26, i32* %15
%27 = load i32, i32* %13
%28 = load i32, i32* %14
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %6
%31 = load i32, i32* %13
%32 = load i32, i32* %15
%33 = icmp eq i32 %31, %32
br label %34
34: ; preds = %30, %6
%35 = phi i1 [ false, %6 ], [ %33, %30 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @test16(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ne i32 %0, %1
%8 = icmp ne i32 %2, 0
%9 = icmp ne i32 %3, %4
%10 = xor i1 %7, %8
%11 = xor i1 %7, %9
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
void clear_line(char *line, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    *(line + i) = '\0';
  }
}


x86 assembly (clang, -O0):
<clear_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <clear_line+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <clear_line+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_line>:
test   %esi,%esi
jle    1122 <clear_line+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_line(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void AUXWUCFreezeEnable(void) {
  (*((volatile unsigned long *)(0x400C6000 + 0x00000054))) = 0x0;
}


x86 assembly (clang, -O0):
<AUXWUCFreezeEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400c6054,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUXWUCFreezeEnable>:
movq   $0x0,0x400c6054
ret

LLVM IR (-O0):
define void @AUXWUCFreezeEnable() {
store volatile i64 0, i64* inttoptr (i64 1074552916 to i64*)
ret void
}

LLVM IR (-O2):
define void @AUXWUCFreezeEnable() {
store volatile i64 0, i64* inttoptr (i64 1074552916 to i64*)
ret void
}