xunge/DecIR huggingface dataset:
const char *s_event_type_name(int event) {
  static const char *table[] = {
      "ERROR", "EXIT", "SIGNAL", "SYSCALL", "SYSRET", "QUOTA",
  };
  return table[event];
}


x86 assembly (clang, -O0):
<s_event_type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_event_type_name>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@s_event_type_name.table = internal global [6 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0)]
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [5 x i8] c"EXIT\00"
@.str.2 = [7 x i8] c"SIGNAL\00"
@.str.3 = [8 x i8] c"SYSCALL\00"
@.str.4 = [7 x i8] c"SYSRET\00"
@.str.5 = [6 x i8] c"QUOTA\00"
define i8* @s_event_type_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [6 x i8*], [6 x i8*]* @s_event_type_name.table, i64 0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
@reltable.s_event_type_name = internal unnamed_addr constant [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.s_event_type_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.s_event_type_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.s_event_type_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.3 to i64), i64 ptrtoint ([6 x i32]* @reltable.s_event_type_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([6 x i32]* @reltable.s_event_type_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.5 to i64), i64 ptrtoint ([6 x i32]* @reltable.s_event_type_name to i64)) to i32)]
@.str = [6 x i8] c"ERROR\00"
@.str.1 = [5 x i8] c"EXIT\00"
@.str.2 = [7 x i8] c"SIGNAL\00"
@.str.3 = [8 x i8] c"SYSCALL\00"
@.str.4 = [7 x i8] c"SYSRET\00"
@.str.5 = [6 x i8] c"QUOTA\00"
define i8* @s_event_type_name(i32 %0) {
%2 = sext i32 %0 to i64
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.s_event_type_name to i8*), i64 %3)
ret i8* %4
}
/* Variables and functions */
void *copy_state(void *);
void *state_copy(void *s) {
  void *c = copy_state(s);
  return c;
}


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

x86 assembly (clang, -O2):
<state_copy>:
jmp    1030 <copy_state@plt>

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

LLVM IR (-O2):
define i8* @state_copy(i8* %0) {
%2 = tail call i8* @copy_state(i8* %0)
ret i8* %2
}
void DI() {}


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

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

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

LLVM IR (-O2):
define void @DI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void h_a_end(void) { fputs("</a>", stdout); }


x86 assembly (clang, -O0):
<h_a_end>:
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):
<h_a_end>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"</a>\00"
@stdout = global i32 0
define void @h_a_end() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"</a>\00"
@stdout = global i32 0
define void @h_a_end() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void gtk_border_free() {}


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

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

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

