xunge/DecIR huggingface dataset:
/* Variables and functions */
float fastercos(float);
float fastersin(float);
float fastertan(float x) { return fastersin(x) / fastercos(x); }


x86 assembly (clang, -O0):
<fastertan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <fastersin@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fastercos@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastertan>:
push   %rax
movss  %xmm0,(%rsp)
call   1040 <fastersin@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <fastercos@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fastertan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fastersin(float %3)
%5 = load float, float* %2
%6 = call float @fastercos(float %5)
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @fastertan(float %0) {
%2 = tail call float @fastersin(float %0)
%3 = tail call float @fastercos(float %0)
%4 = fdiv float %2, %3
ret float %4
}
int hdd_dpm_register_dev(struct hdd_dpm_ops *dpm_ops) { return 0; }


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

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

LLVM IR (-O0):
%struct.hdd_dpm_ops = type opaque
define i32 @hdd_dpm_register_dev(%struct.hdd_dpm_ops* %0) {
%2 = alloca %struct.hdd_dpm_ops*
store %struct.hdd_dpm_ops* %0, %struct.hdd_dpm_ops** %2
ret i32 0
}

LLVM IR (-O2):
%struct.hdd_dpm_ops = type opaque
define i32 @hdd_dpm_register_dev(%struct.hdd_dpm_ops* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
double __double_from_uint64_t(uint64_t value) { return *(double *)&value; }


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

x86 assembly (clang, -O2):
<__double_from_uint64_t>:
mov    %edi,-0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @__double_from_uint64_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to double*
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @__double_from_uint64_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to double*
%4 = load double, double* %3
ret double %4
}
/* Variables and functions */
int atan(double);
double r2a_ster(double R, double K) { return 2 * atan(R); }


