xunge/DecIR huggingface dataset:
struct device_driver *get_driver(struct device_driver *drv) {
  struct device_driver *a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.device_driver = type opaque
define %struct.device_driver* @get_driver(%struct.device_driver* %0) {
%2 = alloca %struct.device_driver*
%3 = alloca %struct.device_driver*
store %struct.device_driver* %0, %struct.device_driver** %2
%4 = load %struct.device_driver*, %struct.device_driver** %3
ret %struct.device_driver* %4
}

LLVM IR (-O2):
%struct.device_driver = type opaque
define noalias %struct.device_driver* @get_driver(%struct.device_driver* nocapture readnone %0) {
ret %struct.device_driver* undef
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void nrt_internal_dtor_safe(void *ptr, size_t size, void *info) {
  ;
  memset(ptr, 0xDE, ((size) < (256)) ? (size) : (256));
}


x86 assembly (clang, -O0):
<nrt_internal_dtor_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x100,-0x10(%rbp)
jae    1147 <nrt_internal_dtor_safe+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1155 <nrt_internal_dtor_safe+0x45>
mov    $0x100,%eax
mov    %rax,-0x28(%rbp)
jmp    1155 <nrt_internal_dtor_safe+0x45>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0xde,%esi
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrt_internal_dtor_safe>:
cmp    $0x100,%rsi
mov    $0x100,%edx
cmovb  %rsi,%rdx
mov    $0xde,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @nrt_internal_dtor_safe(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = icmp ult i64 %8, 256
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %13
12: ; preds = %3
br label %13
13: ; preds = %12, %10
%14 = phi i64 [ %11, %10 ], [ 256, %12 ]
%15 = call i32 @memset(i8* %7, i32 222, i64 %14)
ret void
}

LLVM IR (-O2):
define void @nrt_internal_dtor_safe(i8* %0, i64 %1, i8* nocapture readnone %2) {
%4 = icmp ult i64 %1, 256
%5 = select i1 %4, i64 %1, i64 256
%6 = tail call i32 @memset(i8* %0, i32 222, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void send_command(char *cmd, char *recvBuf, int *recvSize) {
  fprintf(stderr, "Send command %s\n", cmd);
}


x86 assembly (clang, -O0):
<send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_command>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Send command %s\0A\00"
define void @send_command(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Send command %s\0A\00"
define void @send_command(i8* %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void main() {
  char letra = 'a';
  char vetor[] = "a";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movb   $0x61,-0x1(%rbp)
mov    0xef1(%rip),%ax
mov    %ax,-0x3(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.vetor = [2 x i8] c"a\00"
define void @main() {
%1 = alloca i8
%2 = alloca [2 x i8]
store i8 97, i8* %1
%3 = bitcast [2 x i8]* %2 to i8*
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ free(struct iovmsg *);
void iovmsg_free(struct iovmsg *m) { free(m); }


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

x86 assembly (clang, -O2):
<iovmsg_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.iovmsg = type { i32 }
define void @iovmsg_free(%struct.iovmsg* %0) {
%2 = alloca %struct.iovmsg*
store %struct.iovmsg* %0, %struct.iovmsg** %2
%3 = load %struct.iovmsg*, %struct.iovmsg** %2
%4 = call i32 @free(%struct.iovmsg* %3)
ret void
}

LLVM IR (-O2):
%struct.iovmsg = type { i32 }
define void @iovmsg_free(%struct.iovmsg* nocapture %0) {
%2 = tail call i32 @free(%struct.iovmsg* %0)
ret void
}
void foo_2_2_1_2_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_2_2_2_2_1() {
ret void
}
char *file_extension(char *file) {
  char *r = "";
  while (*file)
    if (*file++ == '.')
      r = file;
  return r;
}


x86 assembly (clang, -O0):
<file_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <file_extension+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1143 <file_extension+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1113 <file_extension+0x13>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_extension>:
mov    (%rdi),%cl
test   %cl,%cl
je     1133 <file_extension+0x33>
add    $0x1,%rdi
lea    0xeef(%rip),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x2e,%cl
cmove  %rdi,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <file_extension+0x20>
ret
lea    0xec6(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @file_extension(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 46
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() { printf("\nUsage:\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"\0AUsage:\00"
define i32 @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int mapThreadErrorCode(int /*<<< orphan*/);
int /*<<< orphan*/ sched_yield();
int WXThread_Yield() { return mapThreadErrorCode(sched_yield()); }


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

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

LLVM IR (-O0):
define i32 @WXThread_Yield() {
%1 = call i32 (...) @sched_yield()
%2 = call i32 @mapThreadErrorCode(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @WXThread_Yield() {
%1 = tail call i32 (...) @sched_yield()
%2 = tail call i32 @mapThreadErrorCode(i32 %1)
ret i32 %2
}
int filter(char *prefix, char extension) { return ('b' != extension); }


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x62,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
xor    %eax,%eax
cmp    $0x62,%sil
setne  %al
ret

LLVM IR (-O0):
define i32 @filter(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 98, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @filter(i8* nocapture readnone %0, i8 signext %1) {
%3 = icmp ne i8 %1, 98
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) { fprintf(stderr, "Usage: [-i | -d] file\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: [-i | -d] file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: [-i | -d] file\0A\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
int strlen(char *);
int httpreq_copy_header(char *dest, char *src, size_t size) {
  memset(dest, '\0', size);
  memcpy(dest, &(src[0]), size - 1);
  return strlen(dest);
}


x86 assembly (clang, -O0):
<httpreq_copy_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpreq_copy_header>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %esi,%esi
call   1040 <memset@plt>
add    $0xffffffffffffffff,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <memcpy@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @httpreq_copy_header(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = call i32 @memset(i8* %7, i8 signext 0, i64 %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i64, i64* %6
%14 = sub i64 %13, 1
%15 = call i32 @memcpy(i8* %10, i8* %12, i64 %14)
%16 = load i8*, i8** %4
%17 = call i32 @strlen(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @httpreq_copy_header(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext 0, i64 %2)
%5 = add i64 %2, -1
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %5)
%7 = tail call i32 @strlen(i8* %0)
ret i32 %7
}
int countColon(const char *optstr) {
  int i = 0;
  while (optstr[i] == ':')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<countColon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1132 <countColon+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <countColon+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countColon>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x3a,(%rdi)
lea    0x1(%rdi),%rdi
je     1110 <countColon+0x10>
ret

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

LLVM IR (-O2):
define i32 @countColon(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 58
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_immediate(int);
int /*<<< orphan*/ output_with_tab(char *);
void add_offset(int val) {
  output_with_tab("addd ");
  output_immediate(val);
  newline();
}


x86 assembly (clang, -O0):
<add_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1050 <output_immediate@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_offset>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    %ebx,%edi
call   1050 <output_immediate@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"addd \00"
define void @add_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @output_immediate(i32 %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"addd \00"
define void @add_offset(i32 %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_immediate(i32 %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
void b() { f(); }


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

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

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

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int printResult(int n, int *data) {
  for (int i = 0; i < n; ++i) {
    printf("%d ", data[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<printResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1159 <printResult+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <printResult+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printResult>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1157 <printResult+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printResult+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @printResult(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret i32 0
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
void sys_do_open_midi(int nmidiin, int *midiinvec, int nmidiout,
                      int *midioutvec) {}


x86 assembly (clang, -O0):
<sys_do_open_midi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @sys_do_open_midi(i32 %0, i32* nocapture %1, i32 %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
size_t strlen(char const *);
size_t __argz_count(const char *argz, size_t len) {
  size_t count = 0;
  while (len > 0) {
    size_t part_len = strlen(argz);
    argz += part_len + 1;
    len -= part_len + 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<__argz_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1174 <__argz_count+0x64>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <__argz_count+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__argz_count>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     114e <__argz_count+0x3e>
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rax,%rbx
add    $0x1,%rbx
add    $0x1,%rax
add    $0x1,%r14
sub    %rax,%r15
jne    1130 <__argz_count+0x20>
jmp    1151 <__argz_count+0x41>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @__argz_count(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i64 [ %12, %4 ], [ 0, %2 ]
%7 = phi i64 [ %11, %4 ], [ %1, %2 ]
%8 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%9 = add i64 %8, 1
%10 = getelementptr inbounds i8, i8* %5, i64 %9
%11 = sub i64 %7, %9
%12 = add i64 %6, 1
%13 = icmp eq i64 %11, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i64 [ 0, %2 ], [ %12, %4 ]
ret i64 %15
}
int printHelloWorld(double routebaga, char turnip) { return 42536475; }


x86 assembly (clang, -O0):
<printHelloWorld>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
movsd  %xmm0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x2890e1b,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @printHelloWorld(double %0, i8 signext %1) {
ret i32 42536475
}
int f(int x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct ofpbuf {
  int dummy;
};

/* Variables and functions */
struct ofpbuf *ofpbuf_new(size_t);
int /*<<< orphan*/ ofpbuf_reserve(struct ofpbuf *, size_t);
struct ofpbuf *ofpbuf_new_with_headroom(size_t size, size_t headroom) {
  struct ofpbuf *b = ofpbuf_new(size + headroom);
  ofpbuf_reserve(b, headroom);
  return b;
}


x86 assembly (clang, -O0):
<ofpbuf_new_with_headroom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
call   1030 <ofpbuf_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ofpbuf_reserve@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofpbuf_new_with_headroom>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
add    %rsi,%rdi
call   1030 <ofpbuf_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <ofpbuf_reserve@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ofpbuf = type { i32 }
define %struct.ofpbuf* @ofpbuf_new_with_headroom(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca %struct.ofpbuf*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
%9 = call %struct.ofpbuf* @ofpbuf_new(i64 %8)
store %struct.ofpbuf* %9, %struct.ofpbuf** %5
%10 = load %struct.ofpbuf*, %struct.ofpbuf** %5
%11 = load i64, i64* %4
%12 = call i32 @ofpbuf_reserve(%struct.ofpbuf* %10, i64 %11)
%13 = load %struct.ofpbuf*, %struct.ofpbuf** %5
ret %struct.ofpbuf* %13
}

LLVM IR (-O2):
%struct.ofpbuf = type { i32 }
define %struct.ofpbuf* @ofpbuf_new_with_headroom(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = tail call %struct.ofpbuf* @ofpbuf_new(i64 %3)
%5 = tail call i32 @ofpbuf_reserve(%struct.ofpbuf* %4, i64 %1)
ret %struct.ofpbuf* %4
}
void mmcau_md5_initialize_output(unsigned int md_state[]) {
  md_state[0] = 0x67452301;
  md_state[1] = 0xefcdab89;
  md_state[2] = 0x98badcfe;
  md_state[3] = 0x10325476;
}


x86 assembly (clang, -O0):
<mmcau_md5_initialize_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x67452301,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xefcdab89,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x98badcfe,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x10325476,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcau_md5_initialize_output>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @mmcau_md5_initialize_output(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1732584193, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 -271733879, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 -1732584194, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32 271733878, i32* %10
ret void
}

LLVM IR (-O2):
define void @mmcau_md5_initialize_output(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1732584193, i32 -271733879, i32 -1732584194, i32 271733878>, <4 x i32>* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ global3();
void foo12() { global3(); }


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

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

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

LLVM IR (-O2):
define void @foo12() {
%1 = tail call i32 (...) @global3()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
scalar_t__ getcwd(char *, int);
char *short_filename_cwd(char const *, char *);
char *xstrdup(char const *);
char *short_filename(const char *absolute) {
  char cwd[8192];
  if (getcwd(cwd, sizeof(cwd)))
    return short_filename_cwd(absolute, cwd);
  return xstrdup(absolute);
}


x86 assembly (clang, -O0):
<short_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2010,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x2010(%rbp),%rdi
mov    $0x2000,%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
je     1173 <short_filename+0x43>
mov    -0x10(%rbp),%rdi
lea    -0x2010(%rbp),%rsi
call   1030 <short_filename_cwd@plt>
mov    %rax,-0x8(%rbp)
jmp    1180 <short_filename+0x50>
mov    -0x10(%rbp),%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_filename>:
push   %rbx
sub    $0x2000,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x2000,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     115a <short_filename+0x2a>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <short_filename_cwd@plt>
jmp    1162 <short_filename+0x32>
mov    %rbx,%rdi
call   1050 <xstrdup@plt>
add    $0x2000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @short_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [8192 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%6 = call i64 @getcwd(i8* %5, i32 8192)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%11 = call i8* @short_filename_cwd(i8* %9, i8* %10)
store i8* %11, i8** %2
br label %15
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i8* @xstrdup(i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @short_filename(i8* %0) {
%2 = alloca [8192 x i8]
%3 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%4 = call i64 @getcwd(i8* %3, i32 8192)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i8* @short_filename_cwd(i8* %0, i8* %3)
br label %10
8: ; preds = %1
%9 = call i8* @xstrdup(i8* %0)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void other(void) { puts("You entered something other than 1 or 2."); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"You entered something other than 1 or 2.\00"
define void @other() {
%1 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"You entered something other than 1 or 2.\00"
define void @other() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ changespidirection(int);
void initspi() {
  changespidirection(false);
  (*(volatile uint8_t *)((0x500A + 2))) |= (1 << 5) | (1 << 4);
  (*(volatile uint8_t *)((0x500A))) &= ~((1 << 5) | (1 << 4));
}


x86 assembly (clang, -O0):
<initspi>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <changespidirection@plt>
mov    $0x500c,%eax
mov    (%rax),%ecx
or     $0x30,%ecx
mov    $0x500c,%eax
mov    %ecx,(%rax)
mov    $0x500a,%eax
mov    (%rax),%ecx
and    $0xffffffcf,%ecx
mov    $0x500a,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initspi>:
push   %rax
xor    %edi,%edi
call   1030 <changespidirection@plt>
orl    $0x30,0x500c
30
andl   $0xffffffcf,0x500a
cf
pop    %rax
ret

LLVM IR (-O0):
define void @initspi() {
%1 = call i32 @changespidirection(i32 0)
%2 = load volatile i32, i32* inttoptr (i64 20492 to i32*)
%3 = or i32 %2, 48
store volatile i32 %3, i32* inttoptr (i64 20492 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 20490 to i32*)
%5 = and i32 %4, -49
store volatile i32 %5, i32* inttoptr (i64 20490 to i32*)
ret void
}

LLVM IR (-O2):
define void @initspi() {
%1 = tail call i32 @changespidirection(i32 0)
%2 = load volatile i32, i32* inttoptr (i64 20492 to i32*)
%3 = or i32 %2, 48
store volatile i32 %3, i32* inttoptr (i64 20492 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 20490 to i32*)
%5 = and i32 %4, -49
store volatile i32 %5, i32* inttoptr (i64 20490 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  (void)free(*ap);
  *ap = NULL;
  return;
}


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

x86 assembly (clang, -O2):
<ft_memdel>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_memdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @ft_memdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
long power(int base, int exponent) {
  long int result, pow;
  int i = 0;
  result = 1L;
  pow = base;
  for (i = exponent; i > 0; i = i / 2) {
    if (i % 2 == 1)
      result = result * pow;
    pow = pow * pow;
  }
  return result;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x1,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1172 <power+0x72>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1152 <power+0x52>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
jmp    1127 <power+0x27>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
jle    113d <power+0x3d>
movslq %edi,%rdx
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   $0x1,%sil
mov    %rdx,%rcx
cmove  %r8,%rcx
imul   %rcx,%rax
imul   %rdx,%rdx
shr    %edi
cmp    $0x1,%esi
mov    %edi,%esi
ja     1120 <power+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @power(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %7
store i64 1, i64* %5
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
store i64 %9, i64* %6
%10 = load i32, i32* %4
store i32 %10, i32* %7
br label %11
11: ; preds = %26, %2
%12 = load i32, i32* %7
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %29
14: ; preds = %11
%15 = load i32, i32* %7
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i64, i64* %5
%20 = load i64, i64* %6
%21 = mul nsw i64 %19, %20
store i64 %21, i64* %5
br label %22
22: ; preds = %18, %14
%23 = load i64, i64* %6
%24 = load i64, i64* %6
%25 = mul nsw i64 %23, %24
store i64 %25, i64* %6
br label %26
26: ; preds = %22
%27 = load i32, i32* %7
%28 = sdiv i32 %27, 2
store i32 %28, i32* %7
br label %11
29: ; preds = %11
%30 = load i64, i64* %5
ret i64 %30
}

LLVM IR (-O2):
define i64 @power(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = sext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %15, %6 ], [ %1, %4 ]
%8 = phi i64 [ %14, %6 ], [ %5, %4 ]
%9 = phi i64 [ %13, %6 ], [ 1, %4 ]
%10 = and i32 %7, 1
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i64 1, i64 %8
%13 = mul nsw i64 %12, %9
%14 = mul nsw i64 %8, %8
%15 = lshr i32 %7, 1
%16 = icmp ult i32 %7, 2
br i1 %16, label %17, label %6
17: ; preds = %6, %2
%18 = phi i64 [ 1, %2 ], [ %13, %6 ]
ret i64 %18
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int bt_sys_read(int, char *, int);
int _read_r(struct _reent *r, int file, char *ptr, int len) {
  return bt_sys_read(file, ptr, len);
}


x86 assembly (clang, -O0):
<_read_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <bt_sys_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read_r>:
mov    %esi,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <bt_sys_read@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i32 @_read_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @bt_sys_read(i32 %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_read_r(%struct._reent* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @bt_sys_read(i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__0__Irq__default__fired();
void HplAtm128InterruptPinP__0__Irq__fired(void) {
  HplAtm128InterruptPinP__0__Irq__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128InterruptPinP__0__Irq__fired() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__0__Irq__default__fired()
ret void
}
/* Variables and functions */
unsigned char toupper(unsigned char);
void to_upper(char *s) {
  unsigned char *b;
  for (b = (unsigned char *)s; (*b = toupper(*b)); b++)
    ;
}


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1154 <to_upper+0x44>
jmp    1143 <to_upper+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <to_upper+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <to_upper+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @to_upper(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %12, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call zeroext i8 @toupper(i8 zeroext %7)
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = icmp ne i8 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %5
br label %12
12: ; preds = %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @to_upper(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call zeroext i8 @toupper(i8 zeroext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compareString(const void *data1, const void *data2) {
  return strcmp((char *)data1, (char *)data2);
}


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

x86 assembly (clang, -O2):
<compareString>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compareString(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @compareString(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int result;
  while ((result = getchar()) != EOF)
    printf("%d\n", result);
  printf("EOF is '%d'\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     115c <main+0x3c>
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"EOF is '%d'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [13 x i8] c"EOF is '%d'\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi i32 [ %1, %0 ], [ %7, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void formatWriteString(char *output, char *command, char *action) {
  strcpy(output, command);
  strcat(output, "\x001F");
  strcat(output, action);
  strcat(output, "\x001E");
}


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

x86 assembly (clang, -O2):
<formatWriteString>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcpy@plt>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\1F\00"
@.str.1 = [2 x i8] c"\1E\00"
define void @formatWriteString(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %4
%13 = load i8*, i8** %6
%14 = call i32 @strcat(i8* %12, i8* %13)
%15 = load i8*, i8** %4
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\1F\00"
@.str.1 = [2 x i8] c"\1E\00"
define void @formatWriteString(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %0, i8* %2)
%7 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_4Auint16_reg(unsigned short val) {
  return ((val) & (-0x4A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffb6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Auint16_reg>:
test   $0xffb6,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -74
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int always(int i) { return i % 2 == (i + 2) % 2; }


x86 assembly (clang, -O0):
<always>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x8(%rbp),%edx
cmp    %eax,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<always>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%ecx
add    $0x2,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
add    $0x2,%ecx
and    $0xfffffffe,%ecx
neg    %ecx
add    %edi,%ecx
add    $0x2,%ecx
mov    %edi,%edx
sub    %eax,%edx
xor    %eax,%eax
cmp    %ecx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @always(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 2
%7 = srem i32 %6, 2
%8 = icmp eq i32 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @always(i32 %0) {
%2 = srem i32 %0, 2
%3 = add nsw i32 %0, 2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}