xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ rmtemps();
void quit(int code) {
  rmtemps();
  exit(code);
}


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

x86 assembly (clang, -O2):
<quit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rmtemps@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rmtemps()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 (...) @rmtemps()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
int ar71xx_pcibios_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ar71xx_pcibios_init() {
ret i32 0
}
int gen_lambda() {
  static int cnt;
  return cnt++;
}


x86 assembly (clang, -O0):
<gen_lambda>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_lambda>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@gen_lambda.cnt = internal global i32 0
define i32 @gen_lambda() {
%1 = load i32, i32* @gen_lambda.cnt
%2 = add nsw i32 %1, 1
store i32 %2, i32* @gen_lambda.cnt
ret i32 %1
}

LLVM IR (-O2):
@gen_lambda.cnt = internal unnamed_addr global i32 0
define i32 @gen_lambda() {
%1 = load i32, i32* @gen_lambda.cnt
%2 = add nsw i32 %1, 1
store i32 %2, i32* @gen_lambda.cnt
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ GLUT_CURSOR_HELP;
int /*<<< orphan*/ glutSetCursor(int /*<<< orphan*/);
void futureSetCursor(int value) { glutSetCursor(GLUT_CURSOR_HELP); }


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

x86 assembly (clang, -O2):
<futureSetCursor>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <glutSetCursor@plt>

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

LLVM IR (-O2):
@GLUT_CURSOR_HELP = global i32 0
define void @futureSetCursor(i32 %0) {
%2 = load i32, i32* @GLUT_CURSOR_HELP
%3 = tail call i32 @glutSetCursor(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CoreVideo_Quit();
int /*<<< orphan*/ gl_screen_close();
void screen_close(void) {
  gl_screen_close();
  CoreVideo_Quit();
}


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

x86 assembly (clang, -O2):
<screen_close>:
push   %rax
xor    %eax,%eax
call   1040 <gl_screen_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CoreVideo_Quit@plt>

LLVM IR (-O0):
define void @screen_close() {
%1 = call i32 (...) @gl_screen_close()
%2 = call i32 (...) @CoreVideo_Quit()
ret void
}

LLVM IR (-O2):
define void @screen_close() {
%1 = tail call i32 (...) @gl_screen_close()
%2 = tail call i32 (...) @CoreVideo_Quit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error1(char const *, int, char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int __chk_error(const char *filename, int line, int ret) {
  if (ret < 0) {
    error1(filename, line, "%m (ret=%d, errno=%d/%s)", ret, errno,
           strerror(errno));
  }
  return ret;
}


x86 assembly (clang, -O0):
<__chk_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1187 <__chk_error+0x67>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    %eax,%r9d
lea    0xe7e(%rip),%rdx
call   1030 <error1@plt>
mov    -0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__chk_error>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
test   %edx,%edx
jns    115f <__chk_error+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbp
mov    0x2ea6(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%edi
call   1040 <strerror@plt>
lea    0xeb4(%rip),%rdx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %eax,%r9d
call   1030 <error1@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%m (ret=%d, errno=%d/%s)\00"
@errno = global i32 0
define i32 @__chk_error(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* @errno
%14 = load i32, i32* @errno
%15 = call i32 @strerror(i32 %14)
%16 = call i32 @error1(i8* %10, i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %15)
br label %17
17: ; preds = %9, %3
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
@.str = [25 x i8] c"%m (ret=%d, errno=%d/%s)\00"
@errno = global i32 0
define i32 @__chk_error(i8* %0, i32 %1, i32 returned %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @error1(i8* %0, i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %6, i32 %7)
br label %9
9: ; preds = %5, %3
ret i32 %2
}
void foo328(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo328(i32 %0) {
ret void
}
/* Type definitions */
struct json_writer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ json_emits(struct json_writer *, char *);
int /*<<< orphan*/ json_value_end(struct json_writer *);
int /*<<< orphan*/ json_value_start(struct json_writer *);
void json_emit_null(struct json_writer *writer) {
  json_value_start(writer);
  json_emits(writer, "null");
  json_value_end(writer);
}


x86 assembly (clang, -O0):
<json_emit_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <json_value_start@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <json_emits@plt>
mov    -0x8(%rbp),%rdi
call   1050 <json_value_end@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_emit_null>:
push   %rbx
mov    %rdi,%rbx
call   1030 <json_value_start@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <json_emits@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <json_value_end@plt>

LLVM IR (-O0):
%struct.json_writer = type { i32 }
@.str = [5 x i8] c"null\00"
define void @json_emit_null(%struct.json_writer* %0) {
%2 = alloca %struct.json_writer*
store %struct.json_writer* %0, %struct.json_writer** %2
%3 = load %struct.json_writer*, %struct.json_writer** %2
%4 = call i32 @json_value_start(%struct.json_writer* %3)
%5 = load %struct.json_writer*, %struct.json_writer** %2
%6 = call i32 @json_emits(%struct.json_writer* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.json_writer*, %struct.json_writer** %2
%8 = call i32 @json_value_end(%struct.json_writer* %7)
ret void
}

LLVM IR (-O2):
%struct.json_writer = type { i32 }
@.str = [5 x i8] c"null\00"
define void @json_emit_null(%struct.json_writer* %0) {
%2 = tail call i32 @json_value_start(%struct.json_writer* %0)
%3 = tail call i32 @json_emits(%struct.json_writer* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @json_value_end(%struct.json_writer* %0)
ret void
}
void caller_1_1_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_2_2_2_1_2() {
ret void
}
double pumaGetTimeWaitedForPool(void) { return 0; }


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

x86 assembly (clang, -O2):
<pumaGetTimeWaitedForPool>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pumaGetTimeWaitedForPool() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @pumaGetTimeWaitedForPool() {
ret double 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t *generate_arm_cmd_mov_r_r_lsr(uint32_t *cmdbuffer, int dstreg, int r,
                                       int shift) {
  *cmdbuffer++ = 0xE1A00020 | (dstreg << 12) | (shift << 7) | (r);
  return cmdbuffer;
}


x86 assembly (clang, -O0):
<generate_arm_cmd_mov_r_r_lsr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0xc,%ecx
or     $0xe1a00020,%ecx
mov    -0x14(%rbp),%eax
shl    $0x7,%eax
or     %eax,%ecx
or     -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_arm_cmd_mov_r_r_lsr>:
shl    $0xc,%esi
shl    $0x7,%ecx
or     %edx,%esi
or     %ecx,%esi
or     $0xe1a00020,%esi
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @generate_arm_cmd_mov_r_r_lsr(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = shl i32 %9, 12
%11 = or i32 -509607904, %10
%12 = load i32, i32* %8
%13 = shl i32 %12, 7
%14 = or i32 %11, %13
%15 = load i32, i32* %7
%16 = or i32 %14, %15
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %5
store i32 %16, i32* %17
%19 = load i32*, i32** %5
ret i32* %19
}

LLVM IR (-O2):
define i32* @generate_arm_cmd_mov_r_r_lsr(i32* writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 12
%6 = shl i32 %3, 7
%7 = or i32 %5, %2
%8 = or i32 %7, %6
%9 = or i32 %8, -509607904
%10 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %9, i32* %0
ret i32* %10
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t soft_timer_ticks_to_min(int32_t ticks) { return ticks / (32768 * 60); }


x86 assembly (clang, -O0):
<soft_timer_ticks_to_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1e0000,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_timer_ticks_to_min>:
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x14,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @soft_timer_ticks_to_min(i32 %0) {
%2 = sdiv i32 %0, 1966080
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ christmas(int);
int main() {
  christmas(4);
  christmas(7);
  christmas(11);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <christmas@plt>
mov    $0x7,%edi
call   1030 <christmas@plt>
mov    $0xb,%edi
call   1030 <christmas@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @christmas(i32 4)
%3 = call i32 @christmas(i32 7)
%4 = call i32 @christmas(i32 11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @christmas(i32 4)
%2 = tail call i32 @christmas(i32 7)
%3 = tail call i32 @christmas(i32 11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ shutdown();
void sigint_handler(int signum) {
  printf("\tCaught SIGINT\n");
  shutdown();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <shutdown@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <shutdown@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\09Caught SIGINT\0A\00"
@EXIT_FAILURE = global i32 0
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @shutdown()
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [15 x i8] c"\09Caught SIGINT\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @shutdown()
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void gtk_notebook_get_tab_label() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_get_tab_label() {
ret void
}
/* Type definitions */
union bpf_attr {
  void *open_flags;
  void *map_id;
};
typedef void *__u32;

/* Variables and functions */
void bpf_attr_setup_obj_get_id(union bpf_attr *attr, __u32 id, __u32 flags) {
  attr->map_id = id;
  attr->open_flags = flags;
}


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

x86 assembly (clang, -O2):
<bpf_attr_setup_obj_get_id>:
mov    %rdx,(%rdi)
ret

LLVM IR (-O0):
%union.bpf_attr = type { i8* }
define void @bpf_attr_setup_obj_get_id(%union.bpf_attr* %0, i8* %1, i8* %2) {
%4 = alloca %union.bpf_attr*
%5 = alloca i8*
%6 = alloca i8*
store %union.bpf_attr* %0, %union.bpf_attr** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load %union.bpf_attr*, %union.bpf_attr** %4
%9 = bitcast %union.bpf_attr* %8 to i8**
store i8* %7, i8** %9
%10 = load i8*, i8** %6
%11 = load %union.bpf_attr*, %union.bpf_attr** %4
%12 = bitcast %union.bpf_attr* %11 to i8**
store i8* %10, i8** %12
ret void
}

LLVM IR (-O2):
%union.bpf_attr = type { i8* }
define void @bpf_attr_setup_obj_get_id(%union.bpf_attr* nocapture writeonly %0, i8* nocapture readnone %1, i8* %2) {
%4 = getelementptr %union.bpf_attr, %union.bpf_attr* %0, i64 0, i32 0
store i8* %2, i8** %4
ret void
}
int test_imm_87uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x87 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_87uint64_midword_mem>:
testb  $0x87,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_87uint64_midword_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, 16
%6 = and i64 %5, 135
%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_87uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8847360
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void pushf() { db(0x9C); }


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

x86 assembly (clang, -O2):
<pushf>:
mov    $0x9c,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @pushf() {
%1 = call i32 @db(i32 156)
ret void
}

LLVM IR (-O2):
define void @pushf() {
%1 = tail call i32 @db(i32 156)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, scalar_t__);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
scalar_t__ strlen(char const *);
char *xstrdup(const char *s) {
  char *copy = strdup(s);
  if (!copy) {
    fprintf(stderr, "failed to allocate memory (%zu bytes)", strlen(s) + 1);
    abort();
  }
  return copy;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1196 <xstrdup+0x56>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
add    $0x1,%rdx
lea    0xe76(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <strdup@plt>
test   %rax,%rax
je     1157 <xstrdup+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e82(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
lea    0xe8d(%rip),%rsi
mov    %ebp,%edi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"failed to allocate memory (%zu bytes)\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"failed to allocate memory (%zu bytes)\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = add nsw i64 %6, 1
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void string_destroy(char **string) {
  if (*string) {
    free(*string);
    *string = 0;
  }
}


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

x86 assembly (clang, -O2):
<string_destroy>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <string_destroy+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ write_hex_byte(char *, int /*<<< orphan*/);
void write_hex_bytes(char *dest, uint8_t *data, size_t size) {
  size_t index;
  for (index = 0; index < size; index++) {
    write_hex_byte(dest, data[index]);
    dest += 2;
  }
}


x86 assembly (clang, -O0):
<write_hex_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    116b <write_hex_bytes+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <write_hex_byte@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <write_hex_bytes+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_hex_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1149 <write_hex_bytes+0x39>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%esi
mov    %r12,%rdi
call   1030 <write_hex_byte@plt>
add    $0x2,%r12
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <write_hex_bytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @write_hex_bytes(i8* %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %12, %5 ], [ 0, %3 ]
%7 = phi i8* [ %11, %5 ], [ %0, %3 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %6
%9 = load i32, i32* %8
%10 = tail call i32 @write_hex_byte(i8* %7, i32 %9)
%11 = getelementptr inbounds i8, i8* %7, i64 2
%12 = add nuw i64 %6, 1
%13 = icmp eq i64 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
/* Variables and functions */
double mt19937_genrand_int32();
double mt19937_genrand_real2(void) {
  return mt19937_genrand_int32() * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<mt19937_genrand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt19937_genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt19937_genrand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <mt19937_genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt19937_genrand_real2() {
%1 = call double (...) @mt19937_genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @mt19937_genrand_real2() {
%1 = tail call double (...) @mt19937_genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int read8(FILE *f) {
  int i;
  i = fgetc(f);
  return (i);
}


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

x86 assembly (clang, -O2):
<read8>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @read8(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret i32 %2
}
int product(int num1, int num2) { return num1 * num2; }


x86 assembly (clang, -O0):
<product>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<product>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @product(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @product(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glPointSize(double);
int /*<<< orphan*/ gluOrtho2D(int /*<<< orphan*/, int, int /*<<< orphan*/, int);
void myinit() {
  glClearColor(1.0, 1.0, 1.0, 1.0);
  glPointSize(5.0);
  gluOrtho2D(0, 499, 0, 499);
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
movsd  0xecc(%rip),%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
movsd  0xeae(%rip),%xmm0
call   1040 <glPointSize@plt>
xor    %edx,%edx
mov    $0x1f3,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1050 <gluOrtho2D@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
movsd  0xec7(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
movaps %xmm0,%xmm3
call   1030 <glClearColor@plt>
movsd  0xeb9(%rip),%xmm0
call   1040 <glPointSize@plt>
xor    %edi,%edi
mov    $0x1f3,%esi
xor    %edx,%edx
mov    $0x1f3,%ecx
pop    %rax
jmp    1050 <gluOrtho2D@plt>

LLVM IR (-O0):
define void @myinit() {
%1 = call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = call i32 @glPointSize(double 5.000000e+00)
%3 = call i32 @gluOrtho2D(i32 0, i32 499, i32 0, i32 499)
ret void
}

LLVM IR (-O2):
define void @myinit() {
%1 = tail call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%2 = tail call i32 @glPointSize(double 5.000000e+00)
%3 = tail call i32 @gluOrtho2D(i32 0, i32 499, i32 0, i32 499)
ret void
}
int execute_getegid32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getegid32() {
ret i32 0
}
int one_int(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @one_int() {
ret i32 1
}

LLVM IR (-O2):
define i32 @one_int() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ make_manual(int);
void html_manual_() { make_manual(1); }


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

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

LLVM IR (-O0):
define void @html_manual_() {
%1 = call i32 @make_manual(i32 1)
ret void
}

LLVM IR (-O2):
define void @html_manual_() {
%1 = tail call i32 @make_manual(i32 1)
ret void
}
void shunget(int *index) { (*index)--; }


x86 assembly (clang, -O0):
<shunget>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shunget>:
addl   $0xffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define void @shunget(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, -1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_format0(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print_format1(char *, int /*<<< orphan*/, char *);
void printf3(char *s, char *a1, char *a2, char *a3) {
  print_format0(
      s, print_format1(s, print_format1(s, print_format1(s, 0, a1), a2), a3));
}


x86 assembly (clang, -O0):
<printf3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <print_format1@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1030 <print_format1@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
call   1030 <print_format1@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <print_format0@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf3>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <print_format1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1030 <print_format1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
call   1030 <print_format1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <print_format0@plt>

LLVM IR (-O0):
define void @printf3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @print_format1(i8* %12, i32 0, i8* %13)
%15 = load i8*, i8** %7
%16 = call i32 @print_format1(i8* %11, i32 %14, i8* %15)
%17 = load i8*, i8** %8
%18 = call i32 @print_format1(i8* %10, i32 %16, i8* %17)
%19 = call i32 @print_format0(i8* %9, i32 %18)
ret void
}

LLVM IR (-O2):
define void @printf3(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @print_format1(i8* %0, i32 0, i8* %1)
%6 = tail call i32 @print_format1(i8* %0, i32 %5, i8* %2)
%7 = tail call i32 @print_format1(i8* %0, i32 %6, i8* %3)
%8 = tail call i32 @print_format0(i8* %0, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flash_read(unsigned char *, unsigned int, int);
unsigned int param_read(unsigned int nv_offset) {
  unsigned char buff[4];
  unsigned int tmp = 0;
  flash_read(buff, nv_offset, 4);
  tmp = tmp | (*buff) << 8;
  tmp = tmp | *(buff + 1);
  return tmp;
}


x86 assembly (clang, -O0):
<param_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x4,%edx
call   1030 <flash_read@plt>
mov    -0xc(%rbp),%eax
movzbl -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzbl -0x7(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_read>:
push   %rax
mov    %edi,%esi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <flash_read@plt>
movzwl 0x4(%rsp),%eax
shl    $0x10,%eax
bswap  %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @param_read(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @flash_read(i8* %5, i32 %6, i32 4)
%8 = load i32, i32* %4
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %14, %18
store i32 %19, i32* %4
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @param_read(i32 %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @flash_read(i8* %3, i32 %0, i32 4)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %7, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ coredump_vacuum(int, int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  if (coredump_vacuum(-1, (off_t)-1, 70 * 1024) < 0)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


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    $0xffffffff,%esi
mov    $0x11800,%edx
mov    %esi,%edi
call   1030 <coredump_vacuum@plt>
cmp    $0x0,%rax
jge    1152 <main+0x42>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <main+0x4e>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0x11800,%edx
call   1030 <coredump_vacuum@plt>
test   %rax,%rax
jns    1133 <main+0x23>
mov    0x2eaf(%rip),%rax
jmp    113a <main+0x2a>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
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 @coredump_vacuum(i32 -1, i32 -1, i32 71680)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @EXIT_FAILURE
store i32 %9, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* @EXIT_SUCCESS
store i32 %11, i32* %3
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @coredump_vacuum(i32 -1, i32 -1, i32 71680)
%4 = icmp slt i64 %3, 0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
void invlpg(void *m) { asm volatile("invlpg (%0)" : : "b"(m) : "memory"); }


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

x86 assembly (clang, -O2):
<invlpg>:
push   %rbx
mov    %rdi,%rbx
invlpg (%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ time_internal_get(struct tm *);
int /*<<< orphan*/ time_set_nvrram(char *, struct tm *);
void time_get(char *nvrram) {
  struct tm cur_time_tm;
  time_internal_get(&cur_time_tm);
  time_set_nvrram(nvrram, &cur_time_tm);
}


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @time_get(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm
store i8* %0, i8** %2
%4 = call i32 @time_internal_get(%struct.tm* %3)
%5 = load i8*, i8** %2
%6 = call i32 @time_set_nvrram(i8* %5, %struct.tm* %3)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @time_get(i8* %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = call i32 @time_internal_get(%struct.tm* %2)
%5 = call i32 @time_set_nvrram(i8* %0, %struct.tm* %2)
ret void
}
signed long long f2(signed long long v_foo) {
  signed long long v_shr = ((unsigned long long)v_foo) >> 10;
  signed long long v_and = v_shr & 1;
  return v_and;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xa,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %rdi,%rax
shr    $0xa,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @f2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 10
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, 1
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @f2(i64 %0) {
%2 = lshr i64 %0, 10
%3 = and i64 %2, 1
ret i64 %3
}
extern struct __name1__ *******t2() { return 0; }


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

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

LLVM IR (-O0):
%struct.__name1__ = type opaque
define %struct.__name1__******* @t2() {
ret %struct.__name1__******* null
}

LLVM IR (-O2):
%struct.__name1__ = type opaque
define noalias %struct.__name1__******* @t2() {
ret %struct.__name1__******* null
}
unsigned long fls(unsigned long value) {
  __asm__("bsr %1, %0" : "=r"(value) : "rm"(value) : "cc");
  return value;
}


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

x86 assembly (clang, -O2):
<fls>:
mov    %rdi,-0x8(%rsp)
bsr    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @fls(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "bsr $1, $0", "=r,rm,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @fls(i64 %0) {
%2 = tail call i64 asm "bsr $1, $0", "=r,rm,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ isdigit(char);
int ishexa(char c) {
  if ((isdigit(c)) || ((c >= 'A') && (c <= 'F')))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ishexa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    114b <ishexa+0x3b>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1157 <ishexa+0x47>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1157 <ishexa+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <ishexa+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishexa>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
lea    -0x41(%rbx),%ecx
cmp    $0x6,%cl
setb   %cl
or     %al,%cl
movzbl %cl,%eax
neg    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ishexa(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isdigit(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 70
br i1 %14, label %15, label %16
15: ; preds = %11, %1
store i32 -1, i32* %2
br label %17
16: ; preds = %11, %7
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @ishexa(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = or i1 %5, %3
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ XFontSetExtents;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XFontSetExtents(void) {
  XFontSetExtents *_p = (XFontSetExtents *)malloc(sizeof(XFontSetExtents));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XFontSetExtents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XFontSetExtents+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XFontSetExtents>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XFontSetExtents+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XFontSetExtents() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XFontSetExtents() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Type definitions */
struct RNAplfold_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNAplfold_cmdline_parser_required(struct RNAplfold_args_info *args_info,
                                      const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<RNAplfold_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNAplfold_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAplfold_cmdline_parser_required(%struct.RNAplfold_args_info* %0, i8* %1) {
%3 = alloca %struct.RNAplfold_args_info*
%4 = alloca i8*
store %struct.RNAplfold_args_info* %0, %struct.RNAplfold_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNAplfold_args_info*, %struct.RNAplfold_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNAplfold_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNAplfold_cmdline_parser_required(%struct.RNAplfold_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int va(int, int, ...);
main() {
  assert(va(0, 1) == 0);
  assert(va(1, 2, 3, 0) == 6);
  assert(va(4, 5, 6, 7, -1, 0) == 21);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <va@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1040 <va@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x7,%ecx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
mov    $0x0,%al
call   1040 <va@plt>
cmp    $0x15,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <va@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <va@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x7,%ecx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
call   1040 <va@plt>
xor    %edi,%edi
cmp    $0x15,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (i32, i32, ...) @va(i32 0, i32 1)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 (i32, i32, ...) @va(i32 1, i32 2, i32 3, i32 0)
%6 = icmp eq i32 %5, 6
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 (i32, i32, ...) @va(i32 4, i32 5, i32 6, i32 7, i32 -1, i32 0)
%10 = icmp eq i32 %9, 21
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) @va(i32 0, i32 1)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (i32, i32, ...) @va(i32 1, i32 2, i32 3, i32 0)
%6 = icmp eq i32 %5, 6
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 (i32, i32, ...) @va(i32 4, i32 5, i32 6, i32 7, i32 -1, i32 0)
%10 = icmp eq i32 %9, 21
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}
__attribute__((always_)) unsigned long pte_index(unsigned long address) {
  return (address >> 12) & (512 - 1);
}


x86 assembly (clang, -O0):
<pte_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xc,%rax
and    $0x1ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pte_index>:
mov    %rdi,%rax
shr    $0xc,%eax
and    $0x1ff,%eax
ret

LLVM IR (-O0):
define i64 @pte_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 12
%5 = and i64 %4, 511
ret i64 %5
}

LLVM IR (-O2):
define i64 @pte_index(i64 %0) {
%2 = lshr i64 %0, 12
%3 = and i64 %2, 511
ret i64 %3
}