xunge/DecIR huggingface dataset:
/* Variables and functions */
double atanf(double);
double atan(double arg) { return atanf(arg); }


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

x86 assembly (clang, -O2):
<atan>:
jmp    1030 <atanf@plt>

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

LLVM IR (-O2):
define double @atan(double %0) {
%2 = tail call double @atanf(double %0)
ret double %2
}
int student_func(int arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i32 @student_func(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void call_me_if_error(void) { printf("meh\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"meh\00"
define void @call_me_if_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int O_NONBLOCK;
int fd_set_flags(int, int);
int fd_set_nonblocking(int fd, int flags) {
  return fd_set_flags(fd, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<fd_set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ebd(%rip),%rax
or     (%rax),%esi
call   1030 <fd_set_flags@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@O_NONBLOCK = global i32 0
define i32 @fd_set_nonblocking(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %6, %7
%9 = call i32 @fd_set_flags(i32 %5, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@O_NONBLOCK = global i32 0
define i32 @fd_set_nonblocking(i32 %0, i32 %1) {
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %3, %1
%5 = tail call i32 @fd_set_flags(i32 %0, i32 %4)
ret i32 %5
}
void fxrstor(volatile void *a) {
  __asm volatile("fxrstor (%0)" : : "r"(a) : "memory");
}


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

x86 assembly (clang, -O2):
<fxrstor>:
fxrstor (%rdi)
ret

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

LLVM IR (-O2):
define void @fxrstor(i8* %0) {
tail call void asm sideeffect "fxrstor ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void functiona1(int *x) {
  printf("x = %d\n", x);
  printf("&x = %d\n", &x);
}


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

x86 assembly (clang, -O2):
<functiona1>:
push   %rax
mov    %rdi,%rsi
mov    %rdi,(%rsp)
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
@.str.1 = [9 x i8] c"&x = %d\0A\00"
define void @functiona1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %0)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32** %2)
ret void
}
void gdk_device_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_device_get_type() {
ret void
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ testNSConnect();
void testNSNet(void) {
  testNSConnect();
  if (fork()) {
  } else {
  }
}


x86 assembly (clang, -O0):
<testNSNet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <testNSConnect@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
je     1141 <testNSNet+0x21>
jmp    1146 <testNSNet+0x26>
jmp    1146 <testNSNet+0x26>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testNSNet() {
%1 = tail call i32 (...) @testNSConnect()
%2 = tail call i64 (...) @fork()
ret void
}
/* Variables and functions */
int horner(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int x;
  scanf("%d", &x);
  int array[] = {2, 3, 4};
  printf("%d\n", horner(array, 3, x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    0xeab(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    $0x3,%esi
call   1050 <horner@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xec5(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xeb2(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0x4(%rsp),%edx
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1050 <horner@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@__const.main.array = [3 x i32] [i32 2, i32 3, i32 4]
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [3 x i32]
%5 = bitcast i32* %3 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = bitcast [3 x i32]* %4 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @horner(i32* %8, i32 3, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
struct kore_json {
  int dummy;
};

/* Variables and functions */
int json_next_byte(struct kore_json *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/);
int json_next(struct kore_json *json, u_int8_t *ch) {
  return (json_next_byte(json, ch, 0));
}


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

x86 assembly (clang, -O2):
<json_next>:
xor    %edx,%edx
jmp    1030 <json_next_byte@plt>

LLVM IR (-O0):
%struct.kore_json = type { i32 }
define i32 @json_next(%struct.kore_json* %0, i32* %1) {
%3 = alloca %struct.kore_json*
%4 = alloca i32*
store %struct.kore_json* %0, %struct.kore_json** %3
store i32* %1, i32** %4
%5 = load %struct.kore_json*, %struct.kore_json** %3
%6 = load i32*, i32** %4
%7 = call i32 @json_next_byte(%struct.kore_json* %5, i32* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.kore_json = type { i32 }
define i32 @json_next(%struct.kore_json* %0, i32* %1) {
%3 = tail call i32 @json_next_byte(%struct.kore_json* %0, i32* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int gcd(int, int);
int arr(int q) { return gcd(q, 35); }


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

x86 assembly (clang, -O2):
<arr>:
mov    $0x23,%esi
jmp    1030 <gcd@plt>

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

LLVM IR (-O2):
define i32 @arr(i32 %0) {
%2 = tail call i32 @gcd(i32 %0, i32 35)
ret i32 %2
}
/* Type definitions */
struct t_gui_line {
  int dummy;
};

/* Variables and functions */
char *gui_line_search_tag_starting_with(struct t_gui_line *, char *);
const char *gui_line_get_nick_tag(struct t_gui_line *line) {
  const char *tag;
  tag = gui_line_search_tag_starting_with(line, "nick_");
  if (!tag)
    return NULL;
  return tag + 5;
}


x86 assembly (clang, -O0):
<gui_line_get_nick_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <gui_line_search_tag_starting_with@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <gui_line_get_nick_tag+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1154 <gui_line_get_nick_tag+0x44>
mov    -0x18(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_line_get_nick_tag>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <gui_line_search_tag_starting_with@plt>
lea    0x5(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.t_gui_line = type { i32 }
@.str = [6 x i8] c"nick_\00"
define i8* @gui_line_get_nick_tag(%struct.t_gui_line* %0) {
%2 = tail call i8* @gui_line_search_tag_starting_with(%struct.t_gui_line* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 5
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
double f() {}


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

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

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

LLVM IR (-O2):
define double @f() {
ret double undef
}
float quadratic_ease_in(float p) { return p * p; }


x86 assembly (clang, -O0):
<quadratic_ease_in>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic_ease_in>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @quadratic_ease_in(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
void *_mmatic_alloc(void *, size_t, char const *, unsigned int);
void *memset(void *, int /*<<< orphan*/, size_t);
void *_mmatic_zalloc(void *mgr, size_t size, const char *cfile,
                     unsigned int cline) {
  void *ptr;
  ptr = _mmatic_alloc(mgr, size, cfile, cline);
  return ptr ? memset(ptr, 0, size) : ptr;
}


x86 assembly (clang, -O0):
<_mmatic_zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <_mmatic_alloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     117a <_mmatic_zalloc+0x5a>
mov    -0x28(%rbp),%rdi
mov    %rdi,-0x38(%rbp)
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1182 <_mmatic_zalloc+0x62>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mmatic_zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <_mmatic_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <_mmatic_zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_mmatic_zalloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @_mmatic_alloc(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %4
tail call void @llvm.memset.p0i8.i64(i8* align 1 %5, i8 0, i64 %1, i1 false)
br label %8
8: ; preds = %4, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, size_t const);
bool cutils_cdar_DynamicArray_size_t_format(const size_t *i, char **b,
                                            size_t *s) {
  snprintf(*b, *s, "%zu", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_size_t_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xec0(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_size_t_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
mov    (%rdi),%rcx
lea    0xedf(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%zu\00"
define i32 @cutils_cdar_DynamicArray_size_t_format(i64* %0, i8** %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i8**
%6 = alloca i64*
store i64* %0, i64** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load i64*, i64** %4
%12 = load i64, i64* %11
%13 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%zu\00"
define i32 @cutils_cdar_DynamicArray_size_t_format(i64* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load i64, i64* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i32 1
}
const int av_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c ^= 0x20;
  return c;
}


x86 assembly (clang, -O0):
<av_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <av_tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <av_tolower+0x24>
mov    -0x4(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_tolower>:
lea    -0x41(%rdi),%ecx
mov    %edi,%eax
xor    $0x20,%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @av_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = xor i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @av_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int get_balance(float *customer_balance) {
  int err = 0;
  printf("Account Balance: ");
  scanf("%f", customer_balance);
  return err;
}


x86 assembly (clang, -O0):
<get_balance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_balance>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Account Balance: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @get_balance(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load float*, float** %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [18 x i8] c"Account Balance: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @get_balance(float* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %0)
ret i32 0
}
void setval_181(unsigned *p) { *p = 3269495112U; }


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

x86 assembly (clang, -O2):
<setval_181>:
movl   $0xc2e08948,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_181(i32* nocapture writeonly %0) {
store i32 -1025472184, i32* %0
ret void
}
void Quadrature2_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @Quadrature2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int isWhitespace(char c) { return ((c == ' ') || (c == '\t') || (c == '\r')); }


x86 assembly (clang, -O0):
<isWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <isWhitespace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <isWhitespace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWhitespace>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1111 <isWhitespace+0x11>
cmp    $0x20,%dil
jne    1112 <isWhitespace+0x12>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isWhitespace(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, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @isWhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
void INT_Excep_PERIB_INTB206(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB206() {
ret void
}
int isbackspace(char buf[8]) { return buf[0] == 127; }


x86 assembly (clang, -O0):
<isbackspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbackspace>:
xor    %eax,%eax
cmpb   $0x7f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isbackspace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 127
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isbackspace(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 127
%4 = zext i1 %3 to i32
ret i32 %4
}
int foo(int *a) { *a = *a + 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fchown(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fileno(int /*<<< orphan*/ *);
int fs_fchown(FILE *file, int uid, int gid) {
  int fd = fileno(file);
  return fchown(fd, (uid_t)uid, (gid_t)gid);
}


x86 assembly (clang, -O0):
<fs_fchown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <fchown@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fs_fchown(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = call i32 @fileno(i32* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @fchown(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @fs_fchown(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @fileno(i32* %0)
%5 = tail call i32 @fchown(i32 %4, i32 %1, i32 %2)
ret i32 %5
}
char *UtilConcat(char *where, char *what) {
  while (*what)
    *(where++) = *(what++);
  *where = 0;
  return (where);
}


x86 assembly (clang, -O0):
<UtilConcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <UtilConcat+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <UtilConcat+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UtilConcat>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <UtilConcat+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <UtilConcat+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @UtilConcat(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ countSort(int *, int, int);
int getMax(int *, int);
void radixSort(int arr[], int n) {
  int m = getMax(arr, n);
  for (int exp = 1; m / exp > 0; exp *= 10)
    countSort(arr, n, exp);
}


x86 assembly (clang, -O0):
<radixSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <getMax@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%eax
jle    1170 <radixSort+0x50>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <countSort@plt>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <radixSort+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <getMax@plt>
test   %eax,%eax
jle    115b <radixSort+0x3b>
mov    %eax,%ebp
mov    $0x1,%ebx
nopl   (%rax)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <countSort@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
mov    %ebp,%eax
cltd
idiv   %ebx
test   %eax,%eax
jg     1140 <radixSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @radixSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @getMax(i32* %7, i32 %8)
store i32 %9, i32* %5
store i32 1, i32* %6
br label %10
10: ; preds = %20, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sdiv i32 %11, %12
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %10
%16 = load i32*, i32** %3
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = call i32 @countSort(i32* %16, i32 %17, i32 %18)
br label %20
20: ; preds = %15
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, 10
store i32 %22, i32* %6
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @radixSort(i32* %0, i32 %1) {
%3 = tail call i32 @getMax(i32* %0, i32 %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 1, %2 ]
%8 = tail call i32 @countSort(i32* %0, i32 %1, i32 %7)
%9 = mul nsw i32 %7, 10
%10 = sdiv i32 %3, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %5
}
int fn8(_Bool b) {
  if (!b)
    return 16;
  else if (!b)
    return 27;
  else
    return 64;
}


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
testb  $0x1,-0x5(%rbp)
jne    1122 <fn8+0x22>
movl   $0x10,-0x4(%rbp)
jmp    113f <fn8+0x3f>
testb  $0x1,-0x5(%rbp)
jne    1138 <fn8+0x38>
movl   $0x1b,-0x4(%rbp)
jmp    113f <fn8+0x3f>
movl   $0x40,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
test   %edi,%edi
mov    $0x40,%ecx
mov    $0x10,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fn8(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = zext i1 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = trunc i8 %5 to i1
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 16, i32* %2
br label %13
8: ; preds = %1
%9 = load i8, i8* %3
%10 = trunc i8 %9 to i1
br i1 %10, label %12, label %11
11: ; preds = %8
store i32 27, i32* %2
br label %13
12: ; preds = %8
store i32 64, i32* %2
br label %13
13: ; preds = %12, %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @fn8(i1 zeroext %0) {
%2 = select i1 %0, i32 64, i32 16
ret i32 %2
}
unsigned int toDigit(char ch) { return ch - '0'; }


x86 assembly (clang, -O0):
<toDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toDigit>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @toDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @toDigit(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ mtest_aug_allocations(int);
void *mtest_malloc(size_t allocation_size) {
  mtest_aug_allocations(1);
  return malloc(allocation_size);
}


x86 assembly (clang, -O0):
<mtest_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <mtest_aug_allocations@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtest_malloc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <mtest_aug_allocations@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @mtest_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @mtest_aug_allocations(i32 1)
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @mtest_malloc(i64 %0) {
%2 = tail call i32 @mtest_aug_allocations(i32 1)
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xc1() {
  Assert_real((isascii(193) == 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_isascii.c",
              970, ("isascii should be 0 for 0xc1"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xc1\00"
define void @t_isascii_0xc1() {
%1 = tail call i64 @isascii(i32 193)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 970, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, unsigned int);
void ch_epoch_load(int ch, unsigned int data) { to_gps((ch << 3) + 7, data); }


x86 assembly (clang, -O0):
<ch_epoch_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
add    $0x7,%edi
mov    -0x8(%rbp),%esi
call   1030 <to_gps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch_epoch_load>:
lea    0x7(,%rdi,8),%edi
jmp    1030 <to_gps@plt>

LLVM IR (-O0):
define void @ch_epoch_load(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 = shl i32 %5, 3
%7 = add nsw i32 %6, 7
%8 = load i32, i32* %4
%9 = call i32 @to_gps(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @ch_epoch_load(i32 %0, i32 %1) {
%3 = shl i32 %0, 3
%4 = or i32 %3, 7
%5 = tail call i32 @to_gps(i32 %4, i32 %1)
ret void
}
void copy(char *dst, char *src, int len) {
  for (int i = 0; (i < len) && src[i]; i++)
    dst[i] = src[i];
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    113c <copy+0x3c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <copy+0x4c>
jmp    1170 <copy+0x70>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <copy+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
test   %edx,%edx
jle    1124 <copy+0x24>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rcx,1),%edx
test   %dl,%dl
je     1124 <copy+0x24>
mov    %dl,(%rdi,%rcx,1)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <copy+0x10>
ret

LLVM IR (-O0):
define void @copy(i8* %0, i8* %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 = %32, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %12, %8
%21 = phi i1 [ false, %8 ], [ %19, %12 ]
br i1 %21, label %22, label %35
22: ; preds = %20
%23 = load i8*, i8** %5
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = load i8*, i8** %4
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 %27, i8* %31
br label %32
32: ; preds = %22
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %8
35: ; preds = %20
ret void
}

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ 0, %5 ], [ %15, %13 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7, %13, %3
ret void
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %10, i8* %14
%15 = add nuw nsw i64 %8, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %12, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetCommand() {
  printf("XSetCommand called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"XSetCommand called\00"
define i32 @XSetCommand() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char palabra[] = {'H', 'o', 'l', 'a', '!'};
  int i;
  for (i = 0; i < 5; i++) {
    printf("%c", palabra[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1167 <main+0x57>
movslq -0x10(%rbp),%rax
movsbl -0x9(%rbp,%rax,1),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <main+0x28>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 72)
%2 = tail call i32 @putchar(i32 111)
%3 = tail call i32 @putchar(i32 108)
%4 = tail call i32 @putchar(i32 97)
%5 = tail call i32 @putchar(i32 33)
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quick_sort(int *, int /*<<< orphan*/, size_t);
void sort(int values[], size_t size) { quick_sort(values, 0, size - 1); }


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

x86 assembly (clang, -O2):
<sort>:
lea    -0x1(%rsi),%rdx
xor    %esi,%esi
jmp    1030 <quick_sort@plt>

LLVM IR (-O0):
define void @sort(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = call i32 @quick_sort(i32* %5, i32 0, i64 %7)
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i64 %1) {
%3 = add i64 %1, -1
%4 = tail call i32 @quick_sort(i32* %0, i32 0, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int lvm_find_part(long int labelone_loc) {
  int x;
  x = (labelone_loc / 512) - 1;
  printf(
      "\t-- Per LABELONE, partition or start of disk expected at sector %d\n\n",
      x);
  return 0;
}


x86 assembly (clang, -O0):
<lvm_find_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x200,%ecx
cqto
idiv   %rcx
sub    $0x1,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvm_find_part>:
push   %rax
lea    0x1ff(%rdi),%rsi
test   %rdi,%rdi
cmovns %rdi,%rsi
shr    $0x9,%rsi
add    $0xffffffff,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"\09-- Per LABELONE, partition or start of disk expected at sector %d\0A\0A\00"
define i32 @lvm_find_part(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 512
%6 = sub nsw i64 %5, 1
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"\09-- Per LABELONE, partition or start of disk expected at sector %d\0A\0A\00"
define i32 @lvm_find_part(i64 %0) {
%2 = sdiv i64 %0, 512
%3 = trunc i64 %2 to i32
%4 = add i32 %3, -1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ screen_clear();
void console_clear() { screen_clear(); }


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

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

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

LLVM IR (-O2):
define void @console_clear() {
%1 = tail call i32 (...) @screen_clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ReadADchip(int);
void ReadAllAD(void) {
  int chip_no;
  for (chip_no = 0; chip_no <= 3; chip_no++)
    ReadADchip(chip_no);
}


x86 assembly (clang, -O0):
<ReadAllAD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jg     113f <ReadAllAD+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <ReadADchip@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ReadAllAD+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadAllAD>:
push   %rax
xor    %edi,%edi
call   1030 <ReadADchip@plt>
mov    $0x1,%edi
call   1030 <ReadADchip@plt>
mov    $0x2,%edi
call   1030 <ReadADchip@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <ReadADchip@plt>

LLVM IR (-O0):
define void @ReadAllAD() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 3
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @ReadADchip(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):
define void @ReadAllAD() {
%1 = tail call i32 @ReadADchip(i32 0)
%2 = tail call i32 @ReadADchip(i32 1)
%3 = tail call i32 @ReadADchip(i32 2)
%4 = tail call i32 @ReadADchip(i32 3)
ret void
}
/* Variables and functions */
long bar();
int foo() {
  long res;
  res = bar();
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @bar()
store i64 %3, i64* %2
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i64 (...) @bar()
ret i32 undef
}