xunge/DecIR huggingface dataset:
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
scalar_t__ getrlimit(int, struct rlimit *);
int /*<<< orphan*/ shutdown(int, char *, int);
void getr(int type, struct rlimit *rlim) {
  if (getrlimit(type, rlim))
    shutdown(6, "getrlimit()", 138 - 1);
}


x86 assembly (clang, -O0):
<getr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <getrlimit@plt>
cmp    $0x0,%rax
je     115b <getr+0x3b>
mov    $0x6,%edi
lea    0xeaf(%rip),%rsi
mov    $0x89,%edx
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getr>:
push   %rax
call   1040 <getrlimit@plt>
test   %rax,%rax
je     1142 <getr+0x22>
lea    0xece(%rip),%rsi
mov    $0x6,%edi
mov    $0x89,%edx
pop    %rax
jmp    1030 <shutdown@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"getrlimit()\00"
define void @getr(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* %3
%6 = load %struct.rlimit*, %struct.rlimit** %4
%7 = call i64 @getrlimit(i32 %5, %struct.rlimit* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @shutdown(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 137)
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"getrlimit()\00"
define void @getr(i32 %0, %struct.rlimit* %1) {
%3 = tail call i64 @getrlimit(i32 %0, %struct.rlimit* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @shutdown(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 137)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
char *pass0(char const *);
char *pass1(char *);
char *pass2(char *);
char *sexpcode(const char *input) {
  char *a, *b;
  if ((a = pass0(input)) == NULL)
    return NULL;
  b = pass1(a);
  if (b == NULL)
    return NULL;
  a = pass2(b);
  return a;
}


x86 assembly (clang, -O0):
<sexpcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <pass0@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1160 <sexpcode+0x30>
movq   $0x0,-0x8(%rbp)
jmp    119a <sexpcode+0x6a>
mov    -0x18(%rbp),%rdi
call   1050 <pass1@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1185 <sexpcode+0x55>
movq   $0x0,-0x8(%rbp)
jmp    119a <sexpcode+0x6a>
mov    -0x20(%rbp),%rdi
call   1040 <pass2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sexpcode>:
push   %rax
call   1030 <pass0@plt>
test   %rax,%rax
je     1151 <sexpcode+0x21>
mov    %rax,%rdi
call   1050 <pass1@plt>
test   %rax,%rax
je     1151 <sexpcode+0x21>
mov    %rax,%rdi
pop    %rax
jmp    1040 <pass2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @sexpcode(i8* %0) {
%2 = tail call i8* @pass0(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i8* @pass1(i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i8* @pass2(i8* %5)
br label %9
9: ; preds = %4, %1, %7
%10 = phi i8* [ %8, %7 ], [ null, %1 ], [ null, %4 ]
ret i8* %10
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR53_get(void) { return U_WMRCORENONE_get("U_WMR53"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR53\00"
define i32 @U_WMR53_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR53\00"
define i32 @U_WMR53_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int matches(char *, char *);
int /*<<< orphan*/ path_absolute(char const *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
int path_compare(const char *path0, const char *path1) {
  char abs0[8192];
  char abs1[8192];
  strcpy(abs0, path_absolute(path0));
  strcpy(abs1, path_absolute(path1));
  return matches(abs0, abs1);
}


x86 assembly (clang, -O0):
<path_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2010(%rbp),%rax
mov    %rax,-0x4020(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <path_absolute@plt>
mov    -0x4020(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
lea    -0x4010(%rbp),%rax
mov    %rax,-0x4018(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <path_absolute@plt>
mov    -0x4018(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
lea    -0x2010(%rbp),%rdi
lea    -0x4010(%rbp),%rsi
call   1050 <matches@plt>
add    $0x4020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_compare>:
push   %r14
push   %rbx
sub    $0x4008,%rsp
mov    %rsi,%rbx
call   1040 <path_absolute@plt>
lea    0x2000(%rsp),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <path_absolute@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <matches@plt>
add    $0x4008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @path_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [8192 x i8]
%6 = alloca [8192 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @path_absolute(i8* %8)
%10 = call i32 @strcpy(i8* %7, i32 %9)
%11 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @path_absolute(i8* %12)
%14 = call i32 @strcpy(i8* %11, i32 %13)
%15 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%17 = call i32 @matches(i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @path_compare(i8* %0, i8* %1) {
%3 = alloca [8192 x i8]
%4 = alloca [8192 x i8]
%5 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @path_absolute(i8* %0)
%8 = call i32 @strcpy(i8* %5, i32 %7)
%9 = call i32 @path_absolute(i8* %1)
%10 = call i32 @strcpy(i8* %6, i32 %9)
%11 = call i32 @matches(i8* %5, i8* %6)
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
size_t coap_opt_put_string(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                           char const *, char);
size_t coap_opt_put_uri_query(uint8_t *buf, uint16_t lastonum,
                              const char *uri) {
  return coap_opt_put_string(buf, lastonum, (15), uri, '&');
}


x86 assembly (clang, -O0):
<coap_opt_put_uri_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0xf,%edx
mov    $0x26,%r8d
call   1030 <coap_opt_put_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coap_opt_put_uri_query>:
mov    %rdx,%rcx
mov    $0xf,%edx
mov    $0x26,%r8d
jmp    1030 <coap_opt_put_string@plt>

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

LLVM IR (-O2):
define i64 @coap_opt_put_uri_query(i32* %0, i32 %1, i8* %2) {
%4 = tail call i64 @coap_opt_put_string(i32* %0, i32 %1, i32 15, i8* %2, i8 signext 38)
ret i64 %4
}
void on_recv_message(void *handle, struct message *msg) {}


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

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

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

LLVM IR (-O2):
%struct.message = type opaque
define void @on_recv_message(i8* nocapture %0, %struct.message* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *index(char *, char);
int counterName(char *name) { return index(name, '#') != NULL; }


x86 assembly (clang, -O0):
<counterName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <index@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counterName>:
push   %rax
mov    $0x23,%esi
call   1030 <index@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @counterName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @index(i8* %3, i8 signext 35)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @counterName(i8* %0) {
%2 = tail call i32* @index(i8* %0, i8 signext 35)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int incl_from(void) {
  printf("incl_from\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"incl_from\00"
define i32 @incl_from() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void hdmi_msm_audio_sample_rate_reset(int rate) {}


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

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

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

LLVM IR (-O2):
define void @hdmi_msm_audio_sample_rate_reset(i32 %0) {
ret void
}
void OBJ_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_cleanup() {
ret void
}
/* Variables and functions */
int sysfs_modify_policy_max(unsigned int, unsigned long);
int cpufreq_modify_policy_max(unsigned int cpu, unsigned long max_freq) {
  return sysfs_modify_policy_max(cpu, max_freq);
}


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

x86 assembly (clang, -O2):
<cpufreq_modify_policy_max>:
jmp    1030 <sysfs_modify_policy_max@plt>

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

LLVM IR (-O2):
define i32 @cpufreq_modify_policy_max(i32 %0, i64 %1) {
%3 = tail call i32 @sysfs_modify_policy_max(i32 %0, i64 %1)
ret i32 %3
}
void init_add_mask_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_mask_color_span_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_command_stack();
int main(void) {
  test_command_stack();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_command_stack()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void func_2(void) {
  int var_2 = 2;
  while (1) {
    int var_while_1 = 3;
    int var_while_2 = 4;
    int var_sleep = 10;
    sleep(var_sleep);
  }
}


x86 assembly (clang, -O0):
<func_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <sleep@plt>
jmp    111f <func_2+0xf>

x86 assembly (clang, -O2):
<func_2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <sleep@plt>
jmp    1120 <func_2+0x10>

LLVM IR (-O0):
define void @func_2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 2, i32* %1
br label %5
5: ; preds = %0, %5
store i32 3, i32* %2
store i32 4, i32* %3
store i32 10, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @sleep(i32 %6)
br label %5
}

LLVM IR (-O2):
define void @func_2() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 10)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *replace(char *, char const *, char const *);
char *replace_r(char *src, const char *find, const char *rplc) {
  char *new = replace(src, find, rplc);
  free(src);
  return new;
}


x86 assembly (clang, -O0):
<replace_r>:
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
mov    -0x18(%rbp),%rdx
call   1040 <replace@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @replace_r(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @replace(i8* %0, i8* %1, i8* %2)
%5 = tail call i32 @free(i8* %0)
ret i8* %4
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
int file_nonempty(const struct stat *stat) { return stat->st_size == 0; }


x86 assembly (clang, -O0):
<file_nonempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_nonempty>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @file_nonempty(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @file_nonempty(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long now(void) {
  struct timeval tv;
  if (gettimeofday(&tv, NULL))
    err(3, "gettimeofday failed");
  return tv.tv_sec * 1000000ll + tv.tv_usec;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     1150 <now+0x30>
mov    $0x3,%edi
lea    0xeb5(%rip),%rsi
call   1040 <err@plt>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     1146 <now+0x26>
lea    0xec4(%rip),%rsi
mov    $0x3,%edi
call   1040 <err@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [20 x i8] c"gettimeofday failed\00"
define i64 @now() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @err(i32 3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [20 x i8] c"gettimeofday failed\00"
define i64 @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @err(i32 3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = mul nsw i64 %9, 1000000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load i64, i64* %11
%13 = add nsw i64 %10, %12
ret i64 %13
}
void delay_ms(int miliSec) {
  int i, j;
  for (i = 0; i < miliSec; i++) {
    for (j = 0; j < 775; j++) {
      asm("nop");
    }
  }
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <delay_ms+0x50>
movl   $0x0,-0xc(%rbp)
cmpl   $0x307,-0xc(%rbp)
jge    113d <delay_ms+0x3d>
nop
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <delay_ms+0x21>
jmp    1142 <delay_ms+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay_ms+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
test   %edi,%edi
jle    112d <delay_ms+0x2d>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
mov    $0x307,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
nop
add    $0xffffffff,%ecx
jne    1120 <delay_ms+0x20>
add    $0x1,%eax
cmp    %edi,%eax
jne    1110 <delay_ms+0x10>
ret

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

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %7, %5 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%7 = add nuw nsw i32 %6, 1
%8 = icmp eq i32 %7, 775
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %9, %1
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int);
void bfc_halt(int exit_code) {
  exit(exit_code);
  for (;;) {
    exit(EXIT_FAILURE);
    abort();
  }
}


x86 assembly (clang, -O0):
<bfc_halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<bfc_halt>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @bfc_halt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @bfc_halt(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
int magicNumber(int n, int fac) {
  int answer = 0;
  int expo = 1;
  while (n != 0) {
    expo = expo * fac;
    if (n & 1)
      answer += expo;
    n = n >> 1;
  }
  return answer;
}


x86 assembly (clang, -O0):
<magicNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1152 <magicNumber+0x52>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1144 <magicNumber+0x44>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1118 <magicNumber+0x18>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<magicNumber>:
xor    %eax,%eax
test   %edi,%edi
je     1129 <magicNumber+0x29>
mov    $0x1,%r8d
mov    %edi,%edx
xchg   %ax,%ax
imul   %esi,%r8d
mov    %edi,%ecx
and    $0x1,%ecx
neg    %ecx
and    %r8d,%ecx
add    %ecx,%eax
sar    %edx
cmp    $0x1,%edi
mov    %edx,%edi
ja     1110 <magicNumber+0x10>
ret

LLVM IR (-O0):
define i32 @magicNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %3
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %10
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = add nsw i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %17, %10
%22 = load i32, i32* %3
%23 = ashr i32 %22, 1
store i32 %23, i32* %3
br label %7
24: ; preds = %7
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @magicNumber(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ 0, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = mul nsw i32 %5, %1
%9 = and i32 %7, 1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 0, i32 %8
%12 = add nsw i32 %11, %6
%13 = ashr i32 %7, 1
%14 = icmp ult i32 %7, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 0, %2 ], [ %12, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char const *, size_t);
int strlen(char const *);
void *str2memcpy(void *dest, const char *src, size_t n) {
  size_t bytes = strlen(src) + 1;
  if (bytes > n)
    bytes = n;
  memcpy(dest, src, bytes);
  return dest;
}


x86 assembly (clang, -O0):
<str2memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    115c <str2memcpy+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2memcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rdx
cmp    %rbx,%rdx
cmova  %rbx,%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @str2memcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = icmp ugt i64 %6, %2
%8 = select i1 %7, i64 %2, i64 %6
%9 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %8)
ret i8* %0
}
__attribute__((always_)) int devtmpfs_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @devtmpfs_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @devtmpfs_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_async();
int /*<<< orphan*/ test_sql();
int main(int argc, char **argv) {
  test_sql();
  test_async();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_sql@plt>
mov    $0x0,%al
call   1030 <test_async@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_sql()
%4 = tail call i32 (...) @test_async()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ print_str(int /*<<< orphan*/);
int /*<<< orphan*/ stringify_int(long, char *);
void print_int(long v) {
  char buf[32];
  print_str(stringify_int(v, buf + sizeof(buf) - 1));
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x20,%rsi
add    $0xffffffffffffffff,%rsi
call   1030 <stringify_int@plt>
mov    %eax,%edi
call   1040 <print_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
sub    $0x28,%rsp
lea    0x1f(%rsp),%rsi
call   1030 <stringify_int@plt>
mov    %eax,%edi
call   1040 <print_str@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @print_int(i64 %0) {
%2 = alloca i64
%3 = alloca [32 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds i8, i8* %5, i64 32
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = call i32 @stringify_int(i64 %4, i8* %7)
%9 = call i32 @print_str(i32 %8)
ret void
}

LLVM IR (-O2):
define void @print_int(i64 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 31
%5 = call i32 @stringify_int(i64 %0, i8* %4)
%6 = call i32 @print_str(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void pa_threaded_mainloop_free(int *m) {
  empty_log("pa_threaded_mainloop_free: nothing to do\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"pa_threaded_mainloop_free: nothing to do\0A\00"
define void @pa_threaded_mainloop_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @empty_log(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"pa_threaded_mainloop_free: nothing to do\0A\00"
define void @pa_threaded_mainloop_free(i32* nocapture readnone %0) {
%2 = tail call i32 @empty_log(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int length = 0;
  char line[1000];
  while ((length = get_line(line, 1000)) > 0) {
    if (length > 80) {
      printf("%d Chars: %s", length, line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    117b <main+0x5b>
cmpl   $0x50,-0x8(%rbp)
jle    1176 <main+0x56>
mov    -0x8(%rbp),%esi
lea    -0x3f0(%rbp),%rdx
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1175 <main+0x55>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1175 <main+0x55>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d Chars: %s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @get_line(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
void fmStopTone(int channel) {}


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

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

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

LLVM IR (-O2):
define void @fmStopTone(i32 %0) {
ret void
}
struct huron_object *huron_eval(struct huron_object *expr) {
  return expr;
}


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

x86 assembly (clang, -O2):
<huron_eval>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.huron_object = type opaque
define %struct.huron_object* @huron_eval(%struct.huron_object* readnone returned %0) {
ret %struct.huron_object* %0
}
char *cleanup_identifier(str)
char *str;
{
  char *from_ptr = str, *to_ptr = str;
  while (*from_ptr) {
    if (*from_ptr != ' ')
      *to_ptr++ = *from_ptr;
    from_ptr++;
  }
  *to_ptr = 0;
  return str;
}


x86 assembly (clang, -O0):
<cleanup_identifier>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <cleanup_identifier+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     114c <cleanup_identifier+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <cleanup_identifier+0x18>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_identifier>:
mov    %rdi,%rax
mov    %rdi,%rdx
mov    %rdi,%rsi
jmp    1114 <cleanup_identifier+0x14>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rdx
movzbl (%rdx),%ecx
cmp    $0x20,%cl
je     1110 <cleanup_identifier+0x10>
test   %cl,%cl
je     1128 <cleanup_identifier+0x28>
mov    %cl,(%rsi)
add    $0x1,%rsi
jmp    1110 <cleanup_identifier+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @cleanup_identifier(i8* returned %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %11
i8 32, label %8
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %5, i8* %4
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %4
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int time_t;

/* Variables and functions */
double difftime(int, int);
int time(int /*<<< orphan*/ *);
uint32_t calc_vhd_timestamp() {
  time_t start_time;
  time_t curr_time;
  double vhd_time;
  start_time = 946684800;
  curr_time = time(NULL);
  vhd_time = difftime(curr_time, start_time);
  return (uint32_t)vhd_time;
}


x86 assembly (clang, -O0):
<calc_vhd_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x386d4380,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <difftime@plt>
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_vhd_timestamp>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    $0x386d4380,%esi
call   1030 <difftime@plt>
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @calc_vhd_timestamp() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 946684800, i32* %1
%4 = call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call double @difftime(i32 %5, i32 %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @calc_vhd_timestamp() {
%1 = tail call i32 @time(i32* null)
%2 = tail call double @difftime(i32 %1, i32 946684800)
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
void pad_blanks(char s[], int numc) {
  int len;
  int k;
  len = strlen(s);
  for (k = len; k < numc; k++)
    s[k] = ' ';
  s[numc] = '\0';
}


x86 assembly (clang, -O0):
<pad_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <pad_blanks+0x47>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <pad_blanks+0x21>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad_blanks>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %ebp,%eax
jge    114c <pad_blanks+0x2c>
movslq %eax,%rdi
add    %rbx,%rdi
not    %eax
add    %ebp,%eax
add    $0x1,%rax
mov    $0x20,%esi
mov    %rax,%rdx
call   1040 <memset@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @pad_blanks(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = getelementptr i8, i8* %0, i64 %6
%8 = xor i32 %3, -1
%9 = add i32 %8, %1
%10 = zext i32 %9 to i64
%11 = add nuw nsw i64 %10, 1
br label %12
12: ; preds = %5, %2
%13 = sext i32 %1 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int pm8xxx_mpp_cfg(unsigned int, int, unsigned int, unsigned int);
int pm8xxx_mpp_config_analog_input(unsigned mpp, unsigned level,
                                   unsigned control) {
  return pm8xxx_mpp_cfg(mpp, 3, level, control);
}


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

x86 assembly (clang, -O2):
<pm8xxx_mpp_config_analog_input>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x3,%esi
jmp    1030 <pm8xxx_mpp_cfg@plt>

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

LLVM IR (-O2):
define i32 @pm8xxx_mpp_config_analog_input(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8xxx_mpp_cfg(i32 %0, i32 3, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ _try_load_flex_struct_size(size_t, size_t, size_t, size_t, size_t *);
void *malloc(size_t);
void *_malloc_flex_struct(size_t struct_size, size_t fam_type_size,
                          size_t fam_offset, size_t fam_length) {
  size_t size;
  return (_try_load_flex_struct_size(struct_size, fam_type_size, fam_offset,
                                     fam_length, &size))
             ? malloc(size)
             : NULL;
}


x86 assembly (clang, -O0):
<_malloc_flex_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1030 <_try_load_flex_struct_size@plt>
cmp    $0x0,%rax
je     116d <_malloc_flex_struct+0x4d>
mov    -0x28(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
jmp    1178 <_malloc_flex_struct+0x58>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    1178 <_malloc_flex_struct+0x58>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_malloc_flex_struct>:
push   %rax
mov    %rsp,%r8
call   1030 <_try_load_flex_struct_size@plt>
test   %rax,%rax
je     1139 <_malloc_flex_struct+0x19>
mov    (%rsp),%rdi
call   1040 <malloc@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @_malloc_flex_struct(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 @_try_load_flex_struct_size(i64 %10, i64 %11, i64 %12, i64 %13, i64* %9)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i64, i64* %9
%18 = call i8* @malloc(i64 %17)
br label %20
19: ; preds = %4
br label %20
20: ; preds = %19, %16
%21 = phi i8* [ %18, %16 ], [ null, %19 ]
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @_malloc_flex_struct(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = call i64 @_try_load_flex_struct_size(i64 %0, i64 %1, i64 %2, i64 %3, i64* %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i64, i64* %5
%11 = call i8* @malloc(i64 %10)
br label %12
12: ; preds = %4, %9
%13 = phi i8* [ %11, %9 ], [ null, %4 ]
ret i8* %13
}
void sock_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @sock_shutdown() {
ret void
}