xunge/DecIR huggingface dataset:
int quatInverse(double *q, double *qout) {
  int i;
  qout[0] = q[0];
  for (i = 1; i < 4; ++i) {
    qout[i] = -1.0 * q[i] + 0.0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<quatInverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    115c <quatInverse+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
xorps  %xmm0,%xmm0
subsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <quatInverse+0x23>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quatInverse>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
subsd  0x8(%rdi),%xmm1
movsd  %xmm1,0x8(%rsi)
xorpd  %xmm1,%xmm1
subsd  0x10(%rdi),%xmm1
movsd  %xmm1,0x10(%rsi)
subsd  0x18(%rdi),%xmm0
movsd  %xmm0,0x18(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @quatInverse(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
store i32 1, i32* %5
br label %11
11: ; preds = %25, %2
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 4
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load double*, double** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %19, double 0.000000e+00)
%21 = load double*, double** %4
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
store double %20, double* %24
br label %25
25: ; preds = %14
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %11
28: ; preds = %11
ret i32 1
}

LLVM IR (-O2):
define i32 @quatInverse(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double -1.000000e+00, double 0.000000e+00)
%7 = getelementptr inbounds double, double* %1, i64 1
store double %6, double* %7
%8 = getelementptr inbounds double, double* %0, i64 2
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double -1.000000e+00, double 0.000000e+00)
%11 = getelementptr inbounds double, double* %1, i64 2
store double %10, double* %11
%12 = getelementptr inbounds double, double* %0, i64 3
%13 = load double, double* %12
%14 = tail call double @llvm.fmuladd.f64(double %13, double -1.000000e+00, double 0.000000e+00)
%15 = getelementptr inbounds double, double* %1, i64 3
store double %14, double* %15
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
get_humidity() { printf("hello"); }


x86 assembly (clang, -O0):
<get_humidity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @get_humidity() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @get_humidity() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ example_bad_ptr(int);
int /*<<< orphan*/ example_stack(int);
int /*<<< orphan*/ example_uninit(int);
int main(int argc, char **argv) {
  switch (argv[1][0]) {
  case 'p':
    example_bad_ptr(argc);
    break;
  case 's':
    example_stack(argc);
    break;
  case 'u':
    example_uninit(argc);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x70,%eax
je     1184 <main+0x54>
jmp    1162 <main+0x32>
mov    -0x14(%rbp),%eax
sub    $0x73,%eax
je     1191 <main+0x61>
jmp    1173 <main+0x43>
mov    -0x14(%rbp),%eax
sub    $0x75,%eax
je     119e <main+0x6e>
jmp    11a6 <main+0x76>
mov    -0x8(%rbp),%edi
call   1050 <example_bad_ptr@plt>
jmp    11a6 <main+0x76>
mov    -0x8(%rbp),%edi
call   1040 <example_stack@plt>
jmp    11a6 <main+0x76>
mov    -0x8(%rbp),%edi
call   1030 <example_uninit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rax
movsbl (%rax),%eax
cmp    $0x75,%eax
je     114e <main+0x1e>
cmp    $0x73,%eax
je     1155 <main+0x25>
cmp    $0x70,%eax
jne    115a <main+0x2a>
call   1050 <example_bad_ptr@plt>
jmp    115a <main+0x2a>
call   1030 <example_uninit@plt>
jmp    115a <main+0x2a>
call   1040 <example_stack@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %21 [
i32 112, label %12
i32 115, label %15
i32 117, label %18
]
12: ; preds = %2
%13 = load i32, i32* %4
%14 = call i32 @example_bad_ptr(i32 %13)
br label %21
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @example_stack(i32 %16)
br label %21
18: ; preds = %2
%19 = load i32, i32* %4
%20 = call i32 @example_uninit(i32 %19)
br label %21
21: ; preds = %2, %18, %15, %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %13 [
i32 112, label %7
i32 115, label %9
i32 117, label %11
]
7: ; preds = %2
%8 = tail call i32 @example_bad_ptr(i32 %0)
br label %13
9: ; preds = %2
%10 = tail call i32 @example_stack(i32 %0)
br label %13
11: ; preds = %2
%12 = tail call i32 @example_uninit(i32 %0)
br label %13
13: ; preds = %2, %11, %9, %7
ret i32 0
}
/* Variables and functions */
int do_room(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int room = 1;
  while (room > 0)
    room = do_room(room);
  printf("Thanks for playing\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1150 <main+0x30>
mov    -0x8(%rbp),%edi
call   1040 <do_room@plt>
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%edi
call   1040 <do_room@plt>
test   %eax,%eax
jg     1130 <main+0x10>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Thanks for playing\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @do_room(i32 %7)
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Thanks for playing\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %3, %1 ]
%3 = tail call i32 @do_room(i32 %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int /*<<< orphan*/ navigate(char *, int, char **);
void initnav(void) {
  char *cmd[] = {"teleport", "entry"};
  navigate(*cmd, (sizeof(cmd) / sizeof((cmd)[0])), cmd);
}


x86 assembly (clang, -O0):
<initnav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2cf1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cee(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rdx
mov    $0x2,%esi
call   1030 <navigate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initnav>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rdx
mov    $0x2,%esi
call   1030 <navigate@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"teleport\00"
@.str.1 = [6 x i8] c"entry\00"
@__const.initnav.cmd = [2 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0)]
define void @initnav() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = load i8*, i8** %3
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%6 = call i32 @navigate(i8* %4, i32 2, i8** %5)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"teleport\00"
@.str.1 = [6 x i8] c"entry\00"
@__const.initnav.cmd = [2 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0)]
define void @initnav() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @navigate(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2, i8** %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello gemjacker-helloworld-bin user!\n");
  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 <printf@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 = [38 x i8] c"Hello gemjacker-helloworld-bin user!\0A\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 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"Hello gemjacker-helloworld-bin user!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test36a(int b) {
  if (b)
    return 43;
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<test36a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1118 <_fini>
mov    $0x2b,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test36a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
ret i32 43
6: ; preds = %1
unreachable
}

LLVM IR (-O2):
define i32 @test36a(i32 %0) {
%2 = icmp ne i32 %0, 0
tail call void @llvm.assume(i1 %2)
ret i32 43
}
int _close(int file) {
  file = file;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ PacketFinish();
int /*<<< orphan*/ PacketStart();
int /*<<< orphan*/ PacketWriteChar(char);
int /*<<< orphan*/ PacketWriteHexNumber(int, int);
void PacketWriteSignal(int code) {
  PacketStart();
  PacketWriteChar('S');
  PacketWriteHexNumber(code, 2);
  PacketFinish();
}


x86 assembly (clang, -O0):
<PacketWriteSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <PacketStart@plt>
mov    $0x53,%edi
call   1040 <PacketWriteChar@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <PacketWriteHexNumber@plt>
mov    $0x0,%al
call   1060 <PacketFinish@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PacketWriteSignal>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <PacketStart@plt>
mov    $0x53,%edi
call   1040 <PacketWriteChar@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <PacketWriteHexNumber@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <PacketFinish@plt>

LLVM IR (-O0):
define void @PacketWriteSignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @PacketStart()
%4 = call i32 @PacketWriteChar(i8 signext 83)
%5 = load i32, i32* %2
%6 = call i32 @PacketWriteHexNumber(i32 %5, i32 2)
%7 = call i32 (...) @PacketFinish()
ret void
}

LLVM IR (-O2):
define void @PacketWriteSignal(i32 %0) {
%2 = tail call i32 (...) @PacketStart()
%3 = tail call i32 @PacketWriteChar(i8 signext 83)
%4 = tail call i32 @PacketWriteHexNumber(i32 %0, i32 2)
%5 = tail call i32 (...) @PacketFinish()
ret void
}
void calc() {}


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

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

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

LLVM IR (-O2):
define void @calc() {
ret void
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ printf(char *, ...);
void print_help(char *prog) {
  printf("MediaMVP VPD Read functions\n");
  printf("Usage: %s [-ht]\n", basename(prog));
  printf("\t-h   print help\n");
  printf("\t-t   TFTP=dongle.bin server ip\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rsi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %rdi,%rbx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <basename@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"MediaMVP VPD Read functions\0A\00"
@.str.1 = [17 x i8] c"Usage: %s [-ht]\0A\00"
@.str.2 = [18 x i8] c"\09-h print help\0A\00"
@.str.3 = [33 x i8] c"\09-t TFTP=dongle.bin server ip\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"Usage: %s [-ht]\0A\00"
@str = [28 x i8] c"MediaMVP VPD Read functions\00"
@str.4 = [17 x i8] c"\09-h print help\00"
@str.5 = [32 x i8] c"\09-t TFTP=dongle.bin server ip\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i8* @basename(i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared) {
  (void)attr;
  (void)pshared;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_setpshared(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
unsigned long SysCtlADCSpeedGet(void) {
  return ((*((volatile unsigned long *)(0x400FE100))) & 0x00000F00);
}


x86 assembly (clang, -O0):
<SysCtlADCSpeedGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe100,%eax
mov    (%rax),%rax
and    $0xf00,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlADCSpeedGet>:
mov    0x400fe100,%rax
40
and    $0xf00,%eax
ret

LLVM IR (-O0):
define i64 @SysCtlADCSpeedGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%2 = and i64 %1, 3840
ret i64 %2
}

LLVM IR (-O2):
define i64 @SysCtlADCSpeedGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%2 = and i64 %1, 3840
ret i64 %2
}
/* Variables and functions */
char *strchr(char const *, char const);
char *mbstrchr(const char *string, const char *chr) {
  return strchr(string, *chr);
}


x86 assembly (clang, -O0):
<mbstrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbstrchr>:
movsbl (%rsi),%esi
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @mbstrchr(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 i8, i8* %6
%8 = call i8* @strchr(i8* %5, i8 signext %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @mbstrchr(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %3)
ret i8* %4
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
main() {
  int nthreads, tid;
#pragma omp parallel private(nthreads, tid)
  {
    tid = omp_get_thread_num();
    printf("Hello World from thread = %d\n", tid);
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("Number of threads = %d\n", nthreads);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    117b <main+0x4b>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    1161 <main+0x31>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = call i32 (...) @omp_get_num_threads()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %0
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello World from thread = %d\0A\00"
@.str.1 = [24 x i8] c"Number of threads = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
ret i32 0
}
int __gcd(int num0, int num1) {
  if (num0 % num1 == 0)
    return num1;
  return __gcd(num1, num0 % num1);
}


x86 assembly (clang, -O0):
<__gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1139 <__gcd+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <__gcd+0x3d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <__gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gcd>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <__gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @__gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}
void INT_Excep_PERIB_INTB173(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB173() {
ret void
}
/* Variables and functions */
int f125(int *);
int f126(int *p) { return f125(p); }


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

x86 assembly (clang, -O2):
<f126>:
jmp    1030 <f125@plt>

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

LLVM IR (-O2):
define i32 @f126(i32* %0) {
%2 = tail call i32 @f125(i32* %0)
ret i32 %2
}
void run_posix_cpu_timers(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<run_posix_cpu_timers>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_posix_cpu_timers>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.run_posix_cpu_timers = [21 x i8] c"run_posix_cpu_timers\00"
define void @run_posix_cpu_timers() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.run_posix_cpu_timers, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.run_posix_cpu_timers = [21 x i8] c"run_posix_cpu_timers\00"
define void @run_posix_cpu_timers() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.run_posix_cpu_timers, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *hello1();
char *hello2();
int /*<<< orphan*/ print_ascii();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("\n");
  printf("Content-type: text/html\n\n");
  printf("Hello, World!\n");
  print_ascii();
  printf(hello1());
  printf(hello2());
  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    0xebb(%rip),%rdi
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <print_ascii@plt>
mov    $0x0,%al
call   1060 <hello1@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <hello2@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe8e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <print_ascii@plt>
xor    %eax,%eax
call   1080 <hello1@plt>
mov    %rax,%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <hello2@plt>
mov    %rax,%rdi
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [26 x i8] c"Content-type: text/html\0A\0A\00"
@.str.2 = [15 x i8] c"Hello, World!\0A\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 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @print_ascii()
%10 = call i8* (...) @hello1()
%11 = call i32 @printf(i8* %10)
%12 = call i8* (...) @hello2()
%13 = call i32 @printf(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Content-type: text/html\0A\00"
@str.3 = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 (...) @print_ascii()
%7 = tail call i8* (...) @hello1()
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
%9 = tail call i8* (...) @hello2()
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char const *);
FILE *dofopen(const char *path, const char *mode) {
  FILE *fp = fopen(path, mode);
  if (!(fp)) {
    perror(path);
    exit(EXIT_FAILURE);
  }
  return fp;
}


x86 assembly (clang, -O0):
<dofopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <dofopen+0x43>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dofopen>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     1140 <dofopen+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32* @dofopen(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 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @perror(i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i32* @dofopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i32* %3
}
char *strerror(int err) { return (char *)0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strerror(i32 %0) {
ret i8* null
}
int host_cmd_rwdma_completion(void *para) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @host_cmd_rwdma_completion(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef enum xprt_stat { ____Placeholder_xprt_stat } xprt_stat;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int XPRT_IDLE;
enum xprt_stat rendezvous_stat(SVCXPRT *xprt) {
  (void)xprt;
  return (XPRT_IDLE);
}


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

x86 assembly (clang, -O2):
<rendezvous_stat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@XPRT_IDLE = global i32 0
define i32 @rendezvous_stat(i32* nocapture readnone %0) {
%2 = load i32, i32* @XPRT_IDLE
ret i32 %2
}
void no_usable_data() {
  int i = 0;
  if (i) {
  }
}


x86 assembly (clang, -O0):
<no_usable_data>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111a <no_usable_data+0x1a>
jmp    111a <no_usable_data+0x1a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @no_usable_data() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %5
5: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @no_usable_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemStatsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void SystemStatsUpdated() { UAVObjUpdated(SystemStatsHandle()); }


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

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

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

LLVM IR (-O2):
define void @SystemStatsUpdated() {
%1 = tail call i32 (...) @SystemStatsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int strlen(char *str) {
  char *s = str;
  int i;
  for (i = 0; *str++ != '\0';)
    i++;
  str = s;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <strlen+0x40>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <strlen+0x17>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ GL_SMOOTH;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void init() {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_SMOOTH);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_SMOOTH = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_SMOOTH
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_SMOOTH = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_SMOOTH
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  if (!(x < y))
    return 0;
  while (x < y) {
    x = x + 1;
  }
  assert(x == y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1137 <main+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1170 <main+0x60>
jmp    113c <main+0x2c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <main+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <main+0x2c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_insert_tail(struct list *, struct list *);
int /*<<< orphan*/ list_remove(struct list *);
void list_make_last(struct list *list, struct list *entry) {
  list_remove(entry);
  list_insert_tail(list, entry);
}


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

x86 assembly (clang, -O2):
<list_make_last>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <list_remove@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_insert_tail@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_make_last(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %4
%6 = call i32 @list_remove(%struct.list* %5)
%7 = load %struct.list*, %struct.list** %3
%8 = load %struct.list*, %struct.list** %4
%9 = call i32 @list_insert_tail(%struct.list* %7, %struct.list* %8)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_make_last(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @list_remove(%struct.list* %1)
%4 = tail call i32 @list_insert_tail(%struct.list* %0, %struct.list* %1)
ret void
}
/* Variables and functions */
int strncmp(char *, char *, int);
void strncmp_1() {
  char *x = "234";
  char *y = "123";
  if (strncmp(x, y, 3) != 1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncmp_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x1,%eax
je     1149 <strncmp_1+0x39>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_1>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"234\00"
@.str.1 = [4 x i8] c"123\00"
define void @strncmp_1() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncmp(i8* %3, i8* %4, i32 3)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"234\00"
@.str.1 = [4 x i8] c"123\00"
define void @strncmp_1() {
%1 = tail call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}
void l1_non_existant_write(void) {
  int *i = (void *)0xFFAFFFFC;
  *i = 0;
}


x86 assembly (clang, -O0):
<l1_non_existant_write>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffaffffc,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<l1_non_existant_write>:
mov    $0xffaffffc,%eax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
define void @l1_non_existant_write() {
%1 = alloca i32*
store i32* inttoptr (i64 4289724412 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
define void @l1_non_existant_write() {
store i32 0, i32* inttoptr (i64 4289724412 to i32*)
ret void
}
int letterToIndex(char c) {
  switch (c) {
  case 'A':
    return 0;
  case 'C':
    return 1;
  case 'G':
    return 2;
  case 'T':
    return 3;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<letterToIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1164 <letterToIndex+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <letterToIndex+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <letterToIndex+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <letterToIndex+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <letterToIndex+0x6b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letterToIndex>:
add    $0xffffffbf,%edi
cmp    $0x13,%edi
ja     1120 <letterToIndex+0x20>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @letterToIndex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 67, label %7
i32 71, label %8
i32 84, label %9
]
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @letterToIndex(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 67, label %3
i32 71, label %4
i32 84, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i32 [ -1, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %8
}
int do_626() { return 626; }


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

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

LLVM IR (-O0):
define i32 @do_626() {
ret i32 626
}

LLVM IR (-O2):
define i32 @do_626() {
ret i32 626
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear_line() {
  printf("\r                                                                   "
         "\r");
}


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

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

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

LLVM IR (-O2):
@.str = [70 x i8] c"\0D \0D\00"
define void @clear_line() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("foo=%d\n", foo());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"foo=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int kstat_irqs();
int show_interrupts(void) { return kstat_irqs(); }


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

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

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

LLVM IR (-O2):
define i32 @show_interrupts() {
%1 = tail call i32 (...) @kstat_irqs()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_log_target_free() {
  printf("NOT IMPLEMENTED:"
         "pa_log_target_free"
         "\n");
}


x86 assembly (clang, -O0):
<pa_log_target_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_log_target_free\0A\00"
define i32 @pa_log_target_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_log_target_free\00"
define i32 @pa_log_target_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ blink(int);
void fail() { blink(50); }


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

x86 assembly (clang, -O2):
<fail>:
mov    $0x32,%edi
jmp    1030 <blink@plt>

LLVM IR (-O0):
define void @fail() {
%1 = call i32 @blink(i32 50)
ret void
}

LLVM IR (-O2):
define void @fail() {
%1 = tail call i32 @blink(i32 50)
ret void
}