xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fillroom(int, int);
int rand();
void froom(int n, int itm, int arg) {
  if (((int)(rand() % (151)) + 1) < n) {
    fillroom(itm, arg);
  }
}


x86 assembly (clang, -O0):
<froom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x97,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cmp    -0x4(%rbp),%edx
jge    1157 <froom+0x37>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <fillroom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<froom>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x36406c81,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x97,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
cmp    %ebx,%eax
jge    1167 <froom+0x47>
mov    %ebp,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fillroom@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @froom(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 151
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @fillroom(i32 %13, i32 %14)
br label %16
16: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @froom(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 151
%6 = add nsw i32 %5, 1
%7 = icmp slt i32 %6, %0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @fillroom(i32 %1, i32 %2)
br label %10
10: ; preds = %8, %3
ret void
}
void olpc_analog_input(struct snd_ac97 *ac97, int on) {}


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

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

LLVM IR (-O0):
%struct.snd_ac97 = type opaque
define void @olpc_analog_input(%struct.snd_ac97* %0, i32 %1) {
%3 = alloca %struct.snd_ac97*
%4 = alloca i32
store %struct.snd_ac97* %0, %struct.snd_ac97** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.snd_ac97 = type opaque
define void @olpc_analog_input(%struct.snd_ac97* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int m_copy_file_fp(FILE *from, FILE *to) {
  char buf[1024];
  int i;
  do {
    i = fread(buf, 1, 1024, from);
    fwrite(buf, 1, i, to);
  } while (i == 1024);
  return 0;
}


x86 assembly (clang, -O0):
<m_copy_file_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1030 <fread@plt>
mov    %eax,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x414(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
cmpl   $0x400,-0x414(%rbp)
je     1133 <m_copy_file_fp+0x13>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_copy_file_fp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
cmp    $0x400,%ebp
je     1140 <m_copy_file_fp+0x20>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @m_copy_file_fp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1024 x i8]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %7
7: ; preds = %15, %2
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i32 @fread(i8* %8, i32 1, i32 1024, i32* %9)
store i32 %10, i32* %6
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = load i32, i32* %6
%13 = load i32*, i32** %4
%14 = call i32 @fwrite(i8* %11, i32 1, i32 %12, i32* %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 1024
br i1 %17, label %7, label %18
18: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
define i32 @m_copy_file_fp(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %5, %2
%6 = call i32 @fread(i8* %4, i32 1, i32 1024, i32* %0)
%7 = call i32 @fwrite(i8* %4, i32 1, i32 %6, i32* %1)
%8 = icmp eq i32 %6, 1024
br i1 %8, label %5, label %9
9: ; preds = %5
ret i32 0
}
void g_hook_get() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_get() {
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
scalar_t__ strlen(char *);
char *mfm_append_paths(char *one, char *two) {
  char *res = malloc(strlen(one) + strlen(two) + 2);
  sprintf(res, "%s/%s", one, two);
  return res;
}


x86 assembly (clang, -O0):
<mfm_append_paths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe83(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfm_append_paths>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define i8* @mfm_append_paths(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 2
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define noalias i8* @mfm_append_paths(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %7
}
void gtk_file_chooser_remove_shortcut_folder() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_remove_shortcut_folder() {
ret void
}
unsigned int swap_even_odd_bits(unsigned int num, unsigned int new_number) {
  unsigned int even_bits, odd_bits;
  even_bits = num & 0xAAAAAAAA;
  odd_bits = num & 0x55555555;
  even_bits >>= 1;
  odd_bits <<= 1;
  return (even_bits | odd_bits);
}


x86 assembly (clang, -O0):
<swap_even_odd_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_even_odd_bits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
and    $0xd5555555,%edi
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @swap_even_odd_bits(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 = and i32 %7, -1431655766
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = and i32 %9, 1431655765
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = lshr i32 %11, 1
store i32 %12, i32* %5
%13 = load i32, i32* %6
%14 = shl i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = or i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swap_even_odd_bits(i32 %0, i32 %1) {
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = shl i32 %0, 1
%6 = and i32 %5, -1431655766
%7 = or i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t mpeg2_detect_accel(uint32_t accel) { return accel; }


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

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

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

LLVM IR (-O2):
define i32 @mpeg2_detect_accel(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char *cat(char *, char *);
int /*<<< orphan*/ io_getkey();
int /*<<< orphan*/ io_printgeneric(char *);
int /*<<< orphan*/ io_printmap(int /*<<< orphan*/);
char *itoa(int);
void pass_between_humans(int to) {
  io_printmap(0);
  io_printgeneric(cat(cat("Please pass control to Player ", itoa(to + 1)),
                      ".\n    Press any key to continue."));
  io_getkey();
}


x86 assembly (clang, -O0):
<pass_between_humans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1050 <io_printmap@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1060 <itoa@plt>
mov    %rax,%rsi
lea    0xe89(%rip),%rdi
call   1070 <cat@plt>
mov    %rax,%rdi
lea    0xe99(%rip),%rsi
call   1070 <cat@plt>
mov    %rax,%rdi
call   1040 <io_printgeneric@plt>
mov    $0x0,%al
call   1030 <io_getkey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_between_humans>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1050 <io_printmap@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1060 <itoa@plt>
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
call   1070 <cat@plt>
lea    0xea5(%rip),%rsi
mov    %rax,%rdi
call   1070 <cat@plt>
mov    %rax,%rdi
call   1040 <io_printgeneric@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <io_getkey@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Please pass control to Player \00"
@.str.1 = [33 x i8] c".\0A Press any key to continue.\00"
define void @pass_between_humans(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @io_printmap(i32 0)
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = call i8* @itoa(i32 %5)
%7 = call i8* @cat(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i8* @cat(i8* %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @io_printgeneric(i8* %8)
%10 = call i32 (...) @io_getkey()
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Please pass control to Player \00"
@.str.1 = [33 x i8] c".\0A Press any key to continue.\00"
define void @pass_between_humans(i32 %0) {
%2 = tail call i32 @io_printmap(i32 0)
%3 = add nsw i32 %0, 1
%4 = tail call i8* @itoa(i32 %3)
%5 = tail call i8* @cat(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i8* @cat(i8* %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @io_printgeneric(i8* %6)
%8 = tail call i32 (...) @io_getkey()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_arr(int *, int, int);
int main(int argc, char *argv[]) {
  int array1[] = {1, 30, 34, 80, 0, 1, 32};
  print_arr(array1 + 1, 5, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array1 = [7 x i32] [i32 1, i32 30, i32 34, i32 80, i32 0, i32 1, i32 32]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [7 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [7 x i32]* %6 to i8*
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %6, i64 0, i64 0
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = call i32 @print_arr(i32* %9, i32 5, i32 1)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array1 = [7 x i32] [i32 1, i32 30, i32 34, i32 80, i32 0, i32 1, i32 32]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
%6 = call i32 @print_arr(i32* %5, i32 5, i32 1)
ret i32 0
}
/* Variables and functions */
int cCreateEdgeFace(int, char **);
int CreateEdgeFace(int argc, char *argv[]) {
  return cCreateEdgeFace(argc, argv);
}


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

x86 assembly (clang, -O2):
<CreateEdgeFace>:
jmp    1030 <cCreateEdgeFace@plt>

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

LLVM IR (-O2):
define i32 @CreateEdgeFace(i32 %0, i8** %1) {
%3 = tail call i32 @cCreateEdgeFace(i32 %0, i8** %1)
ret i32 %3
}
int SDL_imageFilterDivASM(unsigned char *Src1, unsigned char *Src2,
                          unsigned char *Dest, unsigned int SrcLength) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterDivASM>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterDivASM(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterDivASM(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
unsigned char cpu_get_r8(struct cpu *, int);
unsigned char cpu_get_c(struct cpu *cpu) { return cpu_get_r8(cpu, (2)); }


x86 assembly (clang, -O0):
<cpu_get_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <cpu_get_r8@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_get_c>:
mov    $0x2,%esi
jmp    1030 <cpu_get_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define zeroext i8 @cpu_get_c(%struct.cpu* %0) {
%2 = alloca %struct.cpu*
store %struct.cpu* %0, %struct.cpu** %2
%3 = load %struct.cpu*, %struct.cpu** %2
%4 = call zeroext i8 @cpu_get_r8(%struct.cpu* %3, i32 2)
ret i8 %4
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define zeroext i8 @cpu_get_c(%struct.cpu* %0) {
%2 = tail call zeroext i8 @cpu_get_r8(%struct.cpu* %0, i32 2)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inv_host_serif_get_instance();
int /*<<< orphan*/
inv_host_serif_get_max_write_transaction_size(int /*<<< orphan*/);
uint32_t inv_host_serif_get_max_write_transaction_size_i(void) {
  return inv_host_serif_get_max_write_transaction_size(
      inv_host_serif_get_instance());
}


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

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

LLVM IR (-O0):
define i32 @inv_host_serif_get_max_write_transaction_size_i() {
%1 = call i32 (...) @inv_host_serif_get_instance()
%2 = call i32 @inv_host_serif_get_max_write_transaction_size(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @inv_host_serif_get_max_write_transaction_size_i() {
%1 = tail call i32 (...) @inv_host_serif_get_instance()
%2 = tail call i32 @inv_host_serif_get_max_write_transaction_size(i32 %1)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
char *strstr(char const *, char *);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
unsigned short get_port(const char *buffer) {
  char *host_start = strstr(buffer, "\r\nHOST: ") + strlen("\r\nHOST: ");
  char *host_end = strstr(host_start, ":");
  return (unsigned short)strtol(host_end + 1, NULL, 10);
}


x86 assembly (clang, -O0):
<get_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_port>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
mov    %r14,%rsi
call   1060 <strstr@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\0D\0AHOST: \00"
@.str.1 = [2 x i8] c":\00"
define zeroext i16 @get_port(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strstr(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i8* @strstr(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = call i64 @strtol(i8* %13, i32* null, i32 10)
%15 = trunc i64 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0D\0AHOST: \00"
define zeroext i16 @get_port(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = tail call i8* @strchr(i8* dereferenceable(1) %5, i32 58)
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i64 @strtol(i8* nocapture %7, i32* null, i32 10)
%9 = trunc i64 %8 to i16
ret i16 %9
}
void EarlySampleSupport_D(void) {}


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

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

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

LLVM IR (-O2):
define void @EarlySampleSupport_D() {
ret void
}
int c055(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c055() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __environ;
int __execve(char const *, char *const *, int /*<<< orphan*/);
int execv(const char *path, char *const argv[]) {
  return __execve(path, argv, __environ);
}


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

x86 assembly (clang, -O2):
<execv>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <__execve@plt>

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

LLVM IR (-O2):
@__environ = global i32 0
define i32 @execv(i8* %0, i8** %1) {
%3 = load i32, i32* @__environ
%4 = tail call i32 @__execve(i8* %0, i8** %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init(double *, double *, int);
int /*<<< orphan*/ vec_mult(double *, double *, double *, int);
void foo(double *p0, double *v1, double *v2, int N) {
  init(v1, v2, N);
#pragma omp target data map(to : v1 [0:N], v2[:N]) map(from : p0 [0:N])
  vec_mult(p0, v1, v2, N);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <vec_mult@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <init@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <vec_mult@plt>

LLVM IR (-O0):
define void @foo(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %6
%10 = load double*, double** %7
%11 = load i32, i32* %8
%12 = call i32 @init(double* %9, double* %10, i32 %11)
%13 = load double*, double** %5
%14 = load double*, double** %6
%15 = load double*, double** %7
%16 = load i32, i32* %8
%17 = call i32 @vec_mult(double* %13, double* %14, double* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @foo(double* %0, double* %1, double* %2, i32 %3) {
%5 = tail call i32 @init(double* %1, double* %2, i32 %3)
%6 = tail call i32 @vec_mult(double* %0, double* %1, double* %2, i32 %3)
ret void
}
struct ListNode *removeNodeByMat(struct ListNode *head, unsigned int mat) {
  return head;
}


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

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

LLVM IR (-O0):
%struct.ListNode = type opaque
define %struct.ListNode* @removeNodeByMat(%struct.ListNode* %0, i32 %1) {
%3 = alloca %struct.ListNode*
%4 = alloca i32
store %struct.ListNode* %0, %struct.ListNode** %3
store i32 %1, i32* %4
%5 = load %struct.ListNode*, %struct.ListNode** %3
ret %struct.ListNode* %5
}

LLVM IR (-O2):
%struct.ListNode = type opaque
define %struct.ListNode* @removeNodeByMat(%struct.ListNode* readnone returned %0, i32 %1) {
ret %struct.ListNode* %0
}
/* Variables and functions */
int /*<<< orphan*/ R_SetViewSize();
void Fov_OnChange(void) { R_SetViewSize(); }


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

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

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

LLVM IR (-O2):
define void @Fov_OnChange() {
%1 = tail call i32 (...) @R_SetViewSize()
ret void
}
int main() {
  unsigned __int128 x = b(0, 9);
  if (4 * 8 == 32 && 8 * 8 == 64 && 16 * 8 == 128 &&
      x != (((unsigned __int128)1 << 64) | 0x10327))
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    %dil,%al
mov    $0x9,%esi
call   1040 <b@plt>
movslq %eax,%rcx
mov    %rcx,%rax
sar    $0x3f,%rax
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
movaps -0x20(%rbp),%xmm0
movaps 0xea5(%rip),%xmm1
pcmpeqb %xmm1,%xmm0
pmovmskb %xmm0,%eax
sub    $0xffff,%eax
je     1178 <main+0x58>
jmp    1173 <main+0x53>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <b@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i128
store i32 0, i32* %1
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @b to i32 (i32, i32, ...)*)(i32 0, i32 9)
%4 = sext i32 %3 to i128
store i128 %4, i128* %2
%5 = load i128, i128* %2
%6 = icmp ne i128 %5, 18446744073709617959
br i1 %6, label %7, label %8
7: ; preds = %0
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @b to i32 (i32, i32, ...)*)(i32 0, i32 9)
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void frob_command() {
  printf("frob"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"frob\00"
define void @frob_command() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void rop3_72_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_72_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_72_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_72_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_72_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cs2sdhcb(void *);
void cs2sdhcb_(void *dhcbfn) { cs2sdhcb(dhcbfn); }


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

x86 assembly (clang, -O2):
<cs2sdhcb_>:
jmp    1030 <cs2sdhcb@plt>

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

LLVM IR (-O2):
define void @cs2sdhcb_(i8* %0) {
%2 = tail call i32 @cs2sdhcb(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ swap64(int /*<<< orphan*/);
uint64_t tole64(uint64_t x) {
  return (*(uint16_t *)"\0\1" == 1) ? swap64(x) : x;
}


x86 assembly (clang, -O0):
<tole64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,0xede(%rip)
jne    1138 <tole64+0x28>
mov    -0x4(%rbp),%edi
call   1030 <swap64@plt>
mov    %eax,-0x8(%rbp)
jmp    113e <tole64+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"\00\01\00"
define i32 @tole64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* bitcast ([3 x i8]* @.str to i32*)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @swap64(i32 %6)
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @tole64(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int rand();
void farray(int *array, int b) {
  for (int j = 0; j < b; ++j) {
    array[j] = 1 + rand() % b - 1;
  }
}


x86 assembly (clang, -O0):
<farray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <farray+0x4c>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
add    $0x1,%edx
sub    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <farray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<farray>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <farray+0x38>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <farray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @farray(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, %1
%11 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Type definitions */
struct lconv {
  int dummy;
};

/* Variables and functions */
struct lconv *localeconv(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.lconv = type { i32 }
define %struct.lconv* @localeconv() {
ret %struct.lconv* null
}

LLVM IR (-O2):
%struct.lconv = type { i32 }
define noalias %struct.lconv* @localeconv() {
ret %struct.lconv* null
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double current_time() {
  struct timeval tp[1];
  gettimeofday(tp, 0);
  return tp->tv_sec * 1000000.0 + tp->tv_usec;
}


x86 assembly (clang, -O0):
<current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time>:
sub    $0x18,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  (%rsp),%xmm0
mulsd  0xed5(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @current_time() {
%1 = alloca [1 x %struct.timeval]
%2 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%9 = load double, double* %8
%10 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @current_time() {
%1 = alloca [1 x %struct.timeval]
%2 = bitcast [1 x %struct.timeval]* %1 to i8*
%3 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0, i32 1
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+06, double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
char *foo() {
  char *p, c;
  c = 'a';
  p = &c;
  printf("*p = %c\n", *p);
  return p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x9(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed1(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
lea    0x7(%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"*p = %c\0A\00"
define noalias i8* @foo() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext 97)
ret i8* %1
}
/* Variables and functions */
char UART0_GetChar();
int /*<<< orphan*/ UART0_PutChar(char);
int /*<<< orphan*/ UART0_SendString(char *);
int main() {
  char data;
  UART0_SendString("\n\rHello World!\n\r");
  while (1) {
    data = UART0_GetChar();
    UART0_PutChar(data + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <UART0_SendString@plt>
mov    $0x0,%al
call   1050 <UART0_GetChar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl %al,%edi
call   1030 <UART0_PutChar@plt>
jmp    114b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <UART0_SendString@plt>
nopl   (%rax)
xor    %eax,%eax
call   1050 <UART0_GetChar@plt>
add    $0x1,%al
movsbl %al,%edi
call   1030 <UART0_PutChar@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\0DHello World!\0A\0D\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = call signext i8 (...) @UART0_GetChar()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 1
%9 = trunc i32 %8 to i8
%10 = call i32 @UART0_PutChar(i8 signext %9)
br label %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\0DHello World!\0A\0D\00"
define i32 @main() {
%1 = tail call i32 @UART0_SendString(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @UART0_GetChar()
%4 = add i8 %3, 1
%5 = tail call i32 @UART0_PutChar(i8 signext %4)
br label %2
}
const char *_Locale_collate_default(char *__DUMMY_PAR) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_collate_default(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(scalar_t__, char *);
scalar_t__ strrchr(char *, char);
int hasHuff(char *string) {
  return strrchr(string, '.') && !strcmp(strrchr(string, '.'), ".huff");
}


x86 assembly (clang, -O0):
<hasHuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1174 <hasHuff+0x54>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,%rdi
lea    0xe9c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasHuff>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     115a <hasHuff+0x3a>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0xeb9(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c".huff\00"
define i32 @hasHuff(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strrchr(i8* %3, i8 signext 46)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strrchr(i8* %7, i8 signext 46)
%9 = call i32 @strcmp(i64 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [6 x i8] c".huff\00"
define i32 @hasHuff(i8* %0) {
%2 = tail call i64 @strrchr(i8* %0, i8 signext 46)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @strrchr(i8* %0, i8 signext 46)
%6 = tail call i32 @strcmp(i64 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void fatalerror(message) char *message;
{
  error(message);
  finishup();
}


x86 assembly (clang, -O0):
<fatalerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <error@plt>
mov    $0x0,%al
call   1030 <finishup@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fatalerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (...) @finishup()
ret void
}

LLVM IR (-O2):
define void @fatalerror(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (...) @finishup()
ret void
}
int test_palindrome(char *s, char *e) {
  if (*s != *e)
    return (0);
  if (s >= e)
    return (1);
  return (test_palindrome(++s, --e));
}


x86 assembly (clang, -O0):
<test_palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1142 <test_palindrome+0x32>
movl   $0x0,-0x4(%rbp)
jmp    117c <test_palindrome+0x6c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     115c <test_palindrome+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    117c <test_palindrome+0x6c>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
mov    %rsi,-0x18(%rbp)
call   1030 <test_palindrome@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_palindrome>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1129 <test_palindrome+0x29>
nopl   0x0(%rax,%rax,1)
cmp    %rsi,%rdi
jae    112a <test_palindrome+0x2a>
lea    -0x1(%rsi),%rcx
movzbl 0x1(%rdi),%edx
add    $0x1,%rdi
cmp    -0x1(%rsi),%dl
mov    %rcx,%rsi
je     1110 <test_palindrome+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @test_palindrome(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2, %10
%7 = phi i8* [ %12, %10 ], [ %1, %2 ]
%8 = phi i8* [ %11, %10 ], [ %0, %2 ]
%9 = icmp ult i8* %8, %7
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = getelementptr inbounds i8, i8* %7, i64 -1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp eq i8 %13, %14
br i1 %15, label %6, label %16
16: ; preds = %10, %6, %2
%17 = phi i32 [ 0, %2 ], [ 1, %6 ], [ 0, %10 ]
ret i32 %17
}
/* Type definitions */
struct llib_stat_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ llib_sys_stat(char const *, struct llib_stat_t *);
__attribute__((unused)) int stat(const char *path, struct llib_stat_t *st) {
  return llib_sys_stat(path, st) ? 0 : -1;
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <llib_sys_stat@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
push   %rax
call   1030 <llib_sys_stat@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.llib_stat_t = type { i32 }
define i32 @stat(i8* %0, %struct.llib_stat_t* %1) {
%3 = alloca i8*
%4 = alloca %struct.llib_stat_t*
store i8* %0, i8** %3
store %struct.llib_stat_t* %1, %struct.llib_stat_t** %4
%5 = load i8*, i8** %3
%6 = load %struct.llib_stat_t*, %struct.llib_stat_t** %4
%7 = call i64 @llib_sys_stat(i8* %5, %struct.llib_stat_t* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
%struct.llib_stat_t = type { i32 }
define i32 @stat(i8* %0, %struct.llib_stat_t* %1) {
%3 = tail call i64 @llib_sys_stat(i8* %0, %struct.llib_stat_t* %1)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}