xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int pread(int, scalar_t__ *, int, int);
long long read_msr(int fd, int which) {
  uint64_t data = 0;
  if (pread(fd, &data, sizeof(data), which) != sizeof(data)) {
    perror("read_msr:pread");
    return -1;
  }
  return (long long)data;
}


x86 assembly (clang, -O0):
<read_msr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%ecx
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
cltq
cmp    $0x8,%rax
je     116f <read_msr+0x4f>
lea    0xea3(%rip),%rdi
call   1030 <perror@plt>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1177 <read_msr+0x57>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_msr>:
push   %rax
mov    %esi,%ecx
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
cmp    $0x8,%eax
jne    1143 <read_msr+0x23>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"read_msr:pread\00"
define i64 @read_msr(i32 %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 @pread(i32 %0, i64* %3, i32 8, i32 %1)
%6 = icmp eq i32 %5, 8
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = load i64, i64* %3
br label %11
11: ; preds = %9, %7
%12 = phi i64 [ -1, %7 ], [ %10, %9 ]
ret i64 %12
}
int _wds_sse(int *a, int *b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_wds_sse(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execle(char *, char *, char *, int /*<<< orphan*/ *,
                          char **);
int main(int argc, char const *argv[]) {
  char *my_env[] = {"JUICE=peach and apple", NULL};
  execle("dinner_info", "dinner_info", "4", NULL, my_env);
  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    0x2ce3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%r8
lea    0xecf(%rip),%rsi
lea    0xed4(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1030 <execle@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xef0(%rip),%rdi
lea    0xef5(%rip),%rdx
mov    %rsp,%r8
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1030 <execle@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"JUICE=peach and apple\00"
@__const.main.my_env = [2 x i8*] [i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [12 x i8] c"dinner_info\00"
@.str.2 = [2 x i8] c"4\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%9 = call i32 @execle(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* null, i8** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"JUICE=peach and apple\00"
@__const.main.my_env = [2 x i8*] [i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [12 x i8] c"dinner_info\00"
@.str.2 = [2 x i8] c"4\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i32 @execle(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* null, i8** %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void je_near_rj(unsigned int saut) {
  put8(0x0F);
  put8(0x84);
  put32(saut);
}


x86 assembly (clang, -O0):
<je_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x84,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<je_near_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x84,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @je_near_rj(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 132)
%5 = load i32, i32* %2
%6 = call i32 @put32(i32 %5)
ret void
}

LLVM IR (-O2):
define void @je_near_rj(i32 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 132)
%4 = tail call i32 @put32(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a4(int);
void a3(int n) { a4(n); }


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

x86 assembly (clang, -O2):
<a3>:
jmp    1030 <a4@plt>

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

LLVM IR (-O2):
define void @a3(i32 %0) {
%2 = tail call i32 @a4(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fstp_preg32_dword(int reg32) {
  put8(0xD9);
  put8(0x18 + reg32);
}


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

x86 assembly (clang, -O2):
<fstp_preg32_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xd9,%edi
call   1030 <put8@plt>
add    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fstp_preg32_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 217)
%4 = load i32, i32* %2
%5 = add nsw i32 24, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fstp_preg32_dword(i32 %0) {
%2 = tail call i32 @put8(i32 217)
%3 = add nsw i32 %0, 24
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int test_func(int, int, int);
int main(int argc, char const *argv[]) {
  int i = test_func(2, 3, 2);
  return !(i == 5);
}


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    $0x2,%edx
mov    $0x3,%esi
mov    %edx,%edi
call   1030 <test_func@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <test_func@plt>
xor    %ecx,%ecx
cmp    $0x5,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @test_func(i32 2, i32 3, i32 2)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 5
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_func(i32 2, i32 3, i32 2)
%4 = icmp ne i32 %3, 5
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float answer = 17 / 13.0;
  printf("%.2f\n", answer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
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    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 0x3FF4EC4EC0000000)
ret i32 0
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void Athena_MillisecondSleep(unsigned ms) {
  struct timespec t;
  unsigned long ns = ms * 1000000;
  t.tv_sec = ms / 1000;
  ns -= (t.tv_sec * 1000000000);
  t.tv_nsec = ns;
  nanosleep(&t, NULL);
}


x86 assembly (clang, -O0):
<Athena_MillisecondSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x18(%rbp)
imul   $0x3b9aca00,-0x18(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Athena_MillisecondSleep>:
sub    $0x18,%rsp
imul   $0xf4240,%edi,%eax
mov    %edi,%ecx
imul   $0x10624dd3,%rcx,%rcx
shr    $0x26,%rcx
mov    %ecx,0x8(%rsp)
imul   $0x3b9aca00,%ecx,%ecx
sub    %rcx,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @Athena_MillisecondSleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul i32 %5, 1000000
%7 = zext i32 %6 to i64
store i64 %7, i64* %4
%8 = load i32, i32* %2
%9 = udiv i32 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = mul i32 %12, 1000000000
%14 = zext i32 %13 to i64
%15 = load i64, i64* %4
%16 = sub i64 %15, %14
store i64 %16, i64* %4
%17 = load i64, i64* %4
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %17, i64* %18
%19 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @Athena_MillisecondSleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = mul i32 %0, 1000000
%5 = zext i32 %4 to i64
%6 = udiv i32 %0, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %6, i32* %7
%8 = mul i32 %6, 1000000000
%9 = zext i32 %8 to i64
%10 = sub nsw i64 %5, %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %10, i64* %11
%12 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World.\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 = [14 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 ([14 x i8], [14 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*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int dice;
  srand(time(NULL));
  dice = rand() % 6 + 1;
  printf("Congratulations you roled a %d!\n", dice);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Congratulations you roled a %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Congratulations you roled a %d!\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned int const_time_select(unsigned int mask, unsigned int true_val,
                               unsigned int false_val) {
  return (mask & true_val) | (~mask & false_val);
}


x86 assembly (clang, -O0):
<const_time_select>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<const_time_select>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @const_time_select(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @const_time_select(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void moto_buildTimeStamp(char *s) {
  strcpy(s, "00:13:26");
  strcat(s, " ");
  strcat(s, "Mar 17 2022");
}


x86 assembly (clang, -O0):
<moto_buildTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moto_buildTimeStamp>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"00:13:26\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [12 x i8] c"Mar 17 2022\00"
define void @moto_buildTimeStamp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"00:13:26\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [12 x i8] c"Mar 17 2022\00"
define void @moto_buildTimeStamp(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ writeInstruction(int /*<<< orphan*/);
void LCDIntf_WriteInstruction(int32_t instr) { writeInstruction(instr); }


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

x86 assembly (clang, -O2):
<LCDIntf_WriteInstruction>:
jmp    1030 <writeInstruction@plt>

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

LLVM IR (-O2):
define void @LCDIntf_WriteInstruction(i32 %0) {
%2 = tail call i32 @writeInstruction(i32 %0)
ret void
}
int Star(s, p)
register char *s;
register char *p;
{
  while (wildmat(s, p) == 0)
    if (*++s == '\0')
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<Star>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <wildmat@plt>
cmp    $0x0,%eax
jne    1165 <Star+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1160 <Star+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116c <Star+0x5c>
jmp    1120 <Star+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Star>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <wildmat@plt>
test   %eax,%eax
jne    113f <Star+0x2f>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <Star+0x10>
xor    %eax,%eax
jmp    1144 <Star+0x34>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @Star(i8* %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wildmat to i32 (i8*, i8*, ...)*)(i8* %4, i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %12
}
int of_driver_match_device(struct device *dev, struct device_driver *drv) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
%struct.device_driver = type opaque
define i32 @of_driver_match_device(%struct.device* nocapture readnone %0, %struct.device_driver* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ zalarm_env_fini();
void ___env_fini(void) { zalarm_env_fini(); }


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

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

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

LLVM IR (-O2):
define void @___env_fini() {
%1 = tail call i32 (...) @zalarm_env_fini()
ret void
}
void device_tree_init(void) {}


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

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

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

LLVM IR (-O2):
define void @device_tree_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void version() {
  printf("Remote control daemon, version 1\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Remote control daemon, version 1\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"Remote control daemon, version 1\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
unsigned long lh_char_hash(const void *k) {
  unsigned int h = 0;
  const char *data = (const char *)k;
  while (*data != 0)
    h = h * 129 + (unsigned int)(*data++) + 0x9e370001UL;
  return h;
}


x86 assembly (clang, -O0):
<lh_char_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <lh_char_hash+0x59>
imul   $0x81,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,%eax
movabs $0x9e370001,%rcx
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
jmp    1117 <lh_char_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lh_char_hash>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     112f <lh_char_hash+0x2f>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x7,%edx
add    %eax,%edx
lea    (%rcx,%rdx,1),%eax
add    $0x9e370001,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <lh_char_hash+0x10>
mov    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @lh_char_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %7, 129
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i32 %9, -1640562687
%12 = add i32 %11, %8
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = zext i32 %12 to i64
br label %17
17: ; preds = %15, %1
%18 = phi i64 [ 0, %1 ], [ %16, %15 ]
ret i64 %18
}
int space(char *stream, long offset) {
  char c = stream[offset];
  return c == ' ' || c == '\t' || c == '\r' || c == '\n';
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x12(%rbp)
je     115d <space+0x5d>
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x12(%rbp)
je     115d <space+0x5d>
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x12(%rbp)
je     115d <space+0x5d>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
movzbl (%rdi,%rsi,1),%ecx
cmp    $0x20,%rcx
ja     1120 <space+0x20>
mov    $0x1,%eax
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <space+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @space(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 32, label %8
i8 13, label %8
i8 9, label %8
]
5: ; preds = %2
%6 = icmp eq i8 %4, 10
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %2, %2, %5
%9 = phi i32 [ 1, %2 ], [ %7, %5 ], [ 1, %2 ], [ 1, %2 ]
ret i32 %9
}
void calc_ti(double a, double k, double *t1, double t2, double x, double h) {
  *t1 = k * a * t2 - h * x / k * a;
}


x86 assembly (clang, -O0):
<calc_ti>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_ti>:
mulsd  %xmm4,%xmm3
divsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
subsd  %xmm3,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @calc_ti(double %0, double %1, double* %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double* %2, double** %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %8
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %10
%17 = load double, double* %12
%18 = load double, double* %11
%19 = fmul double %17, %18
%20 = load double, double* %8
%21 = fdiv double %19, %20
%22 = load double, double* %7
%23 = fmul double %21, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double %15, double %16, double %24)
%26 = load double*, double** %9
store double %25, double* %26
ret void
}

LLVM IR (-O2):
define void @calc_ti(double %0, double %1, double* nocapture writeonly %2, double %3, double %4, double %5) {
%7 = fmul double %0, %1
%8 = fneg double %5
%9 = fmul double %8, %4
%10 = fdiv double %9, %1
%11 = fmul double %10, %0
%12 = tail call double @llvm.fmuladd.f64(double %7, double %3, double %11)
store double %12, double* %2
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int my_strcmp(char *str1, char *str2) {
  if (strcmp(str2, "#") == 0)
    return 0;
  else
    return strcmp(str1, str2);
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1145 <my_strcmp+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1155 <my_strcmp+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113f <my_strcmp+0x2f>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcmp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
void dummy_close_window(int id) { id = id; }


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

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

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

LLVM IR (-O2):
define void @dummy_close_window(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_join(scalar_t__, void **);
void wait4thread(pthread_t threadid) {
  int *jstatus;
  if (threadid > 0)
    pthread_join(threadid, (void **)&jstatus);
}


x86 assembly (clang, -O0):
<wait4thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1134 <wait4thread+0x24>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <pthread_join@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait4thread>:
test   %rdi,%rdi
jle    1122 <wait4thread+0x12>
push   %rax
mov    %rsp,%rsi
call   1030 <pthread_join@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @wait4thread(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %2
%8 = bitcast i32** %3 to i8**
%9 = call i32 @pthread_join(i64 %7, i8** %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @wait4thread(i64 %0) {
%2 = alloca i32*
%3 = bitcast i32** %2 to i8*
%4 = icmp sgt i64 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = bitcast i32** %2 to i8**
%7 = call i32 @pthread_join(i64 %0, i8** %6)
br label %8
8: ; preds = %5, %1
ret void
}
double(asin)(double x) { return 0.0; }


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

x86 assembly (clang, -O2):
<asin>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @asin(double %0) {
ret double 0.000000e+00
}
int dolby_dap_set_custom_stereo_onoff(int port_id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dolby_dap_set_custom_stereo_onoff(i32 %0) {
ret i32 0
}
/* Variables and functions */
int bitcount(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", bitcount(10));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @bitcount(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void chunk_reverse(char *s, int n) {}


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

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

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

LLVM IR (-O2):
define void @chunk_reverse(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_version(FILE *f) {
  fputs("hr 0.1\nCopyright (C) 2013 Paul Giblock\nLicense GPLv3+: GNU GPL "
        "version 3 or later <http://gnu.org/licenses/gpl.html>.\nThis is free "
        "software: you are free to change and redistribute it.\nThere is NO "
        "WARRANTY, to the extent permitted by law.\n\nWritten by Paul R. "
        "Giblock.\n",
        f);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x10c,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [269 x i8] c"hr 0.1\0ACopyright (C) 2013 Paul Giblock\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Paul R. Giblock.\0A\00"
define void @print_version(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [269 x i8] c"hr 0.1\0ACopyright (C) 2013 Paul Giblock\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Paul R. Giblock.\0A\00"
define void @print_version(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0), i64 268, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int mult(int, int);
int random(int seed) { return mult(seed, 31415821) + 1; }


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1df5e0d,%esi
call   1030 <mult@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rax
mov    $0x1df5e0d,%esi
call   1030 <mult@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mult(i32 %3, i32 31415821)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @random(i32 %0) {
%2 = tail call i32 @mult(i32 %0, i32 31415821)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ userSetDefault();
void func6Default() {
  userSetDefault();
  print("HEY DEFAULT");
  delay(2000);
}


x86 assembly (clang, -O0):
<func6Default>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <userSetDefault@plt>
lea    0xebe(%rip),%rdi
call   1030 <print@plt>
mov    $0x7d0,%edi
call   1040 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func6Default>:
push   %rax
xor    %eax,%eax
call   1050 <userSetDefault@plt>
lea    0xec1(%rip),%rdi
call   1030 <print@plt>
mov    $0x7d0,%edi
pop    %rax
jmp    1040 <delay@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"HEY DEFAULT\00"
define void @func6Default() {
%1 = call i32 (...) @userSetDefault()
%2 = call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @delay(i32 2000)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"HEY DEFAULT\00"
define void @func6Default() {
%1 = tail call i32 (...) @userSetDefault()
%2 = tail call i32 @print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @delay(i32 2000)
ret void
}
char *RCSid() {
  return RCSid("$Id: bf_test.c,v 1.10 2007/10/02 18:18:57 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"$Id: bf_test.c,v 1.10 2007/10/02 18:18:57 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
unsigned mk_ebml_size_size(unsigned s) {
  if (s < 0x7f)
    return 1;
  if (s < 0x3fff)
    return 2;
  if (s < 0x1fffff)
    return 3;
  if (s < 0x0fffffff)
    return 4;
  return 5;
}


x86 assembly (clang, -O0):
<mk_ebml_size_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jae    111d <mk_ebml_size_size+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    116f <mk_ebml_size_size+0x6f>
cmpl   $0x3fff,-0x8(%rbp)
jae    1136 <mk_ebml_size_size+0x36>
movl   $0x2,-0x4(%rbp)
jmp    116f <mk_ebml_size_size+0x6f>
cmpl   $0x1fffff,-0x8(%rbp)
jae    114f <mk_ebml_size_size+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    116f <mk_ebml_size_size+0x6f>
cmpl   $0xfffffff,-0x8(%rbp)
jae    1168 <mk_ebml_size_size+0x68>
movl   $0x4,-0x4(%rbp)
jmp    116f <mk_ebml_size_size+0x6f>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_ebml_size_size>:
mov    $0x1,%eax
cmp    $0x7f,%edi
jb     1132 <mk_ebml_size_size+0x32>
mov    $0x2,%eax
cmp    $0x3fff,%edi
jb     1132 <mk_ebml_size_size+0x32>
mov    $0x3,%eax
cmp    $0x1fffff,%edi
jb     1132 <mk_ebml_size_size+0x32>
cmp    $0xfffffff,%edi
mov    $0x5,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @mk_ebml_size_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 16383
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 2097151
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp ult i32 %16, 268435455
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 5, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @mk_ebml_size_size(i32 %0) {
%2 = icmp ult i32 %0, 127
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 16383
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 2097151
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 268435455
%9 = select i1 %8, i32 4, i32 5
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
int bits_match(int length, int offset) {
  if (length < 3 && offset < 64) {
    return 8;
  } else {
    return 16;
  }
}


x86 assembly (clang, -O0):
<bits_match>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    112a <bits_match+0x2a>
cmpl   $0x40,-0xc(%rbp)
jge    112a <bits_match+0x2a>
movl   $0x8,-0x4(%rbp)
jmp    1131 <bits_match+0x31>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_match>:
xor    %eax,%eax
cmp    $0x40,%esi
setge  %al
cmp    $0x3,%edi
lea    0x8(,%rax,8),%ecx
mov    $0x10,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_match(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 3
%4 = icmp slt i32 %1, 64
%5 = and i1 %3, %4
%6 = select i1 %5, i32 8, i32 16
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_srand_time();
void NLOSRT(void) { nlopt_srand_time(); }


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

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

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

LLVM IR (-O2):
define void @NLOSRT() {
%1 = tail call i32 (...) @nlopt_srand_time()
ret void
}
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
                                         const struct wps_credential *cred) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wps_credential = type opaque
define void @wpa_supplicant_dbus_notify_wps_cred(%struct.wpa_supplicant* nocapture %0, %struct.wps_credential* nocapture %1) {
ret void
}
int biggest_island_size(int **graph, int rows, int cols) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @biggest_island_size(i32** nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}