LLVM IR (-O2):
define void @gtk_border_free() {
ret void
}
/* Variables and functions */
int need_report(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @need_report() {
ret i32 0
}
char sign(int a) {
  if (a < 0) {
    return '+';
  }
  return '-';
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111a <sign+0x1a>
movb   $0x2b,-0x1(%rbp)
jmp    111e <sign+0x1e>
movb   $0x2d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
test   %edi,%edi
setns  %al
add    %al,%al
add    $0x2b,%al
ret

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

LLVM IR (-O2):
define signext i8 @sign(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i8 43, i8 45
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_header(void) { printf("Recno GOP\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"Recno GOP\00"
define void @write_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialiseGfx(int, char **);
int /*<<< orphan*/ lanceBoucleEvenements();
int /*<<< orphan*/ prepareFenetreGraphique(char *, int, int);
int main(int argc, char **argv) {
  initialiseGfx(argc, argv);
  prepareFenetreGraphique("STRATOPOLIS", 800, 600);
  lanceBoucleEvenements();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <initialiseGfx@plt>
lea    0xea7(%rip),%rdi
mov    $0x320,%esi
mov    $0x258,%edx
call   1040 <prepareFenetreGraphique@plt>
mov    $0x0,%al
call   1050 <lanceBoucleEvenements@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <initialiseGfx@plt>
lea    0xec3(%rip),%rdi
mov    $0x320,%esi
mov    $0x258,%edx
call   1040 <prepareFenetreGraphique@plt>
xor    %eax,%eax
call   1050 <lanceBoucleEvenements@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"STRATOPOLIS\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @initialiseGfx(i32 %6, i8** %7)
%9 = call i32 @prepareFenetreGraphique(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 800, i32 600)
%10 = call i32 (...) @lanceBoucleEvenements()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"STRATOPOLIS\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @initialiseGfx(i32 %0, i8** %1)
%4 = tail call i32 @prepareFenetreGraphique(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 800, i32 600)
%5 = tail call i32 (...) @lanceBoucleEvenements()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_success(char *text) { printf("Test OK: %s\n", text); }


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

x86 assembly (clang, -O2):
<print_success>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Test OK: %s\0A\00"
define void @print_success(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void compute_add_sources_el_s3_cuda_(long *Mesh_pointer,
                                     double *h_stf_pre_compute, int *h_NSOURCES,
                                     int *h_phase_is_inner) {}


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

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

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

LLVM IR (-O2):
define void @compute_add_sources_el_s3_cuda_(i64* nocapture %0, double* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ parseArgs(int, char **);
int main(int argc, char **argv) {
  parseArgs(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parseArgs@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parseArgs@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parseArgs(i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void end_frame() {}


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

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

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

LLVM IR (-O2):
define void @end_frame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, void *);
void bar(int type, void *number) {
  switch (type) {
  case 1:
    foo(0x12345678, number);
    break;
  case 7:
    foo(0, number);
    break;
  case 8:
    foo(0, number);
    break;
  case 9:
    foo(0, number);
    break;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x8,%eax
ja     1186 <bar+0x76>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rsi
mov    $0x12345678,%edi
call   1030 <foo@plt>
jmp    1186 <bar+0x76>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <foo@plt>
jmp    1186 <bar+0x76>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <foo@plt>
jmp    1186 <bar+0x76>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
add    $0xffffffff,%edi
cmp    $0x8,%edi
ja     1122 <bar+0x12>
mov    $0x1c1,%eax
bt     %edi,%eax
jb     1123 <bar+0x13>
ret
movslq %edi,%rax
lea    0xed3(%rip),%rcx
mov    (%rcx,%rax,4),%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %18 [
i32 1, label %6
i32 7, label %9
i32 8, label %12
i32 9, label %15
]
6: ; preds = %2
%7 = load i8*, i8** %4
%8 = call i32 @foo(i32 305419896, i8* %7)
br label %18
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @foo(i32 0, i8* %10)
br label %18
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i32 @foo(i32 0, i8* %13)
br label %18
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = call i32 @foo(i32 0, i8* %16)
br label %18
18: ; preds = %2, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@switch.table.bar = [9 x i32] [i32 305419896, i32 305419896, i32 305419896, i32 305419896, i32 305419896, i32 305419896, i32 0, i32 0, i32 0]
define void @bar(i32 %0, i8* %1) {
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 9
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = trunc i32 %3 to i16
%7 = lshr i16 449, %6
%8 = and i16 %7, 1
%9 = icmp eq i16 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds [9 x i32], [9 x i32]* @switch.table.bar, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = tail call i32 @foo(i32 %13, i8* %1)
br label %15
15: ; preds = %5, %2, %10
ret void
}
int kvm_dirty_ring_reset(struct kvm *kvm, struct kvm_dirty_ring *ring) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kvm = type opaque
%struct.kvm_dirty_ring = type opaque
define i32 @kvm_dirty_ring_reset(%struct.kvm* %0, %struct.kvm_dirty_ring* %1) {
%3 = alloca %struct.kvm*
%4 = alloca %struct.kvm_dirty_ring*
store %struct.kvm* %0, %struct.kvm** %3
store %struct.kvm_dirty_ring* %1, %struct.kvm_dirty_ring** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kvm = type opaque
%struct.kvm_dirty_ring = type opaque
define i32 @kvm_dirty_ring_reset(%struct.kvm* nocapture readnone %0, %struct.kvm_dirty_ring* nocapture readnone %1) {
ret i32 0
}
double fshl(double a, double b) { return (int)a << (int)b; }


x86 assembly (clang, -O0):
<fshl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvttsd2si -0x10(%rbp),%ecx
shl    %cl,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fshl>:
cvttsd2si %xmm0,%eax
cvttsd2si %xmm1,%ecx
shl    %cl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @fshl(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptosi double %5 to i32
%7 = load double, double* %4
%8 = fptosi double %7 to i32
%9 = shl i32 %6, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @fshl(double %0, double %1) {
%3 = fptosi double %0 to i32
%4 = fptosi double %1 to i32
%5 = shl i32 %3, %4
%6 = sitofp i32 %5 to double
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void *LZ4HC_Create(int /*<<< orphan*/ const *);
int /*<<< orphan*/ LZ4HC_Free(void **);
int LZ4_compressHCCtx(void *, char const *, char *, int);
int LZ4_compressHC(const char *source, char *dest, int isize) {
  void *ctx = LZ4HC_Create((const uint8_t *)source);
  int result = LZ4_compressHCCtx(ctx, source, dest, isize);
  LZ4HC_Free(&ctx);
  return result;
}


x86 assembly (clang, -O0):
<LZ4_compressHC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <LZ4HC_Create@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <LZ4_compressHCCtx@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <LZ4HC_Free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressHC>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1050 <LZ4HC_Create@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1030 <LZ4_compressHCCtx@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1040 <LZ4HC_Free@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @LZ4_compressHC(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = call i8* @LZ4HC_Create(i32* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @LZ4_compressHCCtx(i8* %12, i8* %13, i8* %14, i32 %15)
store i32 %16, i32* %8
%17 = call i32 @LZ4HC_Free(i8** %7)
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @LZ4_compressHC(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = bitcast i8* %0 to i32*
%7 = tail call i8* @LZ4HC_Create(i32* %6)
store i8* %7, i8** %4
%8 = tail call i32 @LZ4_compressHCCtx(i8* %7, i8* %0, i8* %1, i32 %2)
%9 = call i32 @LZ4HC_Free(i8** %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int divide(int a, int b) {
  if (b == 0) {
    printf("Divide by zero!\n");
    return -1;
  }
  return a / b;
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1140 <divide+0x30>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <divide+0x3a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
test   %esi,%esi
je     111a <divide+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Divide by zero!\0A\00"
define i32 @divide(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = sdiv i32 %11, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %10, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@str = [16 x i8] c"Divide by zero!\00"
define i32 @divide(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = sdiv i32 %0, %1
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ tek_enable(int);
int tek_clear(const char *the_title) {
  tek_enable(1);
  esc("\014");
  tek_enable(0);
  return (0);
}


x86 assembly (clang, -O0):
<tek_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <tek_enable@plt>
lea    0xec3(%rip),%rdi
call   1030 <esc@plt>
xor    %edi,%edi
call   1040 <tek_enable@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tek_clear>:
push   %rax
mov    $0x1,%edi
call   1040 <tek_enable@plt>
lea    0xece(%rip),%rdi
call   1030 <esc@plt>
xor    %edi,%edi
call   1040 <tek_enable@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0C\00"
define i32 @tek_clear(i8* nocapture readnone %0) {
%2 = tail call i32 @tek_enable(i32 1)
%3 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @tek_enable(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int f10_handler(char **save) {
  write_instr(0x00);
  write_imm(0x43);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<f10_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x43,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x43,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f10_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 67)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @f10_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 67)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void io_error(int e) {
  fprintf(stderr, "There was an I/O error (%d). This is pretty bad!\n", e);
  exit(1);
}


x86 assembly (clang, -O0):
<io_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<io_error>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"There was an I/O error (%d). This is pretty bad!\0A\00"
define void @io_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"There was an I/O error (%d). This is pretty bad!\0A\00"
define void @io_error(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int string_character_position(char *, char);
int string_character_exists(char *data, char c) {
  return string_character_position(data, c);
}


x86 assembly (clang, -O0):
<string_character_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <string_character_position@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_character_exists>:
jmp    1030 <string_character_position@plt>

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

LLVM IR (-O2):
define i32 @string_character_exists(i8* %0, i8 signext %1) {
%3 = tail call i32 @string_character_position(i8* %0, i8 signext %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ inform_user(char *);
void print_version(void) {
  inform_user(
      "conntest (Torpman's Test Tools) 0.1\n"
      "Copyright (C) 2012 Peter R. Torpman (peter@torpman.se)\n"
      "This is free software.  \nYou may redistribute copies of it under "
      "the terms of the GNU General Public License \n"
      "<http://www.gnu.org/licenses/gpl.html>.\n"
      "There is NO WARRANTY, to the extent permitted by law.\n");
}


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

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

LLVM IR (-O0):
@.str = [296 x i8] c"conntest (Torpman's Test Tools) 0.1\0ACopyright (C) 2012 Peter R. Torpman (peter@torpman.se)\0AThis is free software. \0AYou may redistribute copies of it under the terms of the GNU General Public License \0A<http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define void @print_version() {
%1 = call i32 @inform_user(i8* getelementptr inbounds ([296 x i8], [296 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [296 x i8] c"conntest (Torpman's Test Tools) 0.1\0ACopyright (C) 2012 Peter R. Torpman (peter@torpman.se)\0AThis is free software. \0AYou may redistribute copies of it under the terms of the GNU General Public License \0A<http://www.gnu.org/licenses/gpl.html>.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define void @print_version() {
%1 = tail call i32 @inform_user(i8* getelementptr inbounds ([296 x i8], [296 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ ssh_set_error(char *);
void *ssh_realloc(void *p, size_t size) {
  void *ret = realloc(p, size);
  if (ret == NULL)
    ssh_set_error("out of memory");
  return ret;
}


x86 assembly (clang, -O0):
<ssh_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <ssh_realloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <ssh_set_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_realloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <ssh_realloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <ssh_set_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @ssh_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @ssh_set_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @ssh_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @ssh_set_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void roadmap_screen_obj_decode_arg(char *output, int o_size, const char *input,
                                   int i_size) {
  int size;
  o_size -= 1;
  size = i_size < o_size ? i_size : o_size;
  strncpy(output, input, size);
  output[size] = '\0';
}


x86 assembly (clang, -O0):
<roadmap_screen_obj_decode_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1146 <roadmap_screen_obj_decode_arg+0x36>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    114c <roadmap_screen_obj_decode_arg+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_screen_obj_decode_arg>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
add    $0xffffffff,%ebx
cmp    %ecx,%ebx
cmovg  %ecx,%ebx
mov    %rdx,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @roadmap_screen_obj_decode_arg(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = add nsw i32 %1, -1
%6 = icmp sgt i32 %5, %3
%7 = select i1 %6, i32 %3, i32 %5
%8 = tail call i32 @strncpy(i8* %0, i8* %2, i32 %7)
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prt_afraid();
int /*<<< orphan*/ prt_blind();
int /*<<< orphan*/ prt_confused();
int /*<<< orphan*/ prt_cut();
int /*<<< orphan*/ prt_dtrap();
int /*<<< orphan*/ prt_hunger();
int /*<<< orphan*/ prt_poisoned();
int /*<<< orphan*/ prt_speed();
int /*<<< orphan*/ prt_state();
int /*<<< orphan*/ prt_study();
int /*<<< orphan*/ prt_stun();
void prt_frame_extra(void) {
  prt_cut();
  prt_stun();
  prt_hunger();
  prt_blind();
  prt_confused();
  prt_afraid();
  prt_poisoned();
  prt_dtrap();
  prt_state();
  prt_speed();
  prt_study();
}


x86 assembly (clang, -O0):
<prt_frame_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10d0 <prt_cut@plt>
mov    $0x0,%al
call   10c0 <prt_stun@plt>
mov    $0x0,%al
call   1070 <prt_hunger@plt>
mov    $0x0,%al
call   1080 <prt_blind@plt>
mov    $0x0,%al
call   1040 <prt_confused@plt>
mov    $0x0,%al
call   1060 <prt_afraid@plt>
mov    $0x0,%al
call   10a0 <prt_poisoned@plt>
mov    $0x0,%al
call   1090 <prt_dtrap@plt>
mov    $0x0,%al
call   1050 <prt_state@plt>
mov    $0x0,%al
call   10b0 <prt_speed@plt>
mov    $0x0,%al
call   1030 <prt_study@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prt_frame_extra>:
push   %rax
xor    %eax,%eax
call   10d0 <prt_cut@plt>
xor    %eax,%eax
call   10c0 <prt_stun@plt>
xor    %eax,%eax
call   1070 <prt_hunger@plt>
xor    %eax,%eax
call   1080 <prt_blind@plt>
xor    %eax,%eax
call   1040 <prt_confused@plt>
xor    %eax,%eax
call   1060 <prt_afraid@plt>
xor    %eax,%eax
call   10a0 <prt_poisoned@plt>
xor    %eax,%eax
call   1090 <prt_dtrap@plt>
xor    %eax,%eax
call   1050 <prt_state@plt>
xor    %eax,%eax
call   10b0 <prt_speed@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <prt_study@plt>

LLVM IR (-O0):
define void @prt_frame_extra() {
%1 = call i32 (...) @prt_cut()
%2 = call i32 (...) @prt_stun()
%3 = call i32 (...) @prt_hunger()
%4 = call i32 (...) @prt_blind()
%5 = call i32 (...) @prt_confused()
%6 = call i32 (...) @prt_afraid()
%7 = call i32 (...) @prt_poisoned()
%8 = call i32 (...) @prt_dtrap()
%9 = call i32 (...) @prt_state()
%10 = call i32 (...) @prt_speed()
%11 = call i32 (...) @prt_study()
ret void
}

LLVM IR (-O2):
define void @prt_frame_extra() {
%1 = tail call i32 (...) @prt_cut()
%2 = tail call i32 (...) @prt_stun()
%3 = tail call i32 (...) @prt_hunger()
%4 = tail call i32 (...) @prt_blind()
%5 = tail call i32 (...) @prt_confused()
%6 = tail call i32 (...) @prt_afraid()
%7 = tail call i32 (...) @prt_poisoned()
%8 = tail call i32 (...) @prt_dtrap()
%9 = tail call i32 (...) @prt_state()
%10 = tail call i32 (...) @prt_speed()
%11 = tail call i32 (...) @prt_study()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void badtime(void) { errx(1, "bad time format"); }


x86 assembly (clang, -O0):
<badtime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<badtime>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"bad time format\00"
define void @badtime() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"bad time format\00"
define void @badtime() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void BN_mod_exp_mont_word(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_exp_mont_word() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_destroy(int /*<<< orphan*/);
int /*<<< orphan*/ process_get_current();
void process_exit() { process_destroy(process_get_current()); }


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

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

LLVM IR (-O0):
define void @process_exit() {
%1 = call i32 (...) @process_get_current()
%2 = call i32 @process_destroy(i32 %1)
ret void
}

LLVM IR (-O2):
define void @process_exit() {
%1 = tail call i32 (...) @process_get_current()
%2 = tail call i32 @process_destroy(i32 %1)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ printf(char *);
void twatch_start(struct timespec *start) {
  if (clock_gettime(CLOCK_MONOTONIC, start) != 0) {
    printf("gettime failed\n");
  }
}


x86 assembly (clang, -O0):
<twatch_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
je     1154 <twatch_start+0x34>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twatch_start>:
push   %rax
mov    %rdi,%rsi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1040 <clock_gettime@plt>
test   %rax,%rax
je     1144 <twatch_start+0x24>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [16 x i8] c"gettime failed\0A\00"
define void @twatch_start(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = call i64 @clock_gettime(i32 %3, %struct.timespec* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@str = [15 x i8] c"gettime failed\00"
define void @twatch_start(%struct.timespec* %0) {
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = tail call i64 @clock_gettime(i32 %2, %struct.timespec* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t peek4(uint8_t *data) {
  return (((uint32_t)data[3]) << 24) | (((uint32_t)data[2]) << 16) |
         (((uint32_t)data[1]) << 8) | data[0];
}


x86 assembly (clang, -O0):
<peek4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek4>:
mov    0xc(%rdi),%ecx
shl    $0x18,%ecx
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
or     %ecx,%edx
shl    $0x8,%eax
or     %edx,%eax
or     (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @peek4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = load i32, i32* %0
%14 = or i32 %12, %13
ret i32 %14
}
int twoToThe(int x) {
  int output = 2;
  for (x; x > 1; x--)
    output *= 2;
  return output;
}


x86 assembly (clang, -O0):
<twoToThe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <twoToThe+0x2f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <twoToThe+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twoToThe>:
mov    $0x2,%eax
cmp    $0x2,%edi
jl     112a <twoToThe+0x2a>
add    $0x1,%edi
mov    $0x2,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1120 <twoToThe+0x20>
ret

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

LLVM IR (-O2):
define i32 @twoToThe(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 2, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = shl nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 2
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 2, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int strftime(char *, int, char *, int /*<<< orphan*/);
int date(char *strdate, int taillestr, time_t *tm) {
  return strftime(strdate, taillestr, "%F %H:%M:%S", gmtime(tm));
}


x86 assembly (clang, -O0):
<date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <gmtime@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%ecx
lea    0xea6(%rip),%rdx
call   1030 <strftime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <gmtime@plt>
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strftime@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%F %H:%M:%S\00"
define i32 @date(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 i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @gmtime(i32* %9)
%11 = call i32 @strftime(i8* %7, i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"%F %H:%M:%S\00"
define i32 @date(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @gmtime(i32* %2)
%5 = tail call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ singlyLL();
int main(void) {
  printf("Welcome, this program demonstrates the doubly linked list\n");
  singlyLL();
  return 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>
mov    $0x0,%al
call   1040 <singlyLL@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [59 x i8] c"Welcome, this program demonstrates the doubly linked list\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @singlyLL()
ret i32 0
}

LLVM IR (-O2):
@str = [58 x i8] c"Welcome, this program demonstrates the doubly linked list\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @singlyLL()
ret i32 0
}
double bor_wrapper(double *arg_list) {
  return (double)((int)arg_list[0] || (int)arg_list[1]);
}


x86 assembly (clang, -O0):
<bor_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1130 <bor_wrapper+0x30>
mov    -0x8(%rbp),%rax
cvttsd2si 0x8(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bor_wrapper>:
cvttsd2si (%rdi),%eax
test   %eax,%eax
jne    1115 <bor_wrapper+0x15>
cvttsd2si 0x8(%rdi),%eax
test   %eax,%eax
jne    1115 <bor_wrapper+0x15>
xorps  %xmm0,%xmm0
ret
movsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @bor_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fptosi double %11 to i32
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ true, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @bor_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fptosi double %7 to i32
%9 = icmp ne i32 %8, 0
%10 = uitofp i1 %9 to double
br label %11
11: ; preds = %5, %1
%12 = phi double [ 1.000000e+00, %1 ], [ %10, %5 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  if (1) {
    goto abc;
  }
  printf("没有goto\n");
abc:
  printf("来到这里\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <main+0x9>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"\E6\9D\A5\E5\88\B0\E8\BF\99\E9\87\8C\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"\E6\9D\A5\E5\88\B0\E8\BF\99\E9\87\8C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int MCL_CURRENT;
int MCL_FUTURE;
scalar_t__ mlockall(int);
int main(int argc, char **argv) {
  return (mlockall(MCL_CURRENT | MCL_FUTURE) == 0) ? 0 : 1;
}


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    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    0x2eba(%rip),%rax
or     (%rax),%edi
call   1030 <mlockall@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2ed1(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <mlockall@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = 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 = load i32, i32* @MCL_CURRENT
%7 = load i32, i32* @MCL_FUTURE
%8 = or i32 %6, %7
%9 = call i64 @mlockall(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
ret i32 %12
}

LLVM IR (-O2):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @MCL_CURRENT
%4 = load i32, i32* @MCL_FUTURE
%5 = or i32 %4, %3
%6 = tail call i64 @mlockall(i32 %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}