xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("    pipe takes 1 argument: the name of the FIFO to write to.\n");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c" pipe takes 1 argument: the name of the FIFO to write to.\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c" pipe takes 1 argument: the name of the FIFO to write to.\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
uint16_t prng_uint16() { return (uint16_t)rand(); }


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

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

LLVM IR (-O0):
define i32 @prng_uint16() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @prng_uint16() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR4C_get(void) { return U_WMRCORENONE_get("U_WMRRESETDOC"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"U_WMRRESETDOC\00"
define i32 @U_WMR4C_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"U_WMRRESETDOC\00"
define i32 @U_WMR4C_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rotate(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char *);
int main() {
  char str[] = "abcdefghijklmn";
  printf("str: %s\n", str);
  rotate(str, strlen(str), 3);
  printf("result: %s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xf(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    -0xf(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xf(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x3,%edx
call   1050 <rotate@plt>
lea    -0xf(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6e6d6c6b6a6968,%rax
mov    %rax,0x7(%rsp)
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,(%rsp)
lea    0xeb6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x3,%edx
call   1050 <rotate@plt>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.str = [15 x i8] c"abcdefghijklmn\00"
@.str = [9 x i8] c"str: %s\0A\00"
@.str.1 = [12 x i8] c"result: %s\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @rotate(i8* %2, i32 %4, i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
unsigned char gf_alog(scalar_t__);
scalar_t__ gf_log(unsigned char);
unsigned char gf_mulinv(unsigned char x) {
  return (x) ? gf_alog(255 - gf_log(x)) : 0;
}


x86 assembly (clang, -O0):
<gf_mulinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     115c <gf_mulinv+0x3c>
movzbl -0x1(%rbp),%edi
call   1040 <gf_log@plt>
mov    $0xff,%edi
sub    %rax,%rdi
call   1030 <gf_alog@plt>
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <gf_mulinv+0x46>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <gf_mulinv+0x46>
mov    -0x8(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_mulinv>:
test   %edi,%edi
je     113c <gf_mulinv+0x1c>
push   %rax
movzbl %dil,%edi
call   1040 <gf_log@plt>
mov    $0xff,%edi
sub    %rax,%rdi
pop    %rax
jmp    1030 <gf_alog@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @gf_mulinv(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @gf_log(i8 zeroext %7)
%9 = sub nsw i64 255, %8
%10 = call zeroext i8 @gf_alog(i64 %9)
%11 = zext i8 %10 to i32
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %6
%14 = phi i32 [ %11, %6 ], [ 0, %12 ]
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @gf_mulinv(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @gf_log(i8 zeroext %0)
%5 = sub nsw i64 255, %4
%6 = tail call zeroext i8 @gf_alog(i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 0, %1 ]
ret i8 %8
}
int handle_event(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @handle_event() {
ret i32 0
}
int sysfs_add_file_to_group(struct kobject *kobj, const struct attribute *attr,
                            const char *group) {
  return 0;
}


x86 assembly (clang, -O0):
<sysfs_add_file_to_group>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kobject = type opaque
%struct.attribute = type opaque
define i32 @sysfs_add_file_to_group(%struct.kobject* %0, %struct.attribute* %1, i8* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.attribute*
%6 = alloca i8*
store %struct.kobject* %0, %struct.kobject** %4
store %struct.attribute* %1, %struct.attribute** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define i32 @sysfs_add_file_to_group(%struct.kobject* nocapture readnone %0, %struct.attribute* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
void str_to_file(const char *filepath, const char *data) {
  FILE *fp = fopen(filepath, "w");
  if (fp != NULL) {
    fputs(data, fp);
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<str_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1175 <str_to_file+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1165 <str_to_file+0x35>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @str_to_file(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %1, i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %2
ret void
}
short test_54_2(short *mem) { return __atomic_fetch_or(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_54_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
or     %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    115d <test_54_2+0x5d>
jmp    1125 <test_54_2+0x25>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_54_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
or     $0x1,%ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test_54_2+0x10>
ret

LLVM IR (-O0):
define signext i16 @test_54_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 0
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw or i16* %6, i16 %7 acq_rel
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @test_54_2(i16* nocapture %0) {
%2 = atomicrmw or i16* %0, i16 1 acq_rel
ret i16 %2
}
int fib(int n) {
  if (n == 0 || n == 1) {
    return n;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <fib+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113a <fib+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <fib+0x4d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fib+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fib+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void printExecError(int i) {
  fprintf(stderr, "ERROR child %d exec failed!\n", i);
}


x86 assembly (clang, -O0):
<printExecError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printExecError>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"ERROR child %d exec failed!\0A\00"
define void @printExecError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"ERROR child %d exec failed!\0A\00"
define void @printExecError(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void foo030(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo030(i32 %0) {
ret void
}
char *world(void) { return "World"; }


x86 assembly (clang, -O0):
<world>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<world>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"World\00"
define i8* @world() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"World\00"
define i8* @world() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double fma(double, double, double);
double fms64(double x, double y, double z) { return fma(-x, y, z); }


x86 assembly (clang, -O0):
<fms64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <fma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fms64>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <fma@plt>

LLVM IR (-O0):
define double @fms64(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fneg double %7
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @llvm.fma.f64(double %8, double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @fms64(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = tail call double @llvm.fma.f64(double %4, double %1, double %2)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ mutex_attr;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int main(void) {
  pthread_mutexattr_t mutex_attr;
  (void)memset(&mutex_attr, 0, sizeof(mutex_attr));
  return sizeof(mutex_attr);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @memset(i32* %2, i32 0, i32 4)
ret i32 4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @memset(i32* %1, i32 0, i32 4)
ret i32 4
}
/* Variables and functions */
int u_strcmp(void *, void *);
int mycompare(void *a, void *b) { return u_strcmp(a, b); }


x86 assembly (clang, -O0):
<mycompare>:
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 <u_strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycompare>:
jmp    1030 <u_strcmp@plt>

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

LLVM IR (-O2):
define i32 @mycompare(i8* %0, i8* %1) {
%3 = tail call i32 @u_strcmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indiquerPosition(int p) {
  int i;
  for (i = 0; i < p; i++) {
    printf(" ");
  }
  printf("^\n");
}


x86 assembly (clang, -O0):
<indiquerPosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <indiquerPosition+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indiquerPosition+0x12>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indiquerPosition>:
push   %rbx
test   %edi,%edi
jle    113f <indiquerPosition+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <indiquerPosition+0x10>
lea    0xeba(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"^\00"
define void @indiquerPosition(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_1Fint64_lowword_mem(long long *val) {
  return ((*val) & (0x1F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Fint64_lowword_mem>:
testb  $0x1f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 31
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_70uint16_mem(unsigned short *val) {
  return ((*val) & (0x70 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_70uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x70,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_70uint16_mem>:
testb  $0x70,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_70uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 112
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashctx *, int, int,
                                     int /*<<< orphan*/);
int spi_disable_blockprotect_s33(struct flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x1C, 1 << 7, 0);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_s33>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_s33>:
mov    $0x1c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_s33(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %3, i32 28, i32 128, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_s33(%struct.flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %0, i32 28, i32 128, i32 0)
ret i32 %2
}
void initialize_readline() {}


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

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

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

LLVM IR (-O2):
define void @initialize_readline() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vt_write_str(char *);
void vt_color_reset(void) {
  vt_write_str("\x1B"
               "["
               "39"
               ";49"
               "m");
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[39;49m\00"
define void @vt_color_reset() {
%1 = call i32 @vt_write_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[39;49m\00"
define void @vt_color_reset() {
%1 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_getpath();
int main() {
  test_getpath();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_getpath()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_getpath()
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c)) {
    c -= 'a' - 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1136 <toupper+0x26>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
unsigned epx_generic_input_fmts() { return (1 << 0); }


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

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

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

LLVM IR (-O2):
define i32 @epx_generic_input_fmts() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello world!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drawAIStatus();
int /*<<< orphan*/ drawFPS();
int /*<<< orphan*/ drawFrames();
int /*<<< orphan*/ drawSpeedometer();
void drawHud(void) {
  drawFrames();
  drawSpeedometer();
  drawFPS();
  drawAIStatus();
}


x86 assembly (clang, -O0):
<drawHud>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <drawFrames@plt>
mov    $0x0,%al
call   1060 <drawSpeedometer@plt>
mov    $0x0,%al
call   1040 <drawFPS@plt>
mov    $0x0,%al
call   1030 <drawAIStatus@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawHud>:
push   %rax
xor    %eax,%eax
call   1050 <drawFrames@plt>
xor    %eax,%eax
call   1060 <drawSpeedometer@plt>
xor    %eax,%eax
call   1040 <drawFPS@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <drawAIStatus@plt>

LLVM IR (-O0):
define void @drawHud() {
%1 = call i32 (...) @drawFrames()
%2 = call i32 (...) @drawSpeedometer()
%3 = call i32 (...) @drawFPS()
%4 = call i32 (...) @drawAIStatus()
ret void
}

LLVM IR (-O2):
define void @drawHud() {
%1 = tail call i32 (...) @drawFrames()
%2 = tail call i32 (...) @drawSpeedometer()
%3 = tail call i32 (...) @drawFPS()
%4 = tail call i32 (...) @drawAIStatus()
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int open(char *, int);
void resourceLeak_open1(void) { int fd = open("file", O_RDWR | O_CREAT); }


x86 assembly (clang, -O0):
<resourceLeak_open1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ed0(%rip),%rax
or     (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resourceLeak_open1>:
mov    0x2ec9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xed7(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"file\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define void @resourceLeak_open1() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"file\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define void @resourceLeak_open1() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
char *Diss_char(char *, char);
char *Diss_space(char *pString) { return Diss_char(pString, ' '); }


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

x86 assembly (clang, -O2):
<Diss_space>:
mov    $0x20,%esi
jmp    1030 <Diss_char@plt>

LLVM IR (-O0):
define i8* @Diss_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @Diss_char(i8* %3, i8 signext 32)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Diss_space(i8* %0) {
%2 = tail call i8* @Diss_char(i8* %0, i8 signext 32)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void embeddedsystemrecursivefunction(void) {
  printf("embeddedsystemrecursivefunction\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"embeddedsystemrecursivefunction\00"
define void @embeddedsystemrecursivefunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *exec) {
  fprintf(stderr, "Usage: %s [chip_select [channel]]\n", exec);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: %s [chip_select [channel]]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: %s [chip_select [channel]]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
scalar_t__ realloc_array(void **, int, int, int, int, int);
float **realloc_float(float **array, int first, int second, int ext1,
                      int ext2) {
  return (float **)realloc_array((void **)array, sizeof(float), first, second,
                                 ext1, ext2);
}


x86 assembly (clang, -O0):
<realloc_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x4,%esi
call   1030 <realloc_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_float>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <realloc_array@plt>

LLVM IR (-O0):
define float** @realloc_float(float** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store float** %0, float*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load float**, float*** %6
%12 = bitcast float** %11 to i8**
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i64 @realloc_array(i8** %12, i32 4, i32 %13, i32 %14, i32 %15, i32 %16)
%18 = inttoptr i64 %17 to float**
ret float** %18
}

LLVM IR (-O2):
define float** @realloc_float(float** %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = bitcast float** %0 to i8**
%7 = tail call i64 @realloc_array(i8** %6, i32 4, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = inttoptr i64 %7 to float**
ret float** %8
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ IPC_CREAT;
int msgget(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  int i = msgget((key_t)123123, IPC_CREAT);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    $0x1e0f3,%edi
call   1030 <msgget@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    $0x1e0f3,%edi
call   1030 <msgget@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @IPC_CREAT
%4 = call i32 @msgget(i32 123123, i32 %3)
store i32 %4, i32* %2
ret i32 0
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @main() {
%1 = load i32, i32* @IPC_CREAT
%2 = tail call i32 @msgget(i32 123123, i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t UARTModemStatusGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000018))) &
          (0x00000100 | 0x00000004 | 0x00000001 | 0x00000002));
}


x86 assembly (clang, -O0):
<UARTModemStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x107,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemStatusGet>:
movslq %edi,%rcx
mov    $0x107,%eax
and    0x18(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 24
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 263
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = add nsw i32 %0, 24
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 263
ret i32 %6
}
/* Type definitions */
struct wl_shm {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
void wl_shm_destroy(struct wl_shm *wl_shm) {
  wl_proxy_destroy((struct wl_proxy *)wl_shm);
}


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

x86 assembly (clang, -O2):
<wl_shm_destroy>:
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_shm = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shm_destroy(%struct.wl_shm* %0) {
%2 = alloca %struct.wl_shm*
store %struct.wl_shm* %0, %struct.wl_shm** %2
%3 = load %struct.wl_shm*, %struct.wl_shm** %2
%4 = bitcast %struct.wl_shm* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %4)
ret void
}

LLVM IR (-O2):
%struct.wl_shm = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shm_destroy(%struct.wl_shm* %0) {
%2 = bitcast %struct.wl_shm* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ acceptData(int *, int *, int *);
int /*<<< orphan*/ printResults(int *, int *, int *);
int main() {
  int valueSet[50];
  int finalSet[50];
  valueSet[0] = 0;
  finalSet[0] = 0;
  int window = 0;
  int realSize = 0;
  acceptData(valueSet, &window, &realSize);
  printResults(valueSet, &realSize, &window);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xd0(%rbp)
movl   $0x0,-0x1a0(%rbp)
movl   $0x0,-0x1a4(%rbp)
movl   $0x0,-0x1a8(%rbp)
lea    -0xd0(%rbp),%rdi
lea    -0x1a4(%rbp),%rsi
lea    -0x1a8(%rbp),%rdx
call   1030 <acceptData@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x1a8(%rbp),%rsi
lea    -0x1a4(%rbp),%rdx
call   1040 <printResults@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <acceptData@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printResults@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [50 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [50 x i32]* %1 to i8*
%5 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
store i32 0, i32* %5
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = call i32 @acceptData(i32* %5, i32* %2, i32* %3)
%9 = call i32 @printResults(i32* %5, i32* %3, i32* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_isdst;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ mktime(struct tm *);
time_t local2utc(time_t in) {
  struct tm *tt;
  tt = gmtime(&in);
  tt->tm_isdst = -1;
  return mktime(tt);
}


x86 assembly (clang, -O0):
<local2utc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <mktime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local2utc>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
movl   $0xffffffff,(%rax)
mov    %rax,%rdi
call   1030 <mktime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @local2utc(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call %struct.tm* @gmtime(i32* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
store i32 -1, i32* %6
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i32 @mktime(%struct.tm* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @local2utc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @gmtime(i32* %2)
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
store i32 -1, i32* %4
%5 = call i32 @mktime(%struct.tm* %3)
ret i32 %5
}
int pow2(int v) { return (v * v); }


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

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

LLVM IR (-O0):
define i32 @pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void foo372() {}


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

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

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

LLVM IR (-O2):
define void @foo372() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int testing_assert(int expression) {
  if (expression) {
    printf("TEST SUCCEEDED!\n");
    return 1;
  } else {
    printf("TEST FAILED!\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<testing_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113d <testing_assert+0x2d>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1150 <testing_assert+0x40>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testing_assert>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
setne  %bl
lea    0xee1(%rip),%rax
lea    0xee7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"TEST SUCCEEDED!\0A\00"
@.str.1 = [14 x i8] c"TEST FAILED!\0A\00"
define i32 @testing_assert(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@str = [13 x i8] c"TEST FAILED!\00"
@str.2 = [16 x i8] c"TEST SUCCEEDED!\00"
define i32 @testing_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0)
%4 = xor i1 %2, true
%5 = zext i1 %4 to i32
%6 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ get_cmd(char *, int);
void run() {
  char cmd_buf[100];
  while (1) {
    get_cmd(cmd_buf, 98);
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
mov    $0x62,%esi
call   1030 <get_cmd@plt>
jmp    1118 <run+0x8>

x86 assembly (clang, -O2):
<run>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x62,%esi
call   1030 <get_cmd@plt>
jmp    1120 <run+0x10>

LLVM IR (-O0):
define void @run() {
%1 = alloca [100 x i8]
br label %2
2: ; preds = %0, %2
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @get_cmd(i8* %3, i32 98)
br label %2
}

LLVM IR (-O2):
define void @run() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @get_cmd(i8* %2, i32 98)
br label %3
}
void ana_init_irq(void) {}


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

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

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

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