xunge/DecIR huggingface dataset:
int main() {
  int a = 2;
  if (1) {
    a = 5;
  } else {
    a = 7;
  }
  int b = a - 5;
  if (b) {
    return 4;
  }
  return 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1138 <main+0x38>
movl   $0x4,-0x4(%rbp)
jmp    113f <main+0x3f>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
char *afshelpers_helpers_nextLine(char *line) {
  while (*line != '\n')
    line++;
  line++;
  return line;
}


x86 assembly (clang, -O0):
<afshelpers_helpers_nextLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1129 <afshelpers_helpers_nextLine+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <afshelpers_helpers_nextLine+0x8>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<afshelpers_helpers_nextLine>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0xa,(%rax)
lea    0x1(%rax),%rax
jne    1110 <afshelpers_helpers_nextLine+0x10>
ret

LLVM IR (-O0):
define i8* @afshelpers_helpers_nextLine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @afshelpers_helpers_nextLine(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 10
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char *);
scalar_t__ pit_arg_is_option(char **);
int pit_arg_option(char **arg) {
  if (pit_arg_is_option(arg)) {
    return *(*arg + 1);
  } else {
    die("invalid option: %s", *arg);
    return 0;
  }
}


x86 assembly (clang, -O0):
<pit_arg_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <pit_arg_is_option@plt>
cmp    $0x0,%rax
je     1152 <pit_arg_option+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <pit_arg_option+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea0(%rip),%rdi
call   1040 <die@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_arg_option>:
push   %rbx
mov    %rdi,%rbx
call   1030 <pit_arg_is_option@plt>
mov    (%rbx),%rsi
test   %rax,%rax
je     1137 <pit_arg_option+0x17>
movsbl 0x1(%rsi),%eax
pop    %rbx
ret
lea    0xec2(%rip),%rdi
call   1040 <die@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"invalid option: %s\00"
define i32 @pit_arg_option(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = call i64 @pit_arg_is_option(i8** %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
store i32 %12, i32* %2
br label %17
13: ; preds = %1
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %15)
store i32 0, i32* %2
br label %17
17: ; preds = %13, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [19 x i8] c"invalid option: %s\00"
define i32 @pit_arg_option(i8** %0) {
%2 = tail call i64 @pit_arg_is_option(i8** %0)
%3 = icmp eq i64 %2, 0
%4 = load i8*, i8** %0
br i1 %3, label %9, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
br label %11
9: ; preds = %1
%10 = tail call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %8, %5 ], [ 0, %9 ]
ret i32 %12
}
/* Type definitions */
struct XCSF {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ param_set_gamma(struct XCSF *, double);
int /*<<< orphan*/ param_set_p_explore(struct XCSF *, double);
int /*<<< orphan*/ param_set_teletransportation(struct XCSF *, int);
void param_defaults_multistep(struct XCSF *xcsf) {
  param_set_gamma(xcsf, 0.95);
  param_set_teletransportation(xcsf, 50);
  param_set_p_explore(xcsf, 0.9);
}


x86 assembly (clang, -O0):
<param_defaults_multistep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xec0(%rip),%xmm0
call   1050 <param_set_gamma@plt>
mov    -0x8(%rbp),%rdi
mov    $0x32,%esi
call   1030 <param_set_teletransportation@plt>
mov    -0x8(%rbp),%rdi
movsd  0xe99(%rip),%xmm0
call   1040 <param_set_p_explore@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_defaults_multistep>:
push   %rbx
mov    %rdi,%rbx
movsd  0xec4(%rip),%xmm0
call   1050 <param_set_gamma@plt>
mov    %rbx,%rdi
mov    $0x32,%esi
call   1030 <param_set_teletransportation@plt>
movsd  0xeb2(%rip),%xmm0
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <param_set_p_explore@plt>

LLVM IR (-O0):
%struct.XCSF = type { i32 }
define void @param_defaults_multistep(%struct.XCSF* %0) {
%2 = alloca %struct.XCSF*
store %struct.XCSF* %0, %struct.XCSF** %2
%3 = load %struct.XCSF*, %struct.XCSF** %2
%4 = call i32 @param_set_gamma(%struct.XCSF* %3, double 0x3FEE666666666666)
%5 = load %struct.XCSF*, %struct.XCSF** %2
%6 = call i32 @param_set_teletransportation(%struct.XCSF* %5, i32 50)
%7 = load %struct.XCSF*, %struct.XCSF** %2
%8 = call i32 @param_set_p_explore(%struct.XCSF* %7, double 9.000000e-01)
ret void
}

LLVM IR (-O2):
%struct.XCSF = type { i32 }
define void @param_defaults_multistep(%struct.XCSF* %0) {
%2 = tail call i32 @param_set_gamma(%struct.XCSF* %0, double 0x3FEE666666666666)
%3 = tail call i32 @param_set_teletransportation(%struct.XCSF* %0, i32 50)
%4 = tail call i32 @param_set_p_explore(%struct.XCSF* %0, double 9.000000e-01)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memory_bailout();
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *newstr;
  if ((newstr = strdup(str)) == NULL)
    memory_bailout();
  return (newstr);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <xstrdup+0x2a>
mov    $0x0,%al
call   1030 <memory_bailout@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xstrdup+0x15>
xor    %eax,%eax
call   1030 <memory_bailout@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
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 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @memory_bailout()
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
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 %6
4: ; preds = %1
%5 = tail call i32 (...) @memory_bailout()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
struct pdp_t {
  int dummy;
};
struct gsn_t {
  int dummy;
};

/* Variables and functions */
int pdp_freepdp(struct pdp_t *);
int gtp_freepdp(struct gsn_t *gsn, struct pdp_t *pdp) {
  return pdp_freepdp(pdp);
}


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

x86 assembly (clang, -O2):
<gtp_freepdp>:
mov    %rsi,%rdi
jmp    1030 <pdp_freepdp@plt>

LLVM IR (-O0):
%struct.gsn_t = type { i32 }
%struct.pdp_t = type { i32 }
define i32 @gtp_freepdp(%struct.gsn_t* %0, %struct.pdp_t* %1) {
%3 = alloca %struct.gsn_t*
%4 = alloca %struct.pdp_t*
store %struct.gsn_t* %0, %struct.gsn_t** %3
store %struct.pdp_t* %1, %struct.pdp_t** %4
%5 = load %struct.pdp_t*, %struct.pdp_t** %4
%6 = call i32 @pdp_freepdp(%struct.pdp_t* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.gsn_t = type { i32 }
%struct.pdp_t = type { i32 }
define i32 @gtp_freepdp(%struct.gsn_t* nocapture readnone %0, %struct.pdp_t* %1) {
%3 = tail call i32 @pdp_freepdp(%struct.pdp_t* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void om_gps_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<om_gps_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @om_gps_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
struct kvm_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ KVM_SET_REGS;
int ioctl(int, int /*<<< orphan*/, struct kvm_regs const *);
int kvm_set_regs(int fd, const struct kvm_regs *regs) {
  return ioctl(fd, KVM_SET_REGS, regs);
}


x86 assembly (clang, -O0):
<kvm_set_regs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_set_regs>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.kvm_regs = type { i32 }
@KVM_SET_REGS = global i32 0
define i32 @kvm_set_regs(i32 %0, %struct.kvm_regs* %1) {
%3 = alloca i32
%4 = alloca %struct.kvm_regs*
store i32 %0, i32* %3
store %struct.kvm_regs* %1, %struct.kvm_regs** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @KVM_SET_REGS
%7 = load %struct.kvm_regs*, %struct.kvm_regs** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.kvm_regs* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.kvm_regs = type { i32 }
@KVM_SET_REGS = global i32 0
define i32 @kvm_set_regs(i32 %0, %struct.kvm_regs* %1) {
%3 = load i32, i32* @KVM_SET_REGS
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.kvm_regs* %1)
ret i32 %4
}
/* Variables and functions */
char *get_argument_str(char *);
char *get_password() {
  char *result = "";
  result = get_argument_str("password");
  return result;
}


x86 assembly (clang, -O0):
<get_password>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <get_argument_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"password\00"
define i8* @get_password() {
%1 = alloca i8*
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i8* @get_argument_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"password\00"
define i8* @get_password() {
%1 = tail call i8* @get_argument_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
void rtc_mem_write(uint32_t addr, uint32_t val) {
  ((uint32_t *)0x60001200)[addr] = val;
}


x86 assembly (clang, -O0):
<rtc_mem_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x60001200,%eax
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_mem_write>:
mov    %rsi,0x60001200(,%rdi,8)
60
ret

LLVM IR (-O0):
define void @rtc_mem_write(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = getelementptr inbounds i64, i64* inttoptr (i64 1610617344 to i64*), i64 %6
store i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @rtc_mem_write(i64 %0, i64 %1) {
%3 = getelementptr inbounds i64, i64* inttoptr (i64 1610617344 to i64*), i64 %0
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ send_cmd(int, char *, int);
void send_cmd_i1d1(int cmd_code, int arg1, double arg2) {
  struct {
    int ival;
    double dval;
  } buf;
  buf.ival = arg1;
  buf.dval = arg2;
  send_cmd(cmd_code, (char *)&buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<send_cmd_i1d1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1030 <send_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd_i1d1>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x10,%edx
call   1030 <send_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i32, double }
define void @send_cmd_i1d1(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca %struct.anon
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load double, double* %6
%11 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 1
store double %10, double* %11
%12 = load i32, i32* %4
%13 = bitcast %struct.anon* %7 to i8*
%14 = call i32 @send_cmd(i32 %12, i8* %13, i32 16)
ret void
}

LLVM IR (-O2):
%struct.anon = type { i32, double }
define void @send_cmd_i1d1(i32 %0, i32 %1, double %2) {
%4 = alloca %struct.anon
%5 = bitcast %struct.anon* %4 to i8*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 1
store double %2, double* %7
%8 = call i32 @send_cmd(i32 %0, i8* %5, i32 16)
ret void
}
char *sha_version(void) {
  static char *version = "SHA-1";
  return (version);
}


x86 assembly (clang, -O0):
<sha_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@sha_version.version = internal global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"SHA-1\00"
define i8* @sha_version() {
%1 = load i8*, i8** @sha_version.version
ret i8* %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"SHA-1\00"
define i8* @sha_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void music_restoreplaylist(void) {}


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

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

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

LLVM IR (-O2):
define void @music_restoreplaylist() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __cxa_throw(void *, void *, void *);
void _ITM_cxa_throw(void *obj, void *tinfo, void *dest) {
  __cxa_throw(obj, tinfo, dest);
}


x86 assembly (clang, -O0):
<_ITM_cxa_throw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__cxa_throw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ITM_cxa_throw>:
jmp    1030 <__cxa_throw@plt>

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

LLVM IR (-O2):
define void @_ITM_cxa_throw(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @__cxa_throw(i8* %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ service_fona_call_guide();
void call_guide_in_main_loop() { service_fona_call_guide(); }


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

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

LLVM IR (-O0):
define void @call_guide_in_main_loop() {
%1 = call i32 (...) @service_fona_call_guide()
ret void
}

LLVM IR (-O2):
define void @call_guide_in_main_loop() {
%1 = tail call i32 (...) @service_fona_call_guide()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort(int *, int, int);
int /*<<< orphan*/ limited_quicksort(int *, int, int, int);
void modified_quicksort(int A[], int p, int r) {
  limited_quicksort(A, p, r, 550);
  insertion_sort(A, p, r);
}


x86 assembly (clang, -O0):
<modified_quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x226,%ecx
call   1030 <limited_quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <insertion_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modified_quicksort>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x226,%ecx
call   1030 <limited_quicksort@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <insertion_sort@plt>

LLVM IR (-O0):
define void @modified_quicksort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @limited_quicksort(i32* %7, i32 %8, i32 %9, i32 550)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @insertion_sort(i32* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @modified_quicksort(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @limited_quicksort(i32* %0, i32 %1, i32 %2, i32 550)
%5 = tail call i32 @insertion_sort(i32* %0, i32 %1, i32 %2)
ret void
}
void MD5_Transform(void) {}


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

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

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

LLVM IR (-O2):
define void @MD5_Transform() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void usage(char **argv) {
  printf("Usage: %s -c <name_graph.csv> -v\n", argv[0]);
  puts("");
  puts("Creates a graph.db from a graph.csv.");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rdi),%rsi
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: %s -c <name_graph.csv> -v\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [37 x i8] c"Creates a graph.db from a graph.csv.\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: %s -c <name_graph.csv> -v\0A\00"
@.str.2 = [37 x i8] c"Creates a graph.db from a graph.csv.\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void closedirp(DIR **dp) {
  if (*dp)
    closedir(*dp);
}


x86 assembly (clang, -O0):
<closedirp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <closedirp+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closedirp>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <closedirp+0xd>
jmp    1030 <closedir@plt>
ret

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

LLVM IR (-O2):
define void @closedirp(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
void VMR3Reset(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3Reset() {
ret void
}
/* Type definitions */
struct _Locale_ctype {
  int dummy;
};

/* Variables and functions */
int tolower(int);
int _Locale_tolower(struct _Locale_ctype *lctype __attribute__((__unused__)),
                    int c) {
  return tolower(c);
}


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

x86 assembly (clang, -O2):
<_Locale_tolower>:
mov    %esi,%edi
jmp    1030 <tolower@plt>

LLVM IR (-O0):
%struct._Locale_ctype = type { i32 }
define i32 @_Locale_tolower(%struct._Locale_ctype* %0, i32 %1) {
%3 = alloca %struct._Locale_ctype*
%4 = alloca i32
store %struct._Locale_ctype* %0, %struct._Locale_ctype** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @tolower(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct._Locale_ctype = type { i32 }
define i32 @_Locale_tolower(%struct._Locale_ctype* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @tolower(i32 %1)
ret i32 %3
}
int add_stuff2(int a, int b) { return 2 + a + b; }


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

x86 assembly (clang, -O2):
<add_stuff2>:
lea    (%rdi,%rsi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @add_stuff2(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 = add nsw i32 2, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @add_stuff2(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 2
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ gen_is_hsw(int);
int gen_get_hsw_gt(int devid) {
  assert(gen_is_hsw(devid));
  return ((devid & 0x30) >> 4) + 1;
}


x86 assembly (clang, -O0):
<gen_get_hsw_gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gen_is_hsw@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
and    $0x30,%eax
sar    $0x4,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_get_hsw_gt>:
push   %rbx
mov    %edi,%ebx
call   1040 <gen_is_hsw@plt>
mov    %eax,%edi
call   1030 <assert@plt>
shr    $0x4,%ebx
and    $0x3,%ebx
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_get_hsw_gt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gen_is_hsw(i32 %3)
%5 = call i32 @assert(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 48
%8 = ashr i32 %7, 4
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @gen_get_hsw_gt(i32 %0) {
%2 = tail call i32 @gen_is_hsw(i32 %0)
%3 = tail call i32 @assert(i32 %2)
%4 = lshr i32 %0, 4
%5 = and i32 %4, 3
%6 = add nuw nsw i32 %5, 1
ret i32 %6
}
void rop3_93_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_93_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_93_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_93_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = and i32 %43, %45
%47 = or i32 %40, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i8, i8* %6
%52 = zext i8 %51 to i32
%53 = and i32 %50, %52
%54 = or i32 %47, %53
%55 = trunc i32 %54 to i8
%56 = load i8*, i8** %4
store i8 %55, i8* %56
ret void
}

LLVM IR (-O2):
define void @rop3_93_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
int filter_record(struct tracecmd_input *handle, struct pevent_record *record) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tracecmd_input = type opaque
%struct.pevent_record = type opaque
define i32 @filter_record(%struct.tracecmd_input* nocapture readnone %0, %struct.pevent_record* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TestArrayList();
int /*<<< orphan*/ TestLinkedList();
int /*<<< orphan*/ TestLinkedStack();
int main(void) {
  TestArrayList();
  TestLinkedList();
  TestLinkedStack();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestArrayList()
%2 = tail call i32 (...) @TestLinkedList()
%3 = tail call i32 (...) @TestLinkedStack()
ret i32 0
}
int md_dsuspchar() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @md_dsuspchar() {
ret i32 0
}
char *move_to_end(char *p) {
  char *p1;
  p1 = p;
  while (*p1 != '\r' && *p1 != '\n' && *p1 != '\0')
    p1++;
  return p1;
}


x86 assembly (clang, -O0):
<move_to_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x11(%rbp)
je     114a <move_to_end+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     114a <move_to_end+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <move_to_end+0x5a>
jmp    116b <move_to_end+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <move_to_end+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_to_end>:
mov    %rdi,%rax
mov    $0x2401,%ecx
jmp    1114 <move_to_end+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0xd,%rdx
ja     1110 <move_to_end+0x10>
bt     %rdx,%rcx
jae    1110 <move_to_end+0x10>
ret

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

LLVM IR (-O2):
define i8* @move_to_end(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 13, label %7
i8 10, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int read(int /*<<< orphan*/, unsigned char *, int);
int stdin_rx_chr(void) {
  unsigned char c = 0;
  int r = read(0, &c, 1);
  (void)r;
  return c;
}


x86 assembly (clang, -O0):
<stdin_rx_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_rx_chr>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stdin_rx_chr() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
%3 = call i32 @read(i32 0, i8* %1, i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @stdin_rx_chr() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}
float nvg__signf(float a) { return a >= 0.0f ? 1.0f : -1.0f; }


x86 assembly (clang, -O0):
<nvg__signf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm0,%xmm0
cmpless %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvg__signf>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @nvg__signf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float 1.000000e+00, float -1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @nvg__signf(float %0) {
%2 = fcmp oge float %0, 0.000000e+00
%3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
ret float %3
}
int reverse_int(int n) {
  int reversed = 0;
  while (n) {
    reversed = reversed * 10 + (n % 10);
    n = n / 10;
  }
  return reversed;
}


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

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

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

LLVM IR (-O2):
define i32 @reverse_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
char *PbAllocCb(cb)
unsigned cb;
{
  char *pb;
  if ((pb = (char *)malloc(cb)) == 0)
    Error("out of memory in PbAllocCb (%d)", cb);
  return pb;
}


x86 assembly (clang, -O0):
<PbAllocCb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <PbAllocCb+0x34>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <Error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PbAllocCb>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <PbAllocCb+0x24>
lea    0xec5(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <Error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"out of memory in PbAllocCb (%d)\00"
define i8* @PbAllocCb(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @Error to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int checker_read_long_double(int, char const *, int, long double *);
int checker_read_out_long_double(const char *name, int eof_error_flag,
                                 long double *p_val) {
  return checker_read_long_double(1, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_out_long_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <checker_read_long_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_out_long_double>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <checker_read_long_double@plt>

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

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

/* Variables and functions */
int decode_atom_format_6_1(unsigned char const *, struct stream *);
int decode_atom_format_6_2(const unsigned char *pkt, struct stream *stream) {
  return decode_atom_format_6_1(pkt, stream);
}


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

x86 assembly (clang, -O2):
<decode_atom_format_6_2>:
jmp    1030 <decode_atom_format_6_1@plt>

LLVM IR (-O0):
%struct.stream = type { i32 }
define i32 @decode_atom_format_6_2(i8* %0, %struct.stream* %1) {
%3 = alloca i8*
%4 = alloca %struct.stream*
store i8* %0, i8** %3
store %struct.stream* %1, %struct.stream** %4
%5 = load i8*, i8** %3
%6 = load %struct.stream*, %struct.stream** %4
%7 = call i32 @decode_atom_format_6_1(i8* %5, %struct.stream* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_atom_format_6_2(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_atom_format_6_1(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_at(int /*<<< orphan*/);
int /*<<< orphan*/ shl();
void shl_by_at(uint32_t x) {
  by_at(x);
  shl();
}


x86 assembly (clang, -O0):
<shl_by_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <by_at@plt>
mov    $0x0,%al
call   1030 <shl@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @shl_by_at(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_at(i32 %3)
%5 = call i32 (...) @shl()
ret void
}

LLVM IR (-O2):
define void @shl_by_at(i32 %0) {
%2 = tail call i32 @by_at(i32 %0)
%3 = tail call i32 (...) @shl()
ret void
}
/* Variables and functions */
scalar_t__ cmd_opt_comments();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void print(char *x, char *y) {
  fputs(x, stdout);
  if (cmd_opt_comments())
    printf("\t\t(%s)", y);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
call   1050 <fputs@plt>
mov    $0x0,%al
call   1060 <cmd_opt_comments@plt>
cmp    $0x0,%rax
je     1183 <print+0x43>
mov    -0x10(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rsi,%rbx
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1050 <fputs@plt>
xor    %eax,%eax
call   1060 <cmd_opt_comments@plt>
test   %rax,%rax
je     116d <print+0x2d>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"\09\09(%s)\00"
define void @print(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = call i64 (...) @cmd_opt_comments()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
%14 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"\09\09(%s)\00"
define void @print(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = tail call i64 (...) @cmd_opt_comments()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
9: ; preds = %7, %2
%10 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_metadata_array_add() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_metadata_array_add>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_metadata_array_add>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_add() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_metadata_array_add() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int CMD_CallDLL_quick_check_memory(void *addr) {
  int ret = 0;
  if (!addr)
    return (-1);
  return (ret);
}


x86 assembly (clang, -O0):
<CMD_CallDLL_quick_check_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <CMD_CallDLL_quick_check_memory+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    112c <CMD_CallDLL_quick_check_memory+0x2c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMD_CallDLL_quick_check_memory>:
cmp    $0x1,%rdi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @CMD_CallDLL_quick_check_memory(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = sext i1 %2 to i32
ret i32 %3
}