xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hola");
  getch();
  return 4;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"hola\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getch()
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usbdump Copyright (C) 2011 Bert Vermeulen <bert@biot.com>\n");
  printf("usage: usbdump [-d <vid:pid>] [-u <num lines>] [-b <bus number>]\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"usbdump Copyright (C) 2011 Bert Vermeulen <bert@biot.com>\0A\00"
@.str.1 = [66 x i8] c"usage: usbdump [-d <vid:pid>] [-u <num lines>] [-b <bus number>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [58 x i8] c"usbdump Copyright (C) 2011 Bert Vermeulen <bert@biot.com>\00"
@str.2 = [65 x i8] c"usage: usbdump [-d <vid:pid>] [-u <num lines>] [-b <bus number>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mx_strtoseconds(char *, unsigned long long *);
int mx_strtominutes(char *str, unsigned long long int *minutes) {
  int res;
  res = mx_strtoseconds(str, minutes);
  if (res >= 0)
    *minutes /= 60;
  return res;
}


x86 assembly (clang, -O0):
<mx_strtominutes>:
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 <mx_strtoseconds@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1159 <mx_strtominutes+0x49>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    (%rax),%rax
mov    $0x3c,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_strtominutes>:
push   %rbx
mov    %rsi,%rbx
call   1030 <mx_strtoseconds@plt>
mov    %eax,%ecx
test   %eax,%eax
js     1133 <mx_strtominutes+0x23>
movabs $0x8888888888888889,%rax
88 88 88
mulq   (%rbx)
shr    $0x5,%rdx
mov    %rdx,(%rbx)
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mx_strtominutes(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = load i64*, i64** %4
%8 = call i32 @mx_strtoseconds(i8* %6, i64* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64*, i64** %4
%13 = load i64, i64* %12
%14 = udiv i64 %13, 60
store i64 %14, i64* %12
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @mx_strtominutes(i8* %0, i64* %1) {
%3 = tail call i32 @mx_strtoseconds(i8* %0, i64* %1)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i64, i64* %1
%7 = udiv i64 %6, 60
store i64 %7, i64* %1
br label %8
8: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Cipher(int, unsigned char *, unsigned char *,
                          unsigned char **, unsigned char *);
void AES_encryptWithKey(unsigned char *in, unsigned char *out,
                        unsigned char *RoundKey) {
  int Nr = 10;
  int Nk = 4;
  unsigned char state[4][4];
  Cipher(Nr, in, out, state, RoundKey);
  return;
}


x86 assembly (clang, -O0):
<AES_encryptWithKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1030 <Cipher@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_encryptWithKey>:
sub    $0x18,%rsp
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rcx
mov    $0xa,%edi
call   1030 <Cipher@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @AES_encryptWithKey(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x [4 x i8]]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 10, i32* %7
store i32 4, i32* %8
%10 = load i32, i32* %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %9, i64 0, i64 0
%14 = bitcast [4 x i8]* %13 to i8**
%15 = load i8*, i8** %6
%16 = call i32 @Cipher(i32 %10, i8* %11, i8* %12, i8** %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @AES_encryptWithKey(i8* %0, i8* %1, i8* %2) {
%4 = alloca [4 x [4 x i8]]
%5 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %4, i64 0, i64 0, i64 0
%6 = bitcast [4 x [4 x i8]]* %4 to i8**
%7 = call i32 @Cipher(i32 10, i8* %0, i8* %1, i8** %6, i8* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
void delay(int milli_seconds) {
  clock_t start_time = clock();
  while (clock() < start_time + milli_seconds)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    -0x10(%rbp),%rcx
movslq -0x4(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jge    1146 <delay+0x36>
jmp    1126 <delay+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <clock@plt>
movslq %ebx,%rbx
add    %rax,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rbx,%rax
jl     1120 <delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 (...) @clock()
store i64 %4, i64* %3
br label %5
5: ; preds = %12, %1
%6 = call i64 (...) @clock()
%7 = load i64, i64* %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
%11 = icmp slt i64 %6, %10
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = tail call i64 (...) @clock()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i64 (...) @clock()
%7 = icmp slt i64 %6, %4
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void panic(const char *msg) {
  fprintf(stderr, "panic: %s\n", msg);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"panic: %s\0A\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strlen(char const *);
int write(int, char const *, int);
int write_tty(int device, const char *buffer, int length) {
  return write(device, buffer, (length > 0) ? length : strlen(buffer));
}


x86 assembly (clang, -O0):
<write_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1155 <write_tty+0x35>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    1161 <write_tty+0x41>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%edx
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_tty>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
test   %edx,%edx
jg     1136 <write_tty+0x16>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @write_tty(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %6
br label %16
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call i32 @strlen(i8* %14)
br label %16
16: ; preds = %13, %11
%17 = phi i32 [ %12, %11 ], [ %15, %13 ]
%18 = call i32 @write(i32 %7, i8* %8, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @write_tty(i32 %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %1)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ %2, %3 ]
%9 = tail call i32 @write(i32 %0, i8* %1, i32 %8)
ret i32 %9
}
void foo314(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo314(i32 %0) {
ret void
}
/* Variables and functions */
int groupForSMP(int);
int intelDetectSMP(void) { return groupForSMP(1); }


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

x86 assembly (clang, -O2):
<intelDetectSMP>:
mov    $0x1,%edi
jmp    1030 <groupForSMP@plt>

LLVM IR (-O0):
define i32 @intelDetectSMP() {
%1 = call i32 @groupForSMP(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intelDetectSMP() {
%1 = tail call i32 @groupForSMP(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __driDriverGetExtensions_foo();
int /*<<< orphan*/ initial_setup();
int /*<<< orphan*/ vdp_imp_device_create_x11();
int main(void) {
  initial_setup();
  vdp_imp_device_create_x11();
  __driDriverGetExtensions_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 <initial_setup@plt>
mov    $0x0,%al
call   1030 <vdp_imp_device_create_x11@plt>
mov    $0x0,%al
call   1050 <__driDriverGetExtensions_foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initial_setup()
%2 = tail call i32 (...) @vdp_imp_device_create_x11()
%3 = tail call i32 (...) @__driDriverGetExtensions_foo()
ret i32 0
}
void deref_pointer(int *x) { int y = *x; }


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

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

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

LLVM IR (-O2):
define void @deref_pointer(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int smbftpd_auth_is_user_in_group(char const *, char const *);
int is_user_in_group(const char *user, const char *group) {
  return smbftpd_auth_is_user_in_group(user, group);
}


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

x86 assembly (clang, -O2):
<is_user_in_group>:
jmp    1030 <smbftpd_auth_is_user_in_group@plt>

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

LLVM IR (-O2):
define i32 @is_user_in_group(i8* %0, i8* %1) {
%3 = tail call i32 @smbftpd_auth_is_user_in_group(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ munlock(void *, int);
void sfree(void *p) {
  int *q = (int *)p - 1;
  memset(p, 0, *q);
  munlock(p, *q);
  free(q);
}


x86 assembly (clang, -O0):
<sfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <munlock@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfree>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    -0x4(%rdi),%r14
mov    -0x4(%rdi),%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x4(%rbx),%esi
mov    %rbx,%rdi
call   1030 <munlock@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <free@plt>

LLVM IR (-O0):
define void @sfree(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 -1
store i32* %6, i32** %3
%7 = load i8*, i8** %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @memset(i8* %7, i32 0, i32 %9)
%11 = load i8*, i8** %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = call i32 @munlock(i8* %11, i32 %13)
%15 = load i32*, i32** %3
%16 = call i32 @free(i32* %15)
ret void
}

LLVM IR (-O2):
define void @sfree(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @memset(i8* %0, i32 0, i32 %4)
%6 = load i32, i32* %3
%7 = tail call i32 @munlock(i8* %0, i32 %6)
%8 = tail call i32 @free(i32* %3)
ret void
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ init_timer(int);
int /*<<< orphan*/ outb(int, unsigned char);
int /*<<< orphan*/ usleep(int);
void play_sound(int freq, int period) {
  unsigned char b;
  init_timer(freq);
  b = inb(0x61);
  outb(0x61, b | 0x2 | 0x1);
  usleep(period);
  outb(0x61, b & ~(0x2 | 0x1));
}


x86 assembly (clang, -O0):
<play_sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <init_timer@plt>
mov    $0x61,%edi
call   1040 <inb@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
or     $0x2,%eax
or     $0x1,%eax
mov    $0x61,%edi
movzbl %al,%esi
call   1030 <outb@plt>
mov    -0x8(%rbp),%edi
call   1060 <usleep@plt>
movzbl -0x9(%rbp),%eax
and    $0xfffffffc,%eax
mov    $0x61,%edi
movzbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play_sound>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1050 <init_timer@plt>
mov    $0x61,%edi
call   1040 <inb@plt>
mov    %eax,%ebx
or     $0x3,%al
movzbl %al,%esi
mov    $0x61,%edi
call   1030 <outb@plt>
mov    %ebp,%edi
call   1060 <usleep@plt>
and    $0xfc,%bl
movzbl %bl,%esi
mov    $0x61,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @play_sound(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @init_timer(i32 %6)
%8 = call zeroext i8 @inb(i32 97)
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = or i32 %10, 2
%12 = or i32 %11, 1
%13 = trunc i32 %12 to i8
%14 = call i32 @outb(i32 97, i8 zeroext %13)
%15 = load i32, i32* %4
%16 = call i32 @usleep(i32 %15)
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = and i32 %18, -4
%20 = trunc i32 %19 to i8
%21 = call i32 @outb(i32 97, i8 zeroext %20)
ret void
}

LLVM IR (-O2):
define void @play_sound(i32 %0, i32 %1) {
%3 = tail call i32 @init_timer(i32 %0)
%4 = tail call zeroext i8 @inb(i32 97)
%5 = or i8 %4, 3
%6 = tail call i32 @outb(i32 97, i8 zeroext %5)
%7 = tail call i32 @usleep(i32 %1)
%8 = and i8 %4, -4
%9 = tail call i32 @outb(i32 97, i8 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tsb8(int /*<<< orphan*/);
int /*<<< orphan*/ zeropage();
void tsbZp8(void) { tsb8(zeropage()); }


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

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

LLVM IR (-O0):
define void @tsbZp8() {
%1 = call i32 (...) @zeropage()
%2 = call i32 @tsb8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @tsbZp8() {
%1 = tail call i32 (...) @zeropage()
%2 = tail call i32 @tsb8(i32 %1)
ret void
}
/* Variables and functions */
int atoi(char *);
int strlen(char *);
int extractLineNum(char *input) {
  int n = strlen(input);
  char *p = input + n - 1;
  while (*p != ' ')
    p--;
  p++;
  int lno = atoi(p);
  *p = '\0';
  return lno;
}


x86 assembly (clang, -O0):
<extractLineNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     116c <extractLineNum+0x4c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    114b <extractLineNum+0x2b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractLineNum>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x20,-0x2(%rbx)
lea    -0x1(%rbx),%rbx
jne    1140 <extractLineNum+0x20>
mov    %rbx,%rdi
call   1040 <atoi@plt>
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @extractLineNum(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %4, %1 ], [ %7, %5 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = tail call i32 @atoi(i8* %6)
store i8 0, i8* %6
ret i32 %11
}
/* Variables and functions */
int write(int, char const *, unsigned int);
int neio_write(int fd, const char *buf, unsigned int size) {
  int wd = write(fd, buf, size);
  return wd;
}


x86 assembly (clang, -O0):
<neio_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neio_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @neio_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, void *, size_t, int /*<<< orphan*/);
ssize_t mywrite_swift_fwd(int fd, void *buf, size_t len) {
  return send(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<mywrite_swift_fwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite_swift_fwd>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

LLVM IR (-O0):
define i32 @mywrite_swift_fwd(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @send(i32 %7, i8* %8, i64 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mywrite_swift_fwd(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_attr_getscope(int /*<<< orphan*/ *, int *);
int my_pthread_attr_getscope(pthread_attr_t const *__attr) {
  int scope;
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  pthread_attr_getscope(realattr, &scope);
  return scope;
}


x86 assembly (clang, -O0):
<my_pthread_attr_getscope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <pthread_attr_getscope@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_getscope>:
push   %rax
mov    (%rdi),%edi
lea    0x4(%rsp),%rsi
call   1030 <pthread_attr_getscope@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_pthread_attr_getscope(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_attr_getscope(i32* %9, i32* %3)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @my_pthread_attr_getscope(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = call i32 @pthread_attr_getscope(i32* %6, i32* %2)
%8 = load i32, i32* %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bdos_c_readstr(void) {
  fprintf(stderr, "BDOS C_READSTR not yet implemented\n");
}


x86 assembly (clang, -O0):
<bdos_c_readstr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdos_c_readstr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"BDOS C_READSTR not yet implemented\0A\00"
define void @bdos_c_readstr() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"BDOS C_READSTR not yet implemented\0A\00"
define void @bdos_c_readstr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_B2int16_mem(short *val) {
  return ((*val) & (-0xB2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B2int16_mem>:
movzwl (%rdi),%eax
test   $0xff4e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -178
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned height(unsigned i) { return 8 * sizeof(unsigned) - __builtin_clz(i); }


x86 assembly (clang, -O0):
<height>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
movslq %eax,%rcx
mov    $0x20,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<height>:
bsr    %edi,%eax
xor    $0xffffffe0,%eax
add    $0x21,%eax
ret

LLVM IR (-O0):
define i32 @height(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sext i32 %4 to i64
%6 = sub i64 32, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @height(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = sub nuw nsw i32 32, %2
ret i32 %3
}
int function() { return 20; }


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

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

LLVM IR (-O0):
define i32 @function() {
ret i32 20
}

LLVM IR (-O2):
define i32 @function() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strcmp(char *, char *);
void strcmp_diff_length_2() {
  char *x = "12345";
  char *y = "123";
  clang_analyzer_eval(strcmp(x, y) == 1);
}


x86 assembly (clang, -O0):
<strcmp_diff_length_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_diff_length_2>:
mov    $0x1,%edi
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"123\00"
define void @strcmp_diff_length_2() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 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 @strcmp(i8* %3, i8* %4)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
define void @strcmp_diff_length_2() {
%1 = tail call i32 @clang_analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void printNewline() {
  printf("\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<printNewline>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNewline>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @printNewline() {
%1 = tail call i32 @putchar(i32 10)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ swap;

/* Variables and functions */
uint64_t turbo_bswap_u64(uint64_t swap) {
  uint64_t swapped;
  swapped =
      ((uint64_t)((((uint64_t)(swap) & (uint64_t)0x00000000000000ff) << 56) |
                  (((uint64_t)(swap) & (uint64_t)0x000000000000ff00) << 40) |
                  (((uint64_t)(swap) & (uint64_t)0x0000000000ff0000) << 24) |
                  (((uint64_t)(swap) & (uint64_t)0x00000000ff000000) << 8) |
                  (((uint64_t)(swap) & (uint64_t)0x000000ff00000000) >> 8) |
                  (((uint64_t)(swap) & (uint64_t)0x0000ff0000000000) >> 24) |
                  (((uint64_t)(swap) & (uint64_t)0x00ff000000000000) >> 40) |
                  (((uint64_t)(swap) & (uint64_t)0xff00000000000000) >> 56)));
  return swapped;
}


x86 assembly (clang, -O0):
<turbo_bswap_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x38,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @turbo_bswap_u64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = shl i32 %5, 56
%7 = load i32, i32* %2
%8 = and i32 %7, 65280
%9 = shl i32 %8, 40
%10 = or i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 16711680
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, -16777216
%17 = shl i32 %16, 8
%18 = or i32 %14, %17
%19 = load i32, i32* %2
%20 = and i32 %19, 0
%21 = ashr i32 %20, 8
%22 = or i32 %18, %21
%23 = load i32, i32* %2
%24 = and i32 %23, 0
%25 = ashr i32 %24, 24
%26 = or i32 %22, %25
%27 = load i32, i32* %2
%28 = and i32 %27, 0
%29 = ashr i32 %28, 40
%30 = or i32 %26, %29
%31 = load i32, i32* %2
%32 = and i32 %31, 0
%33 = ashr i32 %32, 56
%34 = or i32 %30, %33
store i32 %34, i32* %3
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @turbo_bswap_u64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ mostraplinha(char);
int /*<<< orphan*/ sprintf(char, char *);
void frasequatro(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "4: Cafe Expresso");
  mostraplinha(plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<frasequatro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1040 <sprintf@plt>
movsbl -0x1(%rbp),%edi
call   1050 <mostraplinha@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frasequatro>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1040 <sprintf@plt>
mov    %ebp,%edi
call   1050 <mostraplinha@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"4: Cafe Expresso\00"
define void @frasequatro(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @mostraplinha(i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"4: Cafe Expresso\00"
define void @frasequatro(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mostraplinha(i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Variables and functions */
size_t Maxsz(size_t a, size_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<Maxsz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <Maxsz+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <Maxsz+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maxsz>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @Maxsz(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @Maxsz(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void hea_cq_aer_eq_format_err_reset(__u64 *aer) {
  *aer = hea_set_u64_bits(*aer, 0, 10, 50);
}


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

x86 assembly (clang, -O2):
<hea_cq_aer_eq_format_err_reset>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x32,%ecx
call   1030 <hea_set_u64_bits@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @hea_cq_aer_eq_format_err_reset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_set_u64_bits(i32 %4, i32 0, i32 10, i32 50)
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @hea_cq_aer_eq_format_err_reset(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_set_u64_bits(i32 %2, i32 0, i32 10, i32 50)
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRF5_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRF5_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRF5_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set(int **, int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 1, b = 2, *p;
  if (a > b) {
    set(&p, &b);
    *p = 3;
  } else {
    set(&p, &a);
    *p = 4;
  }
  test_assert(a == 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1165 <main+0x45>
lea    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <set@plt>
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
jmp    117c <main+0x5c>
lea    -0x18(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <set@plt>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x1,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <set@plt>
mov    0x10(%rsp),%rax
movl   $0x4,(%rax)
xor    %edi,%edi
cmpl   $0x4,0xc(%rsp)
sete   %dil
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32** %2 to i8*
%5 = call i32 @set(i32** %2, i32* %1)
%6 = load i32*, i32** %2
store i32 4, i32* %6
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 4
%9 = zext i1 %8 to i32
%10 = call i32 @test_assert(i32 %9)
ret i32 0
}
int blargg_max(int x, int y) {
  if (x < y)
    x = y;
  return x;
}


x86 assembly (clang, -O0):
<blargg_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    111c <blargg_max+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @blargg_max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @blargg_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char coisas[] = "adwdadw";
  printf("Coisas random %s.\n", coisas);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x77646164776461,%rax
mov    %rax,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.coisas = [8 x i8] c"adwdadw\00"
@.str = [19 x i8] c"Coisas random %s.\0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = bitcast [8 x i8]* %1 to i8*
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Coisas random %s.\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 33605891688719457, i64* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int g() {
  void f();
  g();
  return 0;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
call   1030 <g@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g() {
%1 = call i32 @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @g() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  func();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <func@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @func()
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func()
ret i32 0
}
/* Variables and functions */
size_t hash(size_t key, size_t p1, size_t p2) { return key * p1 + p2; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
imul   %rsi,%rdi
lea    (%rdi,%rdx,1),%rax
ret

LLVM IR (-O0):
define i64 @hash(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul i64 %7, %8
%10 = load i64, i64* %6
%11 = add i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @hash(i64 %0, i64 %1, i64 %2) {
%4 = mul i64 %1, %0
%5 = add i64 %4, %2
ret i64 %5
}
void VL_NULL_RefreshPaletteAndBorderColor(void *screen) {}


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

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

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

LLVM IR (-O2):
define void @VL_NULL_RefreshPaletteAndBorderColor(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ stderr;
void handleErrors(void) {
  ERR_print_errors_fp(stderr);
  abort();
}


x86 assembly (clang, -O0):
<handleErrors>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<handleErrors>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @handleErrors() {
%1 = load i32, i32* @stderr
%2 = call i32 @ERR_print_errors_fp(i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @handleErrors() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @ERR_print_errors_fp(i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int dal_reg_write(unsigned int, unsigned int, unsigned int);
int egress_reg_set(unsigned int dev_id, unsigned int reg_addr,
                   unsigned int value) {
  return dal_reg_write(dev_id, reg_addr + 0x0, value);
}


x86 assembly (clang, -O0):
<egress_reg_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x0,%esi
mov    -0xc(%rbp),%edx
call   1030 <dal_reg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<egress_reg_set>:
jmp    1030 <dal_reg_write@plt>

LLVM IR (-O0):
define i32 @egress_reg_set(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 = add i32 %8, 0
%10 = load i32, i32* %6
%11 = call i32 @dal_reg_write(i32 %7, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @egress_reg_set(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @dal_reg_write(i32 %0, i32 %1, i32 %2)
ret i32 %4
}