x86 assembly (clang, -O0):
<r2a_ster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2a_ster>:
push   %rax
call   1030 <atan@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @r2a_ster(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 = call i32 @atan(double %5)
%7 = mul nsw i32 2, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @r2a_ster(double %0, double %1) {
%3 = tail call i32 @atan(double %0)
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to double
ret double %5
}
double sbf_inital_probability(double fp_prob, double r) {
  return (1 - r) * fp_prob;
}


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

x86 assembly (clang, -O2):
<sbf_inital_probability>:
movsd  0xef8(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @sbf_inital_probability(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fsub double 1.000000e+00, %5
%7 = load double, double* %3
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @sbf_inital_probability(double %0, double %1) {
%3 = fsub double 1.000000e+00, %1
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_subb_direct(char *str, uint8_t direct) {
  sprintf(str,
          "SUBB  A, "
          "0x%02X"
          "                   ",
          direct);
}


x86 assembly (clang, -O0):
<sprint_subb_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_subb_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"SUBB A, 0x%02X \00"
define void @sprint_subb_direct(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"SUBB A, 0x%02X \00"
define void @sprint_subb_direct(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_elmt(int *, int const *);
int main() {
  int a[10] = {};
  int const *b = a;
  set_elmt(a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <set_elmt@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
mov    %rsp,%rdi
mov    %rdi,%rsi
call   1030 <set_elmt@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = bitcast [10 x i32]* %1 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32 @set_elmt(i32* %5, i32* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @set_elmt(i32* %3, i32* %3)
ret i32 0
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct datafile_list {
  int dummy;
};

/* Variables and functions */
int genlist_size(struct genlist *);
int datafile_list_size(const struct datafile_list *tthis) {
  return genlist_size(((struct genlist *)(tthis)));
}


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

x86 assembly (clang, -O2):
<datafile_list_size>:
jmp    1030 <genlist_size@plt>

LLVM IR (-O0):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define i32 @datafile_list_size(%struct.datafile_list* %0) {
%2 = alloca %struct.datafile_list*
store %struct.datafile_list* %0, %struct.datafile_list** %2
%3 = load %struct.datafile_list*, %struct.datafile_list** %2
%4 = bitcast %struct.datafile_list* %3 to %struct.genlist*
%5 = call i32 @genlist_size(%struct.genlist* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define i32 @datafile_list_size(%struct.datafile_list* %0) {
%2 = bitcast %struct.datafile_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_size(%struct.genlist* %2)
ret i32 %3
}
/* Variables and functions */
int MCI_read(char *, unsigned int, unsigned int);
int drvread(void *buf, unsigned lba, unsigned nblk) {
  return (MCI_read((char *)buf, lba << 9, nblk << 9));
}


x86 assembly (clang, -O0):
<drvread>:
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
shl    $0x9,%esi
mov    -0x10(%rbp),%edx
shl    $0x9,%edx
call   1030 <MCI_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drvread>:
shl    $0x9,%esi
shl    $0x9,%edx
jmp    1030 <MCI_read@plt>

LLVM IR (-O0):
define i32 @drvread(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 = shl i32 %8, 9
%10 = load i32, i32* %6
%11 = shl i32 %10, 9
%12 = call i32 @MCI_read(i8* %7, i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @drvread(i8* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 9
%5 = shl i32 %2, 9
%6 = tail call i32 @MCI_read(i8* %0, i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void symbol_repr(void *ptr) { printf("%s", (char *)ptr); }


x86 assembly (clang, -O0):
<symbol_repr>:
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):
<symbol_repr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @symbol_repr(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void rct_set_usb_debounce(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ NLA_ALIGN(int);
void *__nla_reserve_nohdr(struct msg_buff *, int);
scalar_t__ msg_tailroom(struct msg_buff *);
void *nla_reserve_nohdr(struct msg_buff *msg, int attrlen) {
  if ((msg_tailroom(msg) < NLA_ALIGN(attrlen)))
    return NULL;
  return __nla_reserve_nohdr(msg, attrlen);
}


x86 assembly (clang, -O0):
<nla_reserve_nohdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <msg_tailroom@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <NLA_ALIGN@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1171 <nla_reserve_nohdr+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1181 <nla_reserve_nohdr+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <__nla_reserve_nohdr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_reserve_nohdr>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <msg_tailroom@plt>
mov    %rax,%rbp
mov    %r14d,%edi
call   1050 <NLA_ALIGN@plt>
cmp    %rax,%rbp
jge    1156 <nla_reserve_nohdr+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__nla_reserve_nohdr@plt>

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define i8* @nla_reserve_nohdr(%struct.msg_buff* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca %struct.msg_buff*
%5 = alloca i32
store %struct.msg_buff* %0, %struct.msg_buff** %4
store i32 %1, i32* %5
%6 = load %struct.msg_buff*, %struct.msg_buff** %4
%7 = call i64 @msg_tailroom(%struct.msg_buff* %6)
%8 = load i32, i32* %5
%9 = call i64 @NLA_ALIGN(i32 %8)
%10 = icmp slt i64 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %16
12: ; preds = %2
%13 = load %struct.msg_buff*, %struct.msg_buff** %4
%14 = load i32, i32* %5
%15 = call i8* @__nla_reserve_nohdr(%struct.msg_buff* %13, i32 %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %12, %11
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define i8* @nla_reserve_nohdr(%struct.msg_buff* %0, i32 %1) {
%3 = tail call i64 @msg_tailroom(%struct.msg_buff* %0)
%4 = tail call i64 @NLA_ALIGN(i32 %1)
%5 = icmp slt i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @__nla_reserve_nohdr(%struct.msg_buff* %0, i32 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
void ff_hevc_put_hevc_bi_w_qpel_h64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_h64_10_sse4() {
ret void
}
/* Variables and functions */
int netConnectWithTimeout(char *, int, int);
int netConnect(char *hostName, int port) {
  return netConnectWithTimeout(hostName, port, 10000);
}


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

x86 assembly (clang, -O2):
<netConnect>:
mov    $0x2710,%edx
jmp    1030 <netConnectWithTimeout@plt>

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

LLVM IR (-O2):
define i32 @netConnect(i8* %0, i32 %1) {
%3 = tail call i32 @netConnectWithTimeout(i8* %0, i32 %1, i32 10000)
ret i32 %3
}
int custom_strlen(const unsigned char *src) {
  int srclen = 0;
  while (*(src++) != '\0')
    srclen++;
  return (srclen);
}


x86 assembly (clang, -O0):
<custom_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <custom_strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <custom_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_strlen>:
cmpb   $0x0,(%rdi)
je     111c <custom_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <custom_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @custom_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void i2d_ASN1_UTF8STRING(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_UTF8STRING() {
ret void
}
int do_888() { return 888; }


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

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

LLVM IR (-O0):
define i32 @do_888() {
ret i32 888
}

LLVM IR (-O2):
define i32 @do_888() {
ret i32 888
}
/* Type definitions */
typedef int GLenum;
typedef int /*<<< orphan*/ GLboolean;

/* Variables and functions */
#define GL_ALPHA 140
#define GL_BGR 139
#define GL_BGRA 138
#define GL_BLUE 137
#define GL_COLOR_INDEX 136
#define GL_DEPTH_COMPONENT 135
int /*<<< orphan*/ GL_FALSE;
#define GL_GREEN 134
#define GL_LUMINANCE 133
#define GL_LUMINANCE_ALPHA 132
#define GL_RED 131
#define GL_RGB 130
#define GL_RGBA 129
#define GL_STENCIL_INDEX 128
int /*<<< orphan*/ GL_TRUE;
GLboolean legalFormat(GLenum format) {
  switch (format) {
  case GL_COLOR_INDEX:
  case GL_STENCIL_INDEX:
  case GL_DEPTH_COMPONENT:
  case GL_RED:
  case GL_GREEN:
  case GL_BLUE:
  case GL_ALPHA:
  case GL_RGB:
  case GL_RGBA:
  case GL_LUMINANCE:
  case GL_LUMINANCE_ALPHA:
  case GL_BGR:
  case GL_BGRA:
    return GL_TRUE;
  default:
    return GL_FALSE;
  }
}


x86 assembly (clang, -O0):
<legalFormat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0xc,%eax
ja     112c <legalFormat+0x2c>
jmp    111b <legalFormat+0x1b>
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <legalFormat+0x38>
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<legalFormat>:
add    $0xffffff80,%edi
cmp    $0xd,%edi
jae    1112 <legalFormat+0x12>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@GL_TRUE = global i32 0
@GL_FALSE = global i32 0
define i32 @legalFormat(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 136, label %5
i32 128, label %5
i32 135, label %5
i32 131, label %5
i32 134, label %5
i32 137, label %5
i32 140, label %5
i32 130, label %5
i32 129, label %5
i32 133, label %5
i32 132, label %5
i32 139, label %5
i32 138, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%6 = load i32, i32* @GL_TRUE
store i32 %6, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* @GL_FALSE
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@GL_TRUE = global i32 0
@GL_FALSE = global i32 0
define i32 @legalFormat(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 13
%4 = load i32, i32* @GL_TRUE
%5 = load i32, i32* @GL_FALSE
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ yes;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              void *, int);
void _reuseAddr(int fd) {
  int yes = 1;
  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
}


x86 assembly (clang, -O0):
<_reuseAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_reuseAddr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @_reuseAddr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEADDR
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define void @_reuseAddr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
ret void
}
void rop3_247_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_247_0_0>:
and    (%rdi),%sil
not    %sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_247_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_247_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, -1
%7 = or i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ACCESS_DESCRIPTION;

/* Variables and functions */
int /*<<< orphan*/ ACCESS_DESCRIPTION_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ACCESS_DESCRIPTION *d2i_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION **a,
                                           const unsigned char **in, long len) {
  return (ACCESS_DESCRIPTION *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                             &ACCESS_DESCRIPTION_it);
}


x86 assembly (clang, -O0):
<d2i_ACCESS_DESCRIPTION>:
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
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_ACCESS_DESCRIPTION>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ACCESS_DESCRIPTION_it = global i32 0
define i32* @d2i_ACCESS_DESCRIPTION(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ACCESS_DESCRIPTION_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ACCESS_DESCRIPTION_it = global i32 0
define i32* @d2i_ACCESS_DESCRIPTION(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ACCESS_DESCRIPTION_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
char *Rstrdup(char *, char const *);
int /*<<< orphan*/ free(char *);
char *getcwd(char *, size_t);
char *Rgetcwd(char *buffer, size_t size, const char *file) {
  char *ret = getcwd(buffer, size);
  if (ret && !buffer) {
    char *newret = Rstrdup(ret, file);
    free(ret);
    ret = newret;
  }
  return ret;
}


x86 assembly (clang, -O0):
<Rgetcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <getcwd@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118d <Rgetcwd+0x5d>
cmpq   $0x0,-0x8(%rbp)
jne    118d <Rgetcwd+0x5d>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <Rstrdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rgetcwd>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
call   1040 <getcwd@plt>
mov    %rax,%r15
test   %rbx,%rbx
jne    1168 <Rgetcwd+0x38>
test   %r15,%r15
je     1168 <Rgetcwd+0x38>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <Rstrdup@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
jmp    116b <Rgetcwd+0x3b>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @Rgetcwd(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = call i8* @getcwd(i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %24
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %24, label %17
17: ; preds = %14
%18 = load i8*, i8** %7
%19 = load i8*, i8** %6
%20 = call i8* @Rstrdup(i8* %18, i8* %19)
store i8* %20, i8** %8
%21 = load i8*, i8** %7
%22 = call i32 @free(i8* %21)
%23 = load i8*, i8** %8
store i8* %23, i8** %7
br label %24
24: ; preds = %17, %14, %3
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define i8* @Rgetcwd(i8* %0, i64 %1, i8* %2) {
%4 = tail call i8* @getcwd(i8* %0, i64 %1)
%5 = icmp eq i8* %4, null
%6 = icmp ne i8* %0, null
%7 = or i1 %6, %5
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = tail call i8* @Rstrdup(i8* %4, i8* %2)
%10 = tail call i32 @free(i8* %4)
br label %11
11: ; preds = %8, %3
%12 = phi i8* [ %4, %3 ], [ %9, %8 ]
ret i8* %12
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return (isupper(c) ? (c - 'A' + 'a') : (c)); }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = add nsw i32 %8, 97
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
int test_imm_08int32_mem(int *val) {
  return ((*val) & (0x08 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_08int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 8
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FlightPlanControlHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightPlanControlRequestUpdate() {
  UAVObjRequestUpdate(FlightPlanControlHandle());
}


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

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

LLVM IR (-O0):
define void @FlightPlanControlRequestUpdate() {
%1 = call i32 (...) @FlightPlanControlHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightPlanControlRequestUpdate() {
%1 = tail call i32 (...) @FlightPlanControlHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Mem_free(void *ptr, const char *file, int line) {
  if (ptr) {
    free(ptr);
    ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<Mem_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <Mem_free+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_free>:
test   %rdi,%rdi
je     111a <Mem_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Mem_free(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
void main(int i) {
  g(1);
  g(2);
  f(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <g@plt>
mov    $0x2,%edi
call   1040 <g@plt>
mov    $0x1,%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <g@plt>
mov    $0x2,%edi
call   1040 <g@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @g(i32 1)
%4 = call i32 @g(i32 2)
%5 = call i32 @f(i32 1)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @g(i32 1)
%3 = tail call i32 @g(i32 2)
%4 = tail call i32 @f(i32 1)
ret void
}
/* Variables and functions */
scalar_t__ asprintf(char **, char *, char const *);
char *get_status_file_path(const char *proc_dir) {
  char *buf;
  if (asprintf(&buf, "/proc/%s/status", proc_dir) < 0) {
    return NULL;
  }
  return buf;
}


x86 assembly (clang, -O0):
<get_status_file_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0x0,%rax
jge    1147 <get_status_file_path+0x37>
movq   $0x0,-0x8(%rbp)
jmp    114f <get_status_file_path+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_status_file_path>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
test   %rax,%rax
js     112e <get_status_file_path+0x1e>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/proc/%s/status\00"
define i8* @get_status_file_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @asprintf(i8** %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %11
11: ; preds = %9, %8
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"/proc/%s/status\00"
define i8* @get_status_file_path(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @asprintf(i8** %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp slt i64 %4, 0
%6 = load i8*, i8** %2
%7 = select i1 %5, i8* null, i8* %6
ret i8* %7
}
/* Variables and functions */
unsigned short VIM_HIF_GetReg16(int);
int /*<<< orphan*/ VIM_HIF_SetReg16(int, unsigned short);
void VIM_IPP_SetImageSize(unsigned short wWidth, unsigned short wHeight) {
  VIM_HIF_SetReg16((0x1c00 + 0x002), wWidth);
  VIM_HIF_SetReg16((0x1c00 + 0x004), wHeight);
  wWidth = VIM_HIF_GetReg16((0x1c00 + 0x002));
  wHeight = VIM_HIF_GetReg16((0x1c00 + 0x004));
  wHeight = VIM_HIF_GetReg16((0x1c00 + 0x010));
  VIM_HIF_SetReg16((0x1c00 + 0x010), wHeight);
}


x86 assembly (clang, -O0):
<VIM_IPP_SetImageSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0x1c02,%edi
movzwl -0x2(%rbp),%esi
call   1040 <VIM_HIF_SetReg16@plt>
mov    $0x1c04,%edi
movzwl -0x4(%rbp),%esi
call   1040 <VIM_HIF_SetReg16@plt>
mov    $0x1c02,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,-0x2(%rbp)
mov    $0x1c04,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,-0x4(%rbp)
mov    $0x1c10,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    %ax,-0x4(%rbp)
mov    $0x1c10,%edi
movzwl -0x4(%rbp),%esi
call   1040 <VIM_HIF_SetReg16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_SetImageSize>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x1c02,%edi
call   1040 <VIM_HIF_SetReg16@plt>
mov    $0x1c04,%edi
mov    %ebx,%esi
call   1040 <VIM_HIF_SetReg16@plt>
mov    $0x1c02,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    $0x1c04,%edi
call   1030 <VIM_HIF_GetReg16@plt>
mov    $0x1c10,%edi
call   1030 <VIM_HIF_GetReg16@plt>
movzwl %ax,%esi
mov    $0x1c10,%edi
pop    %rbx
jmp    1040 <VIM_HIF_SetReg16@plt>

LLVM IR (-O0):
define void @VIM_IPP_SetImageSize(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @VIM_HIF_SetReg16(i32 7170, i16 zeroext %5)
%7 = load i16, i16* %4
%8 = call i32 @VIM_HIF_SetReg16(i32 7172, i16 zeroext %7)
%9 = call zeroext i16 @VIM_HIF_GetReg16(i32 7170)
store i16 %9, i16* %3
%10 = call zeroext i16 @VIM_HIF_GetReg16(i32 7172)
store i16 %10, i16* %4
%11 = call zeroext i16 @VIM_HIF_GetReg16(i32 7184)
store i16 %11, i16* %4
%12 = load i16, i16* %4
%13 = call i32 @VIM_HIF_SetReg16(i32 7184, i16 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_SetImageSize(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @VIM_HIF_SetReg16(i32 7170, i16 zeroext %0)
%4 = tail call i32 @VIM_HIF_SetReg16(i32 7172, i16 zeroext %1)
%5 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7170)
%6 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7172)
%7 = tail call zeroext i16 @VIM_HIF_GetReg16(i32 7184)
%8 = tail call i32 @VIM_HIF_SetReg16(i32 7184, i16 zeroext %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *thr_fn3(void *arg) {
  while (1) {
    printf("thread 3 writing\n");
    sleep(1);
  }
  return (void *)3;
}


x86 assembly (clang, -O0):
<thr_fn3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <thr_fn3+0xc>

x86 assembly (clang, -O2):
<thr_fn3>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <thr_fn3+0x10>

LLVM IR (-O0):
@.str = [18 x i8] c"thread 3 writing\0A\00"
define i8* @thr_fn3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@str = [17 x i8] c"thread 3 writing\00"
define noalias i8* @thr_fn3(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
void *gzopen(char const *, char *);
void *gz_file_handler_open(const char *file_name) {
  return gzopen(file_name, "w1");
}


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

x86 assembly (clang, -O2):
<gz_file_handler_open>:
lea    0xee9(%rip),%rsi
jmp    1030 <gzopen@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"w1\00"
define i8* @gz_file_handler_open(i8* %0) {
%2 = tail call i8* @gzopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ black(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmBlack(char *str) { printColor(black(str)); }


x86 assembly (clang, -O0):
<cmBlack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <black@plt>
mov    %eax,%edi
call   1040 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmBlack>:
push   %rax
call   1030 <black@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <printColor@plt>

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

LLVM IR (-O2):
define void @cmBlack(i8* %0) {
%2 = tail call i32 @black(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
int vbr_getintra_fixedquant(void *state) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @vbr_getintra_fixedquant(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  char str[] = "This is a test";
  int len;
  len = strlen(str);
  printf("Length is %d\n", len);
  printf("%d\n", strlen(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    -0x13(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x74736574206120,%rax
mov    %rax,0x7(%rsp)
movabs $0x2073692073696854,%rax
69 73 20
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [15 x i8] c"This is a test\00"
@.str = [14 x i8] c"Length is %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [15 x i8] c"This is a test\00"
@.str = [14 x i8] c"Length is %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void loop_signal_handler_alarm(int signal_number) { (void)(signal_number); }


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

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

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

LLVM IR (-O2):
define void @loop_signal_handler_alarm(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rtems_fatal_error_occurred(int);
void force_error() { rtems_fatal_error_occurred(0xdead); }


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

x86 assembly (clang, -O2):
<force_error>:
mov    $0xdead,%edi
jmp    1030 <rtems_fatal_error_occurred@plt>

LLVM IR (-O0):
define void @force_error() {
%1 = call i32 @rtems_fatal_error_occurred(i32 57005)
ret void
}

LLVM IR (-O2):
define void @force_error() {
%1 = tail call i32 @rtems_fatal_error_occurred(i32 57005)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int singleNumber(int *, int);
int main(void) {
  int nums[] = {1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7}, size = 15;
  printf("%d\n", singleNumber(nums, size));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x3c,%edx
call   1050 <memcpy@plt>
movl   $0xf,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1030 <singleNumber@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xf,%esi
call   1030 <singleNumber@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [15 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [15 x i32]* %2 to i8*
store i32 15, i32* %3
%5 = getelementptr inbounds [15 x i32], [15 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @singleNumber(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@__const.main.nums = [15 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [15 x i32]
%2 = bitcast [15 x i32]* %1 to i8*
%3 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 0
%4 = call i32 @singleNumber(i32* %3, i32 15)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int /*<<< orphan*/);
void fe(char *msg) {
  char e[256];
  strcpy(e, "[!] ERROR: ");
  strncat(e, msg, strlen(msg));
  perror(e);
  exit(-1);
}


x86 assembly (clang, -O0):
<fe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x120(%rbp),%rdi
mov    -0x118(%rbp),%rsi
mov    %eax,%edx
call   1050 <strncat@plt>
lea    -0x110(%rbp),%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<fe>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
lea    0xe9c(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <strncat@plt>
mov    %r14,%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"[!] ERROR: \00"
define void @fe(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @strncat(i8* %6, i8* %7, i32 %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%12 = call i32 @perror(i8* %11)
%13 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"[!] ERROR: \00"
define void @fe(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strlen(i8* %0)
%6 = call i32 @strncat(i8* %3, i8* %0, i32 %5)
%7 = call i32 @perror(i8* %3)
%8 = call i32 @exit(i32 -1)
unreachable
}