xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x11() {
  Assert_real((isprint(17) == 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_isprint.c",
              90, ("isprint should be 0 for 0x11"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x11>:
push   %rax
mov    $0x11,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5a,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x11\00"
define void @t_isprint_0x11() {
%1 = call i64 @isprint(i32 17)
%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 90, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x11\00"
define void @t_isprint_0x11() {
%1 = tail call i64 @isprint(i32 17)
%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 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_window_get_icon_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_icon_name() {
ret void
}
void bar$$1(struct _Data$$3 *this$1) { printf("bar\n"); }


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

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

LLVM IR (-O0):
%"struct._Data$$3" = type opaque
@.str = [5 x i8] c"bar\0A\00"
define void @"bar$$1"(%"struct._Data$$3"* %0) {
%2 = alloca %"struct._Data$$3"*
store %"struct._Data$$3"* %0, %"struct._Data$$3"** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%"struct._Data$$3" = type opaque
@str = [4 x i8] c"bar\00"
define void @"bar$$1"(%"struct._Data$$3"* nocapture readnone %0) {
%2 = 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 /*<<< orphan*/ Msp430TimerCapComP__3__Control__clearPendingInterrupt();
void Msp430AlarmC__0__Msp430TimerControl__clearPendingInterrupt(void) {
  Msp430TimerCapComP__3__Control__clearPendingInterrupt();
}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__0__Msp430TimerControl__clearPendingInterrupt() {
%1 = tail call i32 (...) @Msp430TimerCapComP__3__Control__clearPendingInterrupt()
ret void
}
void clear_memory(volatile char *mem_ptr, int length, char clear_value) {
  volatile char *index;
  for (index = mem_ptr; index < (mem_ptr + length); index++) {
    *index = clear_value;
  }
  return;
}


x86 assembly (clang, -O0):
<clear_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    114a <clear_memory+0x4a>
mov    -0xd(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <clear_memory+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_memory>:
test   %esi,%esi
jle    111b <clear_memory+0x1b>
movslq %esi,%rax
add    %rdi,%rax
nopw   0x0(%rax,%rax,1)
mov    %dl,(%rdi)
add    $0x1,%rdi
cmp    %rax,%rdi
jb     1110 <clear_memory+0x10>
ret

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

LLVM IR (-O2):
define void @clear_memory(i8* %0, i32 %1, i8 signext %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %11
7: ; preds = %3, %7
%8 = phi i8* [ %9, %7 ], [ %0, %3 ]
store volatile i8 %2, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp ult i8* %9, %5
br i1 %10, label %7, label %11
11: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void error_die(const char *sc) {
  perror(sc);
  exit(1);
}


x86 assembly (clang, -O0):
<error_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_die>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error_die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int util_file_exists(const char *path) {
  struct stat s;
  return stat(path, &s) == 0;
}


x86 assembly (clang, -O0):
<util_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @util_file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @util_file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int max3(int, int, int);
int get_nbuf(int n, int nv, int nt, int ne) {
  int nm;
  nm = n / nv;
  return max3(3 * n, 4 * nm * nt, 3 * nm * ne);
}


x86 assembly (clang, -O0):
<get_nbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x14(%rbp)
imul   $0x3,-0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
shl    $0x2,%esi
imul   -0xc(%rbp),%esi
imul   $0x3,-0x14(%rbp),%edx
imul   -0x10(%rbp),%edx
call   1030 <max3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nbuf>:
mov    %edx,%r8d
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rdi,%rdi,2),%edi
imul   %eax,%r8d
shl    $0x2,%r8d
imul   %eax,%ecx
lea    (%rcx,%rcx,2),%edx
mov    %r8d,%esi
jmp    1030 <max3@plt>

LLVM IR (-O0):
define i32 @get_nbuf(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = sdiv i32 %10, %11
store i32 %12, i32* %9
%13 = load i32, i32* %5
%14 = mul nsw i32 3, %13
%15 = load i32, i32* %9
%16 = mul nsw i32 4, %15
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %9
%20 = mul nsw i32 3, %19
%21 = load i32, i32* %8
%22 = mul nsw i32 %20, %21
%23 = call i32 @max3(i32 %14, i32 %18, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_nbuf(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sdiv i32 %0, %1
%6 = mul nsw i32 %0, 3
%7 = shl i32 %2, 2
%8 = mul i32 %7, %5
%9 = mul i32 %3, 3
%10 = mul i32 %9, %5
%11 = tail call i32 @max3(i32 %6, i32 %8, i32 %10)
ret i32 %11
}
/* Variables and functions */
char *fizmo_realloc(char *, int);
int ensure_mem_size(char **ptr, int *current_size, int size) {
  if (size > *current_size) {
    if ((*ptr = fizmo_realloc(*ptr, size)) == NULL)
      return -1;
    *current_size = size;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ensure_mem_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    1167 <ensure_mem_size+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <fizmo_realloc@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    115e <ensure_mem_size+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <ensure_mem_size+0x5e>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_mem_size>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
cmp    %edx,(%rsi)
jge    1142 <ensure_mem_size+0x32>
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r15
mov    (%rdi),%rdi
mov    %edx,%esi
call   1030 <fizmo_realloc@plt>
mov    %rax,(%r15)
test   %rax,%rax
je     113c <ensure_mem_size+0x2c>
mov    %ebp,(%rbx)
jmp    1142 <ensure_mem_size+0x32>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ensure_mem_size(i8** nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = tail call i8* @fizmo_realloc(i8* %7, i32 %2)
store i8* %8, i8** %0
%9 = icmp eq i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %6
store i32 %2, i32* %1
br label %11
11: ; preds = %3, %10, %6
%12 = phi i32 [ -1, %6 ], [ 0, %10 ], [ 0, %3 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *__val;
};
typedef TYPE_1__ sigset_t;

/* Variables and functions */
int __syscall_sigsuspend(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int __libc_sigsuspend(const sigset_t *set) {
  return __syscall_sigsuspend(0, 0, set->__val[0]);
}


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

x86 assembly (clang, -O2):
<__libc_sigsuspend>:
mov    (%rdi),%rax
mov    (%rax),%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <__syscall_sigsuspend@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32* }
define i32 @__libc_sigsuspend(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = call i32 @__syscall_sigsuspend(i32 0, i32 0, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32* }
define i32 @__libc_sigsuspend(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = tail call i32 @__syscall_sigsuspend(i32 0, i32 0, i32 %4)
ret i32 %5
}
void timer_uninit(void) {}


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

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

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

LLVM IR (-O2):
define void @timer_uninit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setin(int *);
int main(void) {
  int test = 189;
  setin(&test);
  printf("test = %d\n", test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xbd,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <setin@plt>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xbd,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <setin@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"test = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 189, i32* %1
%3 = call i32 @setin(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void pinMode(int pin, int mode) {}


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

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

LLVM IR (-O0):
define void @pinMode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @pinMode(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void swap(char arr[], char string[]) {
  int k = strlen(arr);
  char ans[k];
  strcpy(ans, arr);
  strcpy(arr, string);
  strcpy(string, ans);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %eax,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %6
%13 = alloca i8, i64 %11
store i64 %11, i64* %7
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %4
%20 = call i32 @strcpy(i8* %19, i8* %13)
%21 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @strcpy(i8* %5, i8* %0)
%7 = call i32 @strcpy(i8* %0, i8* %1)
%8 = call i32 @strcpy(i8* %1, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fooull(unsigned long long *);
void testunsignedlonglong() {
  unsigned long long ull = 2;
  fooull(&ull);
}


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

x86 assembly (clang, -O2):
<testunsignedlonglong>:
push   %rax
movq   $0x2,(%rsp)
mov    %rsp,%rdi
call   1030 <fooull@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @testunsignedlonglong() {
%1 = alloca i64
store i64 2, i64* %1
%2 = call i32 @fooull(i64* %1)
ret void
}

LLVM IR (-O2):
define void @testunsignedlonglong() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 2, i64* %1
%3 = call i32 @fooull(i64* %1)
ret void
}
/* Variables and functions */
int divides(int, int);
int sum_naturals(int);
int multiples_under(int p, int n) {
  int pdn = p / n - divides(n, p);
  return n * sum_naturals(pdn);
}


x86 assembly (clang, -O0):
<multiples_under>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <divides@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <sum_naturals@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiples_under>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%esi
mov    %edi,%eax
cltd
idiv   %ebx
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <divides@plt>
sub    %eax,%ebp
mov    %ebp,%edi
call   1030 <sum_naturals@plt>
imul   %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @multiples_under(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @divides(i32 %9, i32 %10)
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @sum_naturals(i32 %14)
%16 = mul nsw i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @multiples_under(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = tail call i32 @divides(i32 %1, i32 %0)
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @sum_naturals(i32 %5)
%7 = mul nsw i32 %6, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ debug_show_compiler();
int /*<<< orphan*/ debug_show_device_id();
int /*<<< orphan*/ debug_show_memory();
int /*<<< orphan*/ debug_show_version();
void debug_show_all(void) {
  debug_show_version();
  debug_show_device_id();
  debug_show_compiler();
  debug_show_memory();
}


x86 assembly (clang, -O0):
<debug_show_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <debug_show_version@plt>
mov    $0x0,%al
call   1030 <debug_show_device_id@plt>
mov    $0x0,%al
call   1040 <debug_show_compiler@plt>
mov    $0x0,%al
call   1060 <debug_show_memory@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_show_all>:
push   %rax
xor    %eax,%eax
call   1050 <debug_show_version@plt>
xor    %eax,%eax
call   1030 <debug_show_device_id@plt>
xor    %eax,%eax
call   1040 <debug_show_compiler@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <debug_show_memory@plt>

LLVM IR (-O0):
define void @debug_show_all() {
%1 = call i32 (...) @debug_show_version()
%2 = call i32 (...) @debug_show_device_id()
%3 = call i32 (...) @debug_show_compiler()
%4 = call i32 (...) @debug_show_memory()
ret void
}

LLVM IR (-O2):
define void @debug_show_all() {
%1 = tail call i32 (...) @debug_show_version()
%2 = tail call i32 (...) @debug_show_device_id()
%3 = tail call i32 (...) @debug_show_compiler()
%4 = tail call i32 (...) @debug_show_memory()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bubbleSort(float *, int);
int /*<<< orphan*/ searchHighAcceleration(int, float *, int);
int main(void) {
  float seconds[10] = {10.1, 2.3, 5.5, 6.0, 19.7, 26.9, 34.4, 1.1, 7.7, 16.6};
  searchHighAcceleration(6, seconds, 10);
  bubbleSort(seconds, 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rsi
mov    $0x6,%edi
mov    $0xa,%edx
call   1050 <searchHighAcceleration@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <bubbleSort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    $0x6,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1040 <searchHighAcceleration@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <bubbleSort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.seconds = [10 x float] [float 0x4024333340000000, float 0x4002666660000000, float 5.500000e+00, float 6.000000e+00, float 0x4033B33340000000, float 0x403AE66660000000, float 0x4041333340000000, float 0x3FF19999A0000000, float 0x401ECCCCC0000000, float 0x40309999A0000000]
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 @searchHighAcceleration(i32 6, float* %3, i32 10)
%5 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%6 = call i32 @bubbleSort(float* %5, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.seconds = [10 x float] [float 0x4024333340000000, float 0x4002666660000000, float 5.500000e+00, float 6.000000e+00, float 0x4033B33340000000, float 0x403AE66660000000, float 0x4041333340000000, float 0x3FF19999A0000000, float 0x401ECCCCC0000000, float 0x40309999A0000000]
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 @searchHighAcceleration(i32 6, float* %3, i32 10)
%5 = call i32 @bubbleSort(float* %3, i32 10)
ret i32 0
}
void gtk_label_set_attributes() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_1_1_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void asn1p_free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<asn1p_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @asn1p_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ tolower(int);
int main() {
  int c;
  while ((c = getchar()) != EOF)
    putchar(tolower(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     116c <main+0x3c>
mov    -0x8(%rbp),%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @tolower(i32 %8)
%10 = call i32 @putchar(i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @tolower(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
int f_bun_mr2(float *a1, float a2) { return !(__builtin_isunordered(*a1, a2)); }


x86 assembly (clang, -O0):
<f_bun_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bun_mr2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @f_bun_mr2(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp uno float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_bun_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ord float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
long LittleLong(long l) { return l; }


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

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

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

LLVM IR (-O2):
define i64 @LittleLong(i64 returned %0) {
ret i64 %0
}
void __attribute__((used)) ambiguous(void) {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @ambiguous to i8*)], section "llvm.metadata"
define void @ambiguous() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @ambiguous to i8*)], section "llvm.metadata"
define void @ambiguous() {
ret void
}
/* Variables and functions */
int STC3115_WriteBytes(unsigned char *, int, int);
int STC3115_WriteDataToRam(unsigned char *RamData) {
  return STC3115_WriteBytes(RamData, 0x20, 16);
}


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

x86 assembly (clang, -O2):
<STC3115_WriteDataToRam>:
mov    $0x20,%esi
mov    $0x10,%edx
jmp    1030 <STC3115_WriteBytes@plt>

LLVM IR (-O0):
define i32 @STC3115_WriteDataToRam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @STC3115_WriteBytes(i8* %3, i32 32, i32 16)
ret i32 %4
}

LLVM IR (-O2):
define i32 @STC3115_WriteDataToRam(i8* %0) {
%2 = tail call i32 @STC3115_WriteBytes(i8* %0, i32 32, i32 16)
ret i32 %2
}
/* Variables and functions */
int getbuf();
int /*<<< orphan*/ printf(char *, ...);
void test() {
  int val;
  printf("Type Hex string:");
  val = getbuf();
  printf("getbuf returned 0x%x\n", val);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getbuf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"Type Hex string:\00"
@.str.1 = [22 x i8] c"getbuf returned 0x%x\0A\00"
define void @test() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getbuf()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Type Hex string:\00"
@.str.1 = [22 x i8] c"getbuf returned 0x%x\0A\00"
define void @test() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getbuf()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void repeat(char c, int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%c", c);
}


x86 assembly (clang, -O0):
<repeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1152 <repeat+0x42>
lea    0xec5(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <repeat+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    113f <repeat+0x2f>
mov    %esi,%ebx
movsbl %dil,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <repeat+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @repeat(i8 signext %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
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @repeat(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
void SPI_MAX7221_EnableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_MAX7221_EnableRxInt() {
ret void
}
int stringLength(const char string[]) {
  int count = 0;
  while (string[count] != '\0') {
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <stringLength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stringLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int opt2(void) { return __builtin_constant_p("hi"[0]); }


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

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

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

LLVM IR (-O2):
define i32 @opt2() {
ret i32 1
}
int gethostname(name, namelen)
char *name;
int namelen;
{
  strncpy(name, "pc", namelen);
  return 0;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rdx
lea    0xed2(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
push   %rax
movslq %esi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"pc\00"
define i32 @gethostname(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
int timeSlice(int *pa) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @timeSlice(i32* nocapture readnone %0) {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, int, int);
int _seek_file(void *arg, int offset, int whence) {
  FILE *f = (FILE *)arg;
  return fseek(f, offset, whence);
}


x86 assembly (clang, -O0):
<_seek_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <fseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_seek_file>:
jmp    1030 <fseek@plt>

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

LLVM IR (-O2):
define i32 @_seek_file(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fseek(i32* %4, i32 %1, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void co_write16p(void const *ptr16, uint16_t value) {
  uint8_t *ptr = (uint8_t *)ptr16;
  *ptr++ = value & 0xff;
  *ptr = (value & 0xff00) >> 8;
}


x86 assembly (clang, -O0):
<co_write16p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_write16p>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @co_write16p(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %5
store i32 %9, i32* %10
%12 = load i32, i32* %4
%13 = and i32 %12, 65280
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %5
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @co_write16p(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %4, i32* %3
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
store i32 %8, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlightPlanControlHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void FlightPlanControlUpdated() { UAVObjUpdated(FlightPlanControlHandle()); }


x86 assembly (clang, -O0):
<FlightPlanControlUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FlightPlanControlHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlightPlanControlUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <FlightPlanControlHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @FlightPlanControlUpdated() {
%1 = call i32 (...) @FlightPlanControlHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightPlanControlUpdated() {
%1 = tail call i32 (...) @FlightPlanControlHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ print_date(unsigned short);
int main(void) {
  unsigned short x = 48627;
  print_date(x);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xbdf3,-0x6(%rbp)
movzwl -0x6(%rbp),%edi
call   1030 <print_date@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xbdf3,%edi
call   1030 <print_date@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 -16909, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @print_date(i16 zeroext %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @print_date(i16 zeroext -16909)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(const time_t *timer) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret %struct.tm* null
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define noalias %struct.tm* @gmtime(i32* nocapture readnone %0) {
ret %struct.tm* null
}
int min_i(int x, int y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min_i+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min_i+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_i>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min_i(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min_i(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ con_early_putch(char);
void con_early_putstr(const char *str) {
  char c;
  while ((c = *str++) != 0)
    con_early_putch(c);
}


x86 assembly (clang, -O0):
<con_early_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <con_early_putstr+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <con_early_putch@plt>
jmp    111c <con_early_putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_early_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <con_early_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <con_early_putch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <con_early_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @con_early_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @con_early_putch(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}