xunge/DecIR huggingface dataset:
void g_value_peek_pointer() {}


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

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

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

LLVM IR (-O2):
define void @g_value_peek_pointer() {
ret void
}
/* Variables and functions */
int O_CREAT;
int /*<<< orphan*/ assert(int);
int open(char const *, int);
int do_open(const char *path, int oflag) {
  int fd = open(path, O_CREAT | oflag);
  assert(fd >= 0);
  return fd;
}


x86 assembly (clang, -O0):
<do_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
or     -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_open>:
push   %rbx
mov    0x2ed0(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
define i32 @do_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_CREAT
%8 = load i32, i32* %4
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %6, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp sge i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@O_CREAT = global i32 0
define i32 @do_open(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %1
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @assert(i32 %7)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void nocrash_vfprintf() {
  FILE *f;
  va_list arg;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    vfprintf(f, "blablabla\n", arg);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1176 <nocrash_vfprintf+0x46>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeb1(%rip),%rsi
call   1050 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_vfprintf>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1164 <nocrash_vfprintf+0x34>
mov    %rax,%rbx
lea    0xec6(%rip),%rsi
mov    %rax,%rdi
call   1050 <vfprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"blablabla\0A\00"
define void @nocrash_vfprintf() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = load i32, i32* %2
%9 = call i32 @vfprintf(i32* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %1
%11 = call i32 @fclose(i32* %10)
br label %12
12: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"blablabla\0A\00"
define void @nocrash_vfprintf() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @vfprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 undef)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_write_reg(int, int);
void draw_done(void) { console_write_reg(0x1, 1); }


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

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

LLVM IR (-O0):
define void @draw_done() {
%1 = call i32 @console_write_reg(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @draw_done() {
%1 = tail call i32 @console_write_reg(i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_program_out(int, int);
void pic14n_increment_address(void) { io_program_out(0xF8, 8); }


x86 assembly (clang, -O0):
<pic14n_increment_address>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf8,%edi
mov    $0x8,%esi
call   1030 <io_program_out@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic14n_increment_address>:
mov    $0xf8,%edi
mov    $0x8,%esi
jmp    1030 <io_program_out@plt>

LLVM IR (-O0):
define void @pic14n_increment_address() {
%1 = call i32 @io_program_out(i32 248, i32 8)
ret void
}

LLVM IR (-O2):
define void @pic14n_increment_address() {
%1 = tail call i32 @io_program_out(i32 248, i32 8)
ret void
}
int fun1(int n) {
  int s = 0;
  while (n) {
    s = s * 10 + n % 10;
    n = n / 10;
  }
  return s;
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <fun1+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <fun1+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
xor    %eax,%eax
test   %edi,%edi
je     113f <fun1+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <fun1+0x10>
ret

LLVM IR (-O0):
define i32 @fun1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 10
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = add nsw i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @fun1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ mcapi_trans_display_state(void *);
void mcapi_display_state(void *handle) { mcapi_trans_display_state(handle); }


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

x86 assembly (clang, -O2):
<mcapi_display_state>:
jmp    1030 <mcapi_trans_display_state@plt>

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

LLVM IR (-O2):
define void @mcapi_display_state(i8* %0) {
%2 = tail call i32 @mcapi_trans_display_state(i8* %0)
ret void
}
strlen(str) char *str;
{
  register char *s, *p;
  p = s = str;
  while (*p)
    p++;
  return (p - s);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strlen+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @strlen(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
store i8* %5, i8** %4
br label %6
6: ; preds = %10, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
br label %6
13: ; preds = %6
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t avpriv_codec2_mode_from_extradata(uint8_t *ptr) { return ptr[2]; }


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

x86 assembly (clang, -O2):
<avpriv_codec2_mode_from_extradata>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @avpriv_codec2_mode_from_extradata(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
float sqrt(int);
float sq_side_diagonal(float diagonal) {
  float square_root_2 = sqrt(2);
  float side = diagonal / square_root_2;
  return side;
}


x86 assembly (clang, -O0):
<sq_side_diagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq_side_diagonal>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sq_side_diagonal(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float @sqrt(i32 2)
store float %5, float* %3
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fdiv float %6, %7
store float %8, float* %4
%9 = load float, float* %4
ret float %9
}

LLVM IR (-O2):
define float @sq_side_diagonal(float %0) {
%2 = tail call float @sqrt(i32 2)
%3 = fdiv float %0, %2
ret float %3
}
/* Variables and functions */
int getopt_internal(int, char *const *, char const *, int /*<<< orphan*/);
int local_getopt(int nargc, char *const *nargv, const char *options) {
  return (getopt_internal(nargc, nargv, options, 0));
}


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

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

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

LLVM IR (-O2):
define i32 @local_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct reb_simulation {
  int dummy;
};

/* Variables and functions */
scalar_t__ reb_output_check(struct reb_simulation *, int);
int /*<<< orphan*/ reb_output_timing(struct reb_simulation *,
                                     int /*<<< orphan*/);
void heartbeat(struct reb_simulation *r) {
  if (reb_output_check(r, 10. * 2. * 3.14159265358979323846)) {
    reb_output_timing(r, 0);
  }
}


x86 assembly (clang, -O0):
<heartbeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3e,%esi
call   1040 <reb_output_check@plt>
cmp    $0x0,%rax
je     114f <heartbeat+0x2f>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <reb_output_timing@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heartbeat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3e,%esi
call   1040 <reb_output_check@plt>
test   %rax,%rax
je     113e <heartbeat+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <reb_output_timing@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.reb_simulation = type { i32 }
define void @heartbeat(%struct.reb_simulation* %0) {
%2 = alloca %struct.reb_simulation*
store %struct.reb_simulation* %0, %struct.reb_simulation** %2
%3 = load %struct.reb_simulation*, %struct.reb_simulation** %2
%4 = call i64 @reb_output_check(%struct.reb_simulation* %3, i32 62)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.reb_simulation*, %struct.reb_simulation** %2
%8 = call i32 @reb_output_timing(%struct.reb_simulation* %7, i32 0)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.reb_simulation = type { i32 }
define void @heartbeat(%struct.reb_simulation* %0) {
%2 = tail call i64 @reb_output_check(%struct.reb_simulation* %0, i32 62)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @reb_output_timing(%struct.reb_simulation* %0, i32 0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void asc_simple_logging_out(const char *format, va_list args) {
  vfprintf(stdout, format, args);
  fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<asc_simple_logging_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vfprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc_simple_logging_out>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rbx
mov    (%rbx),%edi
call   1040 <vfprintf@plt>
mov    (%rbx),%edi
lea    0xec3(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @asc_simple_logging_out(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int LLI2C_set_data_for_output(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @LLI2C_set_data_for_output() {
ret i32 0
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
int sem_signal(int semid, int sem_num, int val) {
  struct sembuf op;
  op.sem_num = sem_num;
  op.sem_op = val;
  op.sem_flg = 0;
  semop(semid, &op, 1);
}


x86 assembly (clang, -O0):
<sem_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_signal>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define i32 @sem_signal(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sembuf
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %8, i32 0, i32 0
store i32 %9, i32* %10
%11 = load i32, i32* %7
%12 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %8, i32 0, i32 1
store i32 %11, i32* %12
%13 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %8, i32 0, i32 2
store i64 0, i64* %13
%14 = load i32, i32* %5
%15 = call i32 @semop(i32 %14, %struct.sembuf* %8, i32 1)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define i32 @sem_signal(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.sembuf
%5 = bitcast %struct.sembuf* %4 to i8*
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 1
store i32 %2, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 2
store i64 0, i64* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %4, i32 1)
ret i32 undef
}
int __get_cpuid(unsigned int __level, unsigned int *__eax, unsigned int *__ebx,
                unsigned int *__ecx, unsigned int *__edx) {
  __asm("cpuid"
        : "=a"(*__eax), "=b"(*__ebx), "=c"(*__ecx), "=d"(*__edx)
        : "0"(__level));
  return 1;
}


x86 assembly (clang, -O0):
<__get_cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x40(%rbp),%rax
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
mov    $0x1,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_cpuid>:
push   %rbx
mov    %rcx,%r9
mov    %rdx,%r10
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__get_cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %15)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret i32 1
}

LLVM IR (-O2):
define i32 @__get_cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret i32 1
}
/* Variables and functions */
int llib_sys_chdir(char const *);
__attribute__((unused)) int chdir(const char *path) {
  return llib_sys_chdir(path);
}


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

x86 assembly (clang, -O2):
<chdir>:
jmp    1030 <llib_sys_chdir@plt>

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

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = tail call i32 @llib_sys_chdir(i8* %0)
ret i32 %2
}
int ft_isupper(int c) {
  if (c >= 'A' && c <= 'Z')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <ft_isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <ft_isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_main(void *args) { printf("Hello word.\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello word.\0A\00"
define void @test_main(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello word.\00"
define void @test_main(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ThreadQueue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ spinlock_destroy(struct ThreadQueue *);
void threadqueue_exit(struct ThreadQueue *tq) { spinlock_destroy(tq); }


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

x86 assembly (clang, -O2):
<threadqueue_exit>:
jmp    1030 <spinlock_destroy@plt>

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

LLVM IR (-O2):
%struct.ThreadQueue = type { i32 }
define void @threadqueue_exit(%struct.ThreadQueue* %0) {
%2 = tail call i32 @spinlock_destroy(%struct.ThreadQueue* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
void __aos_mdelay(int msecs) { mdelay(msecs); }


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

x86 assembly (clang, -O2):
<__aos_mdelay>:
jmp    1030 <mdelay@plt>

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

LLVM IR (-O2):
define void @__aos_mdelay(i32 %0) {
%2 = tail call i32 @mdelay(i32 %0)
ret void
}
void host_sound_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @host_sound_shutdown() {
ret void
}
void posix_signal2(sig_num, action) int sig_num;
void (*action)();
{}


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

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

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

LLVM IR (-O2):
define void @posix_signal2(i32 %0, void (...)* nocapture %1) {
ret void
}
int test_imm_3Cuint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x3C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Cuint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x3c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Cuint64_highword_mem>:
testb  $0x3c,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Cuint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 257698037760
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int arr[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", arr[i]);
  printf("n");
}


x86 assembly (clang, -O0):
<printArray>:
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    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 110)
ret void
}
/* Variables and functions */
int const *bsearch_int(int *, int const, int const);
const int *vint_set_int_find(const int key, const int n, int numbers[]) {
  return bsearch_int(numbers, n, key);
}


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

x86 assembly (clang, -O2):
<vint_set_int_find>:
mov    %edi,%eax
mov    %rdx,%rdi
mov    %eax,%edx
jmp    1030 <bsearch_int@plt>

LLVM IR (-O0):
define i32* @vint_set_int_find(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** %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32* @bsearch_int(i32* %7, i32 %8, i32 %9)
ret i32* %10
}

LLVM IR (-O2):
define i32* @vint_set_int_find(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32* @bsearch_int(i32* %2, i32 %1, i32 %0)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ init(char *);
int ok();
int /*<<< orphan*/ test();
int main() {
  init("goto");
  test();
  return ok();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ok@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"goto\00"
define i32 @main() {
%1 = tail call i32 @init(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test()
%3 = tail call i32 (...) @ok()
ret i32 %3
}
void RTStrSpaceDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrSpaceDestroy() {
ret void
}
double atmoT(double h) {
  double T;
  T = 298.15 - 0.0065 * h;
  return T;
}


x86 assembly (clang, -O0):
<atmoT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmoT>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @atmoT(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 0xBF7A9FBE76C8B439, double %4, double 2.981500e+02)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @atmoT(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xBF7A9FBE76C8B439, double 2.981500e+02)
ret double %2
}
/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (chdir("/tmp") < 0) {
    perror("chdir failed");
    exit(1);
  }
  printf("chdir to /tmp successed\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    1182 <main+0x42>
lea    0xe92(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
js     1162 <main+0x22>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe9c(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [13 x i8] c"chdir failed\00"
@.str.2 = [25 x i8] c"chdir to /tmp successed\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @chdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
@.str.1 = [13 x i8] c"chdir failed\00"
@str = [24 x i8] c"chdir to /tmp successed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @chdir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
main() {
  if (sizeof(char *) == sizeof(long))
    printf("long\n");
  else if (sizeof(char *) == sizeof(short))
    printf("short\n");
  else
    printf("int\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@str = [5 x i8] c"long\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_shell_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t
wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface) {
  return wl_proxy_get_version((struct wl_proxy *)wl_shell_surface);
}


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

x86 assembly (clang, -O2):
<wl_shell_surface_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_shell_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shell_surface_get_version(%struct.wl_shell_surface* %0) {
%2 = alloca %struct.wl_shell_surface*
store %struct.wl_shell_surface* %0, %struct.wl_shell_surface** %2
%3 = load %struct.wl_shell_surface*, %struct.wl_shell_surface** %2
%4 = bitcast %struct.wl_shell_surface* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_shell_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shell_surface_get_version(%struct.wl_shell_surface* %0) {
%2 = bitcast %struct.wl_shell_surface* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
unsigned getbits(unsigned m, int s, int e) {
  unsigned b, c;
  b = m >> (32 - 16 - e - 1);
  c = ~(~0 << (e - s + 1));
  printf("b=%o,c=%o\n", b, c);
  return b & c;
}


x86 assembly (clang, -O0):
<getbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
and    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xf,%cl
sub    %dl,%cl
shr    %cl,%ebx
sub    %esi,%edx
lea    0x1(%rdx),%ecx
mov    $0xffffffff,%ebp
shl    %cl,%ebp
not    %ebp
lea    0xed0(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
and    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"b=%o,c=%o\0A\00"
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = sub nsw i32 16, %10
%12 = sub nsw i32 %11, 1
%13 = lshr i32 %9, %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = sub nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = shl i32 -1, %17
%19 = xor i32 %18, -1
store i32 %19, i32* %8
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = and i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
@.str = [11 x i8] c"b=%o,c=%o\0A\00"
define i32 @getbits(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 15, %2
%5 = lshr i32 %0, %4
%6 = sub i32 1, %1
%7 = add i32 %6, %2
%8 = shl nsw i32 -1, %7
%9 = xor i32 %8, -1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %9)
%11 = and i32 %5, %9
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int read_num(const char *str) {
  int num;
  sscanf(str, "%d", &num);
  return num;
}


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

x86 assembly (clang, -O2):
<read_num>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @read_num(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void my_fini(void) { fputs("libeasy unloaded\n", stdout); }


x86 assembly (clang, -O0):
<my_fini>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fini>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"libeasy unloaded\0A\00"
@stdout = global i32 0
define void @my_fini() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, int);
void IDE_reset(void) {
  io_out8(0x3f6, 0xc);
  io_out8(0x3f6, 0x8);
}


x86 assembly (clang, -O0):
<IDE_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f6,%edi
mov    $0xc,%esi
call   1030 <io_out8@plt>
mov    $0x3f6,%edi
mov    $0x8,%esi
call   1030 <io_out8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IDE_reset>:
push   %rax
mov    $0x3f6,%edi
mov    $0xc,%esi
call   1030 <io_out8@plt>
mov    $0x3f6,%edi
mov    $0x8,%esi
pop    %rax
jmp    1030 <io_out8@plt>

LLVM IR (-O0):
define void @IDE_reset() {
%1 = call i32 @io_out8(i32 1014, i32 12)
%2 = call i32 @io_out8(i32 1014, i32 8)
ret void
}

LLVM IR (-O2):
define void @IDE_reset() {
%1 = tail call i32 @io_out8(i32 1014, i32 12)
%2 = tail call i32 @io_out8(i32 1014, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ m5_reset_stats(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ parse_int_args(int, char **, int /*<<< orphan*/ *, int);
void do_reset_stats(int argc, char *argv[]) {
  uint64_t ints[2];
  parse_int_args(argc, argv, ints, 2);
  m5_reset_stats(ints[0], ints[1]);
}


x86 assembly (clang, -O0):
<do_reset_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <m5_reset_stats@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_reset_stats>:
push   %rax
mov    %rsp,%rdx
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1030 <m5_reset_stats@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @do_reset_stats(i32 %0, i8** %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @parse_int_args(i32 %0, i8** %1, i32* %5, i32 2)
%7 = load i32, i32* %5
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @m5_reset_stats(i32 %7, i32 %9)
ret void
}
unsigned short byteSwap16(unsigned short a) {
  union {
    unsigned short whole;
    unsigned char bytes[2];
  } u, v;
  u.whole = a;
  v.bytes[0] = u.bytes[1];
  v.bytes[1] = u.bytes[0];
  return v.whole;
}


x86 assembly (clang, -O0):
<byteSwap16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x8(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0xf(%rbp)
movzwl -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteSwap16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
%union.anon = type { i16 }
define zeroext i16 @byteSwap16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca %union.anon
%4 = alloca %union.anon
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = bitcast %union.anon* %3 to i16*
store i16 %5, i16* %6
%7 = bitcast %union.anon* %3 to [2 x i8]*
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
%9 = load i8, i8* %8
%10 = bitcast %union.anon* %4 to [2 x i8]*
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 %9, i8* %11
%12 = bitcast %union.anon* %3 to [2 x i8]*
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%14 = load i8, i8* %13
%15 = bitcast %union.anon* %4 to [2 x i8]*
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %15, i64 0, i64 1
store i8 %14, i8* %16
%17 = bitcast %union.anon* %4 to i16*
%18 = load i16, i16* %17
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @byteSwap16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}