xunge/DecIR huggingface dataset:
int my_strcmp(char *str1, char *str2) {
  while (*str1 == *str2) {
    if (*str1 == '\0')
      return (0);
    ++str1;
    ++str2;
  }
  return (*str1 - *str2);
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <my_strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <my_strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <my_strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <my_strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <my_strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <my_strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
int handle_request(char *request, char *response) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @handle_request(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void *deref_default(void **ptr, void *when_default) {
  return (((ptr)) ? (*(ptr)) : (when_default));
}


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

x86 assembly (clang, -O2):
<deref_default>:
mov    %rsi,%rax
test   %rdi,%rdi
je     110b <deref_default+0xb>
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i8* @deref_default(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
br label %12
10: ; preds = %2
%11 = load i8*, i8** %4
br label %12
12: ; preds = %10, %7
%13 = phi i8* [ %9, %7 ], [ %11, %10 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @deref_default(i8** %0, i8* readnone %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ %1, %2 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int execve(char *name, char **argv, char **env) { svcPanic(); }


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @svcPanic()
ret i32 undef
}
void phys_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @phys_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ moveX(int);
int step() {
  moveX(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<step>:
push   %rax
mov    $0x1,%edi
call   1030 <moveX@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @step() {
%1 = tail call i32 @moveX(i32 1)
ret i32 0
}
int support_fpu_rounding_mode(int mode __attribute__((unused))) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @support_fpu_rounding_mode(i32 %0) {
ret i32 1
}
/* Variables and functions */
long GetMouseAbsY287();
long getmouseabsy() { return GetMouseAbsY287(); }


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

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

LLVM IR (-O0):
define i64 @getmouseabsy() {
%1 = call i64 (...) @GetMouseAbsY287()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getmouseabsy() {
%1 = tail call i64 (...) @GetMouseAbsY287()
ret i64 %1
}
/* Variables and functions */
scalar_t__ llib_str_str(char *, char *);
unsigned char *zstr(void *a, void *b) {
  return (unsigned char *)llib_str_str((char *)a, (char *)b);
}


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

x86 assembly (clang, -O2):
<zstr>:
jmp    1030 <llib_str_str@plt>

LLVM IR (-O0):
define i8* @zstr(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 i64 @llib_str_str(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @zstr(i8* %0, i8* %1) {
%3 = tail call i64 @llib_str_str(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void addReplyBulkCBuffer(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               19, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<addReplyBulkCBuffer>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x13,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addReplyBulkCBuffer>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x13,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyBulkCBuffer = [20 x i8] c"addReplyBulkCBuffer\00"
define void @addReplyBulkCBuffer() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.addReplyBulkCBuffer, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyBulkCBuffer = [20 x i8] c"addReplyBulkCBuffer\00"
define void @addReplyBulkCBuffer() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.addReplyBulkCBuffer, i64 0, i64 0))
ret void
}
int test_search_function(void) {}


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

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

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

LLVM IR (-O2):
define i32 @test_search_function() {
ret i32 undef
}
/* Type definitions */
typedef int __u8;

/* Variables and functions */
int INET_ECN_is_capable(__u8 dsfield) { return (dsfield & 2); }


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

x86 assembly (clang, -O2):
<INET_ECN_is_capable>:
mov    %edi,%eax
and    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @INET_ECN_is_capable(i32 %0) {
%2 = and i32 %0, 2
ret i32 %2
}
void hf_print_error(char *errstring) {}


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

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

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

LLVM IR (-O2):
define void @hf_print_error(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ translit_text(char *, int, char, char);
void nul_to_newline(char *s, int len) { translit_text(s, len, '\0', '\n'); }


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

x86 assembly (clang, -O2):
<nul_to_newline>:
xor    %edx,%edx
mov    $0xa,%ecx
jmp    1030 <translit_text@plt>

LLVM IR (-O0):
define void @nul_to_newline(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 @translit_text(i8* %5, i32 %6, i8 signext 0, i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @nul_to_newline(i8* %0, i32 %1) {
%3 = tail call i32 @translit_text(i8* %0, i32 %1, i8 signext 0, i8 signext 10)
ret void
}
void csmith_compute_hash(void) {}


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

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

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

LLVM IR (-O2):
define void @csmith_compute_hash() {
ret void
}
int((opt_backward_call_ind_receive))(struct ss7 *ss7, struct isup_call *c,
                                     int messagetype, unsigned char *parm,
                                     int len) {
  return 1;
}


x86 assembly (clang, -O0):
<opt_backward_call_ind_receive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @opt_backward_call_ind_receive(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 1
}

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

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void send_fd(FILE *f, FILE *fd) {
  int num_chars = 0;
  char c;
  while (1) {
    c = fgetc(f);
    if (feof(f))
      return;
    fputc(c, fd);
  }
}


x86 assembly (clang, -O0):
<send_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%rax
je     116c <send_fd+0x3c>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x15(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
jmp    1147 <send_fd+0x17>

x86 assembly (clang, -O2):
<send_fd>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
call   1030 <fgetc@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1050 <feof@plt>
test   %rax,%rax
jne    1164 <send_fd+0x34>
movsbl %bl,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %r15,%rdi
jmp    1140 <send_fd+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @send_fd(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %7
7: ; preds = %2, %14
%8 = load i32*, i32** %3
%9 = call signext i8 @fgetc(i32* %8)
store i8 %9, i8* %6
%10 = load i32*, i32** %3
%11 = call i64 @feof(i32* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %7
ret void
14: ; preds = %7
%15 = load i8, i8* %6
%16 = load i32*, i32** %4
%17 = call i32 @fputc(i8 signext %15, i32* %16)
br label %7
}

LLVM IR (-O2):
define void @send_fd(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call signext i8 @fgetc(i32* %0)
%4 = tail call i64 @feof(i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %7, %2
ret void
7: ; preds = %2, %7
%8 = phi i8 [ %10, %7 ], [ %3, %2 ]
%9 = tail call i32 @fputc(i8 signext %8, i32* %1)
%10 = tail call signext i8 @fgetc(i32* %0)
%11 = tail call i64 @feof(i32* %0)
%12 = icmp eq i64 %11, 0
br i1 %12, label %7, label %6
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_GETFPREGS;
int errno;
scalar_t__ ptrace(int /*<<< orphan*/, long, int /*<<< orphan*/,
                  unsigned long *);
int ptrace_getfpregs(long pid, unsigned long *regs) {
  if (ptrace(PTRACE_GETFPREGS, pid, 0, regs) < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_getfpregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
xor    %edx,%edx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    1155 <ptrace_getfpregs+0x45>
xor    %eax,%eax
mov    0x2e8d(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <ptrace_getfpregs+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_getfpregs>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <ptrace@plt>
mov    0x2ea8(%rip),%rcx
sub    (%rcx),%ebx
sar    $0x3f,%rax
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PTRACE_GETFPREGS = global i32 0
@errno = global i32 0
define i32 @ptrace_getfpregs(i64 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i32, i32* @PTRACE_GETFPREGS
%7 = load i64, i64* %4
%8 = load i64*, i64** %5
%9 = call i64 @ptrace(i32 %6, i64 %7, i32 0, i64* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@PTRACE_GETFPREGS = global i32 0
@errno = global i32 0
define i32 @ptrace_getfpregs(i64 %0, i64* %1) {
%3 = load i32, i32* @PTRACE_GETFPREGS
%4 = tail call i64 @ptrace(i32 %3, i64 %0, i32 0, i64* %1)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
double sFibonacci_rec(double f) {
  if (f == 0)
    return 0;
  else if (f == 1)
    return 1;
  else
    return sFibonacci_rec(f - 1) + sFibonacci_rec(f - 2);
}


x86 assembly (clang, -O0):
<sFibonacci_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1142 <sFibonacci_rec+0x32>
jp     1142 <sFibonacci_rec+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b3 <sFibonacci_rec+0xa3>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1171 <sFibonacci_rec+0x61>
jp     1171 <sFibonacci_rec+0x61>
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b3 <sFibonacci_rec+0xa3>
movsd  -0x10(%rbp),%xmm0
movsd  0xe82(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <sFibonacci_rec@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe6f(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <sFibonacci_rec@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sFibonacci_rec>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1129 <sFibonacci_rec+0x19>
jp     1129 <sFibonacci_rec+0x19>
add    $0x18,%rsp
ret
movsd  0xecf(%rip),%xmm0
ucomisd %xmm0,%xmm1
jne    1139 <sFibonacci_rec+0x29>
jnp    1124 <sFibonacci_rec+0x14>
movsd  0xec7(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
call   1030 <sFibonacci_rec@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xeac(%rip),%xmm0
call   1030 <sFibonacci_rec@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sFibonacci_rec(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %19
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp oeq double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.000000e+00, double* %2
br label %19
11: ; preds = %7
%12 = load double, double* %3
%13 = fsub double %12, 1.000000e+00
%14 = call double @sFibonacci_rec(double %13)
%15 = load double, double* %3
%16 = fsub double %15, 2.000000e+00
%17 = call double @sFibonacci_rec(double %16)
%18 = fadd double %14, %17
store double %18, double* %2
br label %19
19: ; preds = %11, %10, %6
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @sFibonacci_rec(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fcmp oeq double %0, 1.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1, %3, %7
%6 = phi double [ %12, %7 ], [ 0.000000e+00, %1 ], [ 1.000000e+00, %3 ]
ret double %6
7: ; preds = %3
%8 = fadd double %0, -1.000000e+00
%9 = tail call double @sFibonacci_rec(double %8)
%10 = fadd double %0, -2.000000e+00
%11 = tail call double @sFibonacci_rec(double %10)
%12 = fadd double %9, %11
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *mb_ver_string(void) {
  static char buf[32] = {'\0'};
  if (!buf[0])
    sprintf(buf, "%d.%d.%04d", 1, 1, 54);
  return buf;
}


x86 assembly (clang, -O0):
<mb_ver_string>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f25(%rip)
jne    1141 <mb_ver_string+0x31>
lea    0x2f18(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x1,%ecx
mov    $0x36,%r8d
mov    %ecx,%edx
call   1030 <sprintf@plt>
lea    0x2ef8(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_ver_string>:
push   %rax
cmpb   $0x0,0x2f28(%rip)
jne    113d <mb_ver_string+0x2d>
lea    0x2f1f(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x36,%r8d
call   1030 <sprintf@plt>
lea    0x2efc(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@mb_ver_string.buf = internal global [32 x i8] zeroinitializer
@.str = [11 x i8] c"%d.%d.%04d\00"
define i8* @mb_ver_string() {
%1 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mb_ver_string.buf, i64 0, i64 0)
%2 = icmp ne i8 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mb_ver_string.buf, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 54)
br label %5
5: ; preds = %3, %0
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mb_ver_string.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@mb_ver_string.buf = internal global [32 x i8] zeroinitializer
@.str = [11 x i8] c"%d.%d.%04d\00"
define i8* @mb_ver_string() {
%1 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mb_ver_string.buf, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @mb_ver_string.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 54)
br label %5
5: ; preds = %3, %0
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @mb_ver_string.buf, i64 0, i64 0)
}
int f(int x) {
  if (x > 3) {
    ;
  } else {
    return 3;
    x = 12;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    1116 <f+0x16>
jmp    111d <f+0x1d>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 3
}
/* Variables and functions */
unsigned char comprlib_read_byte();
int comprlib_read_array(unsigned char *buff, int size) {
  int i;
  for (i = 0; i < size; i++) {
    buff[i] = comprlib_read_byte();
  }
  return (i);
}


x86 assembly (clang, -O0):
<comprlib_read_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <comprlib_read_array+0x44>
mov    $0x0,%al
call   1030 <comprlib_read_byte@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <comprlib_read_array+0x16>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comprlib_read_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <comprlib_read_array+0x36>
mov    %esi,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <comprlib_read_byte@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <comprlib_read_array+0x20>
jmp    1149 <comprlib_read_array+0x39>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @comprlib_read_array(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call zeroext i8 (...) @comprlib_read_byte()
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = phi i32 [ 0, %2 ], [ %1, %6 ]
ret i32 %13
}
void _unsupported() {
  asm("int $47;int $46" ::"a"("\nUnsupported operation"),
      "b"(sizeof("\nUnsupported operation") - 1));
}


x86 assembly (clang, -O0):
<_unsupported>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
lea    0xef4(%rip),%rax
mov    $0x16,%ebx
int    $0x2f
int    $0x2e
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unsupported>:
push   %rbx
lea    0xef8(%rip),%rax
mov    $0x16,%ebx
int    $0x2f
int    $0x2e
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0AUnsupported operation\00"
define void @_unsupported() {
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AUnsupported operation\00"
define void @_unsupported() {
tail call void asm sideeffect "int $$47;int $$46", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 22)
ret void
}
int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
                                      unsigned long),
                            void *data) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.module = type opaque
define i32 @kallsyms_on_each_symbol(i32 (i8*, i8*, %struct.module*, i64)* %0, i8* %1) {
%3 = alloca i32 (i8*, i8*, %struct.module*, i64)*
%4 = alloca i8*
store i32 (i8*, i8*, %struct.module*, i64)* %0, i32 (i8*, i8*, %struct.module*, i64)** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.module = type opaque
define i32 @kallsyms_on_each_symbol(i32 (i8*, i8*, %struct.module*, i64)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ Visual;
typedef int /*<<< orphan*/ Pixmap;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int alock_blur_pixmap(Display *display, Visual *visual, const Pixmap src_pm,
                      Pixmap dst_pm, unsigned char blur, int src_x, int src_y,
                      int dst_x, int dst_y, unsigned int width,
                      unsigned int height) {
  (void)display;
  (void)visual;
  return 0;
}


x86 assembly (clang, -O0):
<alock_blur_pixmap>:
push   %rbp
mov    %rsp,%rbp
mov    %r8b,%al
mov    0x30(%rbp),%r8d
mov    0x28(%rbp),%r8d
mov    0x20(%rbp),%r8d
mov    0x18(%rbp),%r8d
mov    0x10(%rbp),%r8d
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    %r9d,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @alock_blur_pixmap(i32* %0, i32* %1, i32 %2, i32 %3, i8 zeroext %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %12
store i32* %1, i32** %13
store i32 %2, i32* %14
store i32 %3, i32* %15
store i8 %4, i8* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32 %9, i32* %21
store i32 %10, i32* %22
%23 = load i32*, i32** %12
%24 = load i32*, i32** %13
ret i32 0
}

LLVM IR (-O2):
define i32 @alock_blur_pixmap(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3, i8 zeroext %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
ret i32 0
}
void gtk_text_attributes_copy_values() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_attributes_copy_values() {
ret void
}
void st_thread_cleanup(void) { return; }


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

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

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

LLVM IR (-O2):
define void @st_thread_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(void) {
  system(
      "java -Dsongscribe=sw -splash:images/swsplash.png -jar songscribe.jar");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"java -Dsongscribe=sw -splash:images/swsplash.png -jar songscribe.jar\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [69 x i8] c"java -Dsongscribe=sw -splash:images/swsplash.png -jar songscribe.jar\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *_create_string_node(const char *s, size_t s_len) {
  size_t num_blocks = (s_len + 1 - 1) / 8 + 1;
  char *sn = malloc(num_blocks * 8);
  memset(sn + (num_blocks - 1) * 8, 0, 8);
  memcpy(sn, s, s_len);
  return sn;
}


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

x86 assembly (clang, -O2):
<_create_string_node>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rbx
and    $0xfffffffffffffff8,%rbx
lea    0x8(%rsi),%rdi
and    $0xfffffffffffffff8,%rdi
call   1050 <malloc@plt>
mov    %rax,%r12
add    %rax,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_create_string_node(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = sub i64 %8, 1
%10 = udiv i64 %9, 8
%11 = add i64 %10, 1
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = mul i64 %12, 8
%14 = call i8* @malloc(i64 %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i64, i64* %5
%17 = sub i64 %16, 1
%18 = mul i64 %17, 8
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = call i32 @memset(i8* %19, i32 0, i32 8)
%21 = load i8*, i8** %6
%22 = load i8*, i8** %3
%23 = load i64, i64* %4
%24 = call i32 @memcpy(i8* %21, i8* %22, i64 %23)
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @_create_string_node(i8* %0, i64 %1) {
%3 = and i64 %1, -8
%4 = add i64 %1, 8
%5 = and i64 %4, -8
%6 = tail call i8* @malloc(i64 %5)
%7 = getelementptr inbounds i8, i8* %6, i64 %3
%8 = tail call i32 @memset(i8* %7, i32 0, i32 8)
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %1)
ret i8* %6
}
char itoc(int i) {
  char result;
  if (i < 10 && i >= 0) {
    result = '0' + i;
  } else if (i >= 10 && i < 16) {
    result = i - 10 + 'a';
  } else {
    result = '?';
  }
  return result;
}


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1129 <itoc+0x29>
cmpl   $0x0,-0x4(%rbp)
jl     1129 <itoc+0x29>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
jmp    1157 <itoc+0x57>
cmpl   $0xa,-0x4(%rbp)
jl     114e <itoc+0x4e>
cmpl   $0x10,-0x4(%rbp)
jge    114e <itoc+0x4e>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x5(%rbp)
jmp    1152 <itoc+0x52>
movb   $0x3f,-0x5(%rbp)
jmp    1157 <itoc+0x57>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
cmp    $0x9,%edi
ja     110b <itoc+0xb>
add    $0x30,%dil
jmp    1119 <itoc+0x19>
lea    -0xa(%rdi),%ecx
mov    $0x3f,%al
cmp    $0x5,%ecx
ja     111b <itoc+0x1b>
add    $0x57,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @itoc(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 48, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
br label %26
13: ; preds = %6, %1
%14 = load i32, i32* %2
%15 = icmp sge i32 %14, 10
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 16
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %2
%21 = sub nsw i32 %20, 10
%22 = add nsw i32 %21, 97
%23 = trunc i32 %22 to i8
store i8 %23, i8* %3
br label %25
24: ; preds = %16, %13
store i8 63, i8* %3
br label %25
25: ; preds = %24, %19
br label %26
26: ; preds = %25, %9
%27 = load i8, i8* %3
ret i8 %27
}

LLVM IR (-O2):
define signext i8 @itoc(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %12
6: ; preds = %1
%7 = add i32 %0, -10
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = trunc i32 %0 to i8
%11 = add nuw nsw i8 %10, 87
br label %12
12: ; preds = %6, %9, %3
%13 = phi i8 [ %5, %3 ], [ %11, %9 ], [ 63, %6 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int i;
  float floats[10] = {10.05f,  700.58f, 93.71f, 0.01f,  51.10f,
                      900.32f, 438.43f, 12.87f, 43.78f, 91.11f};
  float sum = 0;
  for (i = 0; i < 10; ++i) {
    sum += floats[i];
  }
  printf("The average of the 10 floats: %.2f\n", sum / 10.00);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    117f <main+0x5f>
movslq -0x8(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x33>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe70(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.floats = [10 x float] [float 0x40241999A0000000, float 0x4085E4A3E0000000, float 0x40576D70A0000000, float 0x3F847AE140000000, float 0x40498CCCC0000000, float 0x408C228F60000000, float 0x407B66E140000000, float 0x4029BD70A0000000, float 0x4045E3D700000000, float 0x4056C70A40000000]
@.str = [36 x i8] c"The average of the 10 floats: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x float]
%4 = alloca float
store i32 0, i32* %1
%5 = bitcast [10 x float]* %3 to i8*
store float 0.000000e+00, float* %4
store i32 0, i32* %2
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 %11
%13 = load float, float* %12
%14 = load float, float* %4
%15 = fadd float %14, %13
store float %15, float* %4
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %6
19: ; preds = %6
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = fdiv double %21, 1.000000e+01
%23 = fptrunc double %22 to float
%24 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), float %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The average of the 10 floats: %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), float 0x406D4645C0000000)
ret i32 0
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("pid %d\n", getpid());
  while (1) {
    printf("in loop\n");
    sleep(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1156 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea9(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [8 x i8] c"pid %d\0A\00"
@.str.1 = [9 x i8] c"in loop\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %4
4: ; preds = %0, %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @sleep(i32 2)
br label %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"pid %d\0A\00"
@str = [8 x i8] c"in loop\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %3
3: ; preds = %0, %3
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 2)
br label %3
}
/* Variables and functions */
int omap_rev();
int is_omap363x(void) {
  return (((omap_rev() >> 20) & 0x0fff) == (0x363)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap363x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x14,%edx
and    $0xfff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x363,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap363x>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xfff00000,%eax
xor    %ecx,%ecx
cmp    $0x36300000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap363x() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 20
%3 = and i32 %2, 4095
%4 = icmp eq i32 %3, 867
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap363x() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -1048576
%3 = icmp eq i32 %2, 909115392
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void fs_bit_array_destroy(unsigned char *p) {
  if (p)
    free(p);
}


x86 assembly (clang, -O0):
<fs_bit_array_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <fs_bit_array_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_bit_array_destroy>:
test   %rdi,%rdi
je     111a <fs_bit_array_destroy+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @fs_bit_array_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @fs_bit_array_destroy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dns;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char *);
const char *get_dns_server() {
  static char dns[32];
  memset(dns, 0, sizeof(dns));
  strcpy(dns, "192.168.1.1");
  return dns;
}


x86 assembly (clang, -O0):
<get_dns_server>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    0x2f02(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2eef(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dns_server>:
push   %rbx
lea    0x2f18(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_dns_server.dns = internal global [32 x i8] zeroinitializer
@.str = [12 x i8] c"192.168.1.1\00"
define i8* @get_dns_server() {
%1 = call i32 @memset(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_dns_server.dns, i64 0, i64 0), i32 0, i32 32)
%2 = call i32 @strcpy(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_dns_server.dns, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_dns_server.dns, i64 0, i64 0)
}

LLVM IR (-O2):
@get_dns_server.dns = internal global [32 x i8] zeroinitializer
@.str = [12 x i8] c"192.168.1.1\00"
define i8* @get_dns_server() {
%1 = tail call i32 @memset(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_dns_server.dns, i64 0, i64 0), i32 0, i32 32)
%2 = tail call i32 @strcpy(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_dns_server.dns, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_dns_server.dns, i64 0, i64 0)
}
/* Type definitions */
struct convey_ctx {
  int dummy;
};

/* Variables and functions */
struct convey_ctx *convey_tls_get();
struct convey_ctx *convey_get_ctx(void) {
  return (convey_tls_get());
}


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

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

LLVM IR (-O0):
%struct.convey_ctx = type { i32 }
define %struct.convey_ctx* @convey_get_ctx() {
%1 = call %struct.convey_ctx* (...) @convey_tls_get()
ret %struct.convey_ctx* %1
}

LLVM IR (-O2):
%struct.convey_ctx = type { i32 }
define %struct.convey_ctx* @convey_get_ctx() {
%1 = tail call %struct.convey_ctx* (...) @convey_tls_get()
ret %struct.convey_ctx* %1
}
void CDRabout() {}


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

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

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

LLVM IR (-O2):
define void @CDRabout() {
ret void
}
float foo20(double a, double b, double c) { return (float)(a + b * c); }


x86 assembly (clang, -O0):
<foo20>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo20>:
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @foo20(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %1, double %2, double %0)
%5 = fptrunc double %4 to float
ret float %5
}