xunge/DecIR huggingface dataset:
int AccessCodeToFlags(int code) {
  if (code & 256)
    return (1 << 12);
  if (code & 512)
    return (1 << 13);
  if (code & 1024)
    return (1 << 14);
  if (code & 2048)
    return (1 << 15);
  return 0;
}


x86 assembly (clang, -O0):
<AccessCodeToFlags>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1124 <AccessCodeToFlags+0x24>
movl   $0x1000,-0x4(%rbp)
jmp    1182 <AccessCodeToFlags+0x82>
mov    -0x8(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     1141 <AccessCodeToFlags+0x41>
movl   $0x2000,-0x4(%rbp)
jmp    1182 <AccessCodeToFlags+0x82>
mov    -0x8(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     115e <AccessCodeToFlags+0x5e>
movl   $0x4000,-0x4(%rbp)
jmp    1182 <AccessCodeToFlags+0x82>
mov    -0x8(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
je     117b <AccessCodeToFlags+0x7b>
movl   $0x8000,-0x4(%rbp)
jmp    1182 <AccessCodeToFlags+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccessCodeToFlags>:
mov    $0x1000,%eax
test   $0x100,%edi
jne    1132 <AccessCodeToFlags+0x32>
mov    $0x2000,%eax
test   $0x200,%edi
jne    1132 <AccessCodeToFlags+0x32>
mov    $0x4000,%eax
test   $0x400,%edi
jne    1132 <AccessCodeToFlags+0x32>
shl    $0x4,%edi
and    $0x8000,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @AccessCodeToFlags(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 256
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 4096, i32* %2
br label %24
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 512
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 8192, i32* %2
br label %24
13: ; preds = %8
%14 = load i32, i32* %3
%15 = and i32 %14, 1024
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 16384, i32* %2
br label %24
18: ; preds = %13
%19 = load i32, i32* %3
%20 = and i32 %19, 2048
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 32768, i32* %2
br label %24
23: ; preds = %18
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22, %17, %12, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @AccessCodeToFlags(i32 %0) {
%2 = and i32 %0, 256
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = and i32 %0, 512
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = and i32 %0, 1024
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = shl i32 %0, 4
%12 = and i32 %11, 32768
br label %13
13: ; preds = %10, %7, %4, %1
%14 = phi i32 [ 4096, %1 ], [ 8192, %4 ], [ 16384, %7 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
float pow(float, int);
double prime(float X, float Y) {
  return (2 * X + 3 * Y - 1) / (pow(X, 2) + pow(Y, 2) + X * Y);
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed5(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  0xebc(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movss  -0x10(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
addss  %xmm1,%xmm2
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
sub    $0x18,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x10(%rsp)
movss  0xed8(%rip),%xmm2
mulss  %xmm1,%xmm2
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
addss  %xmm2,%xmm1
addss  0xec5(%rip),%xmm1
movss  %xmm1,0x14(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
mulss  0x8(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  0x14(%rsp),%xmm0
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @prime(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float 3.000000e+00, %6
%8 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %5, float %7)
%9 = fsub float %8, 1.000000e+00
%10 = load float, float* %3
%11 = call float @pow(float %10, i32 2)
%12 = load float, float* %4
%13 = call float @pow(float %12, i32 2)
%14 = fadd float %11, %13
%15 = load float, float* %3
%16 = load float, float* %4
%17 = call float @llvm.fmuladd.f32(float %15, float %16, float %14)
%18 = fdiv float %9, %17
%19 = fpext float %18 to double
ret double %19
}

LLVM IR (-O2):
define double @prime(float %0, float %1) {
%3 = fmul float %1, 3.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float %3)
%5 = fadd float %4, -1.000000e+00
%6 = tail call float @pow(float %0, i32 2)
%7 = tail call float @pow(float %1, i32 2)
%8 = fadd float %6, %7
%9 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %8)
%10 = fdiv float %5, %9
%11 = fpext float %10 to double
ret double %11
}
/* Variables and functions */
float __ratand(float);
float intr_wrap_017(float p1) { return __ratand(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_017>:
jmp    1030 <__ratand@plt>

LLVM IR (-O0):
define float @intr_wrap_017(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__ratand(float %3)
ret float %4
}

LLVM IR (-O2):
define float @intr_wrap_017(float %0) {
%2 = tail call float @__ratand(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ address_to_clipboard();
void button_copyid_onpress(void) { address_to_clipboard(); }


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

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

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

LLVM IR (-O2):
define void @button_copyid_onpress() {
%1 = tail call i32 (...) @address_to_clipboard()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tml_dr_vAbs2(double *, double *, int);
void tml_dr_vAbs1(double *vec, int n) { tml_dr_vAbs2(vec, vec, n); }


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

x86 assembly (clang, -O2):
<tml_dr_vAbs1>:
mov    %esi,%edx
mov    %rdi,%rsi
jmp    1030 <tml_dr_vAbs2@plt>

LLVM IR (-O0):
define void @tml_dr_vAbs1(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load double*, double** %3
%7 = load i32, i32* %4
%8 = call i32 @tml_dr_vAbs2(double* %5, double* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @tml_dr_vAbs1(double* %0, i32 %1) {
%3 = tail call i32 @tml_dr_vAbs2(double* %0, double* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: conjoin srv-cmd tst-cmd\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: conjoin srv-cmd tst-cmd\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: conjoin srv-cmd tst-cmd\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_error(const char *string, int exit_status) {
  fputs(string, stderr);
  if (exit_status)
    exit(EXIT_FAILURE);
  return;
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
cmpl   $0x0,-0xc(%rbp)
je     1159 <print_error+0x39>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    %esi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
test   %ebx,%ebx
jne    1137 <print_error+0x17>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @print_error(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* @stderr
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @print_error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = icmp eq i32 %1, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int strlen(char const *);
int string_len(const char *s) { return strlen(s); }


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

x86 assembly (clang, -O2):
<string_len>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @string_len(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Type definitions */
struct json_attr_t {
  int dummy;
};

/* Variables and functions */
int json_internal_read_object(char const *, struct json_attr_t const *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/,
                              char const **);
int json_read_object(const char *cp, const struct json_attr_t *attributes,
                     const char **end) {
  return json_internal_read_object(cp, attributes, NULL, 0, end);
}


x86 assembly (clang, -O0):
<json_read_object>:
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),%r8
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <json_internal_read_object@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_read_object>:
mov    %rdx,%r8
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <json_internal_read_object@plt>

LLVM IR (-O0):
%struct.json_attr_t = type { i32 }
define i32 @json_read_object(i8* %0, %struct.json_attr_t* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca %struct.json_attr_t*
%6 = alloca i8**
store i8* %0, i8** %4
store %struct.json_attr_t* %1, %struct.json_attr_t** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load %struct.json_attr_t*, %struct.json_attr_t** %5
%9 = load i8**, i8*** %6
%10 = call i32 @json_internal_read_object(i8* %7, %struct.json_attr_t* %8, i32* null, i32 0, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.json_attr_t = type { i32 }
define i32 @json_read_object(i8* %0, %struct.json_attr_t* %1, i8** %2) {
%4 = tail call i32 @json_internal_read_object(i8* %0, %struct.json_attr_t* %1, i32* null, i32 0, i8** %2)
ret i32 %4
}
/* Variables and functions */
char *env_message(char const *);
const char *RL_env_message(const char *message) {
  const char *theEnvResponse = 0;
  const char *messageToSend = 0;
  if (message != 0) {
    messageToSend = message;
  } else {
    messageToSend = "";
  }
  theEnvResponse = env_message(messageToSend);
  if (theEnvResponse == 0) {
    return "";
  }
  return theEnvResponse;
}


x86 assembly (clang, -O0):
<RL_env_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <RL_env_message+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    114f <RL_env_message+0x3f>
lea    0xeb5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <env_message@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <RL_env_message+0x67>
lea    0xe92(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <RL_env_message+0x6f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RL_env_message>:
push   %rbx
test   %rdi,%rdi
lea    0xee5(%rip),%rbx
cmove  %rbx,%rdi
call   1030 <env_message@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @RL_env_message(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* null, i8** %4
store i8* null, i8** %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %5
br label %11
10: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %5
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %5
%13 = call i8* @env_message(i8* %12)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %11
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %19
17: ; preds = %11
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %17, %16
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @RL_env_message(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i8* @env_message(i8* %3)
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %6
}
int check_buffer(const char *buf, const char *data, unsigned len) {
  if (memcmp(buf, data, len) != 0) {
    test_error(__FUNCTION__, "data mismatch");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%eax
mov    %eax,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
je     116f <check_buffer+0x4f>
lea    0xeab(%rip),%rdi
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1040 <test_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <check_buffer+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_buffer>:
push   %rax
mov    %edx,%edx
call   1030 <bcmp@plt>
test   %eax,%eax
je     1148 <check_buffer+0x28>
lea    0xecd(%rip),%rdi
lea    0xed3(%rip),%rsi
xor    %eax,%eax
call   1040 <test_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__FUNCTION__.check_buffer = [13 x i8] c"check_buffer\00"
@.str = [14 x i8] c"data mismatch\00"
define i32 @check_buffer(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = zext i32 %10 to i64
%12 = call i32 @memcmp(i8* %8, i8* %9, i64 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.check_buffer, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %17
16: ; preds = %3
store i32 0, i32* %4
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@__FUNCTION__.check_buffer = [13 x i8] c"check_buffer\00"
@.str = [14 x i8] c"data mismatch\00"
define i32 @check_buffer(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @test_error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.check_buffer, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ -1, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ flick_mem(char *, int /*<<< orphan*/, int,
                             int /*<<< orphan*/, int /*<<< orphan*/);
void i_lsx_mem(void) { flick_mem("sh", 0, 1, 0, 0); }


x86 assembly (clang, -O0):
<i_lsx_mem>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %r8d,%r8d
mov    $0x1,%edx
mov    %r8d,%esi
mov    %r8d,%ecx
call   1030 <flick_mem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_lsx_mem>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <flick_mem@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"sh\00"
define void @i_lsx_mem() {
%1 = call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"sh\00"
define void @i_lsx_mem() {
%1 = tail call i32 @flick_mem(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NupAndDownFast();
void NccFast(void) {
  int x;
  for (x = 0; x < 8; x++) {
    NupAndDownFast();
  }
}


x86 assembly (clang, -O0):
<NccFast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    113e <NccFast+0x2e>
mov    $0x0,%al
call   1030 <NupAndDownFast@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <NccFast+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NccFast>:
push   %rax
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
call   1030 <NupAndDownFast@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <NupAndDownFast@plt>

LLVM IR (-O0):
define void @NccFast() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 8
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @NupAndDownFast()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @NccFast() {
%1 = tail call i32 (...) @NupAndDownFast()
%2 = tail call i32 (...) @NupAndDownFast()
%3 = tail call i32 (...) @NupAndDownFast()
%4 = tail call i32 (...) @NupAndDownFast()
%5 = tail call i32 (...) @NupAndDownFast()
%6 = tail call i32 (...) @NupAndDownFast()
%7 = tail call i32 (...) @NupAndDownFast()
%8 = tail call i32 (...) @NupAndDownFast()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void _display_int(const int *data, int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("%d ", data[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<_display_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <_display_int+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <_display_int+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @_display_int(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct fastbuf {
  int dummy;
};

/* Variables and functions */
int bgetw_le(struct fastbuf *);
int bgetw(struct fastbuf *f) { return bgetw_le(f); }


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

x86 assembly (clang, -O2):
<bgetw>:
jmp    1030 <bgetw_le@plt>

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

LLVM IR (-O2):
%struct.fastbuf = type { i32 }
define i32 @bgetw(%struct.fastbuf* %0) {
%2 = tail call i32 @bgetw_le(%struct.fastbuf* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ datum_pop();
int /*<<< orphan*/ printf(char *, char *);
char *toString(int /*<<< orphan*/);
void code_print() {
  char *s = toString(datum_pop());
  printf("\tprint %s \n", s);
}


x86 assembly (clang, -O0):
<code_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <datum_pop@plt>
mov    %eax,%edi
call   1030 <toString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_print>:
push   %rax
xor    %eax,%eax
call   1050 <datum_pop@plt>
mov    %eax,%edi
call   1030 <toString@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"\09print %s \0A\00"
define void @code_print() {
%1 = tail call i32 (...) @datum_pop()
%2 = tail call i8* @toString(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msgIfget(int *);
void msg_ifget_(int *const STATUS) {
  int status;
  status = *STATUS;
  msgIfget(&status);
  *STATUS = status;
}


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

x86 assembly (clang, -O2):
<msg_ifget_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <msgIfget@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @msg_ifget_(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = call i32 @msgIfget(i32* %3)
%7 = load i32, i32* %3
%8 = load i32*, i32** %2
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @msg_ifget_(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
store i32 %4, i32* %2
%5 = call i32 @msgIfget(i32* %2)
%6 = load i32, i32* %2
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
void *realloc(int /*<<< orphan*/ *, size_t);
void *malloc(size_t size) { return realloc(NULL, size); }


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

x86 assembly (clang, -O2):
<malloc>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @realloc(i32* null, i64 %0)
ret i8* %2
}
void callee(i) int i;
{}


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

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

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

LLVM IR (-O2):
define void @callee(i32 %0) {
ret void
}
short test_short_3(short a, short b, short c) { return -8; }


x86 assembly (clang, -O0):
<test_short_3>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    $0xfff8,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_short_3>:
mov    $0xfff8,%ax
ret

LLVM IR (-O0):
define signext i16 @test_short_3(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
ret i16 -8
}

LLVM IR (-O2):
define signext i16 @test_short_3(i16 signext %0, i16 signext %1, i16 signext %2) {
ret i16 -8
}
/* Variables and functions */
int dcc_r_token_int(int, char *, unsigned int *);
int dcc_r_cc_status(int ifd, int *status) {
  unsigned u_status;
  int ret;
  ret = dcc_r_token_int(ifd, "STAT", &u_status);
  *status = u_status;
  return ret;
}


x86 assembly (clang, -O0):
<dcc_r_cc_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    0xed7(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <dcc_r_token_int@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcc_r_cc_status>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xee1(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1030 <dcc_r_token_int@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"STAT\00"
define i32 @dcc_r_cc_status(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32, i32* %3
%8 = call i32 @dcc_r_token_int(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = load i32*, i32** %4
store i32 %9, i32* %10
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"STAT\00"
define i32 @dcc_r_cc_status(i32 %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @dcc_r_token_int(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
store i32 %6, i32* %1
ret i32 %5
}
int modnn(int x) {
  while (x >= 0xff) {
    x -= 0xff;
    x = (x >> 0xff) + (x & 0xff);
  }
  return x;
}


x86 assembly (clang, -O0):
<modnn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jl     113c <modnn+0x3c>
mov    -0x4(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <modnn+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modnn>:
cmp    $0xff,%edi
jl     1112 <modnn+0x12>
nopl   0x0(%rax,%rax,1)
jmp    1110 <modnn+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @modnn(i32 returned %0) {
%2 = icmp sgt i32 %0, 254
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 %0
}
void public(name) char *name;
{
  outop0str(";; EXPORT\t");
  outnccname(name);
  outccname(name);
  outnbyte(':');
}


x86 assembly (clang, -O0):
<public>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1050 <outop0str@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <outnccname@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <outccname@plt>
mov    $0x3a,%edi
mov    $0x0,%al
call   1030 <outnbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<public>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1050 <outop0str@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outnccname@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <outccname@plt>
mov    $0x3a,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outnbyte@plt>

LLVM IR (-O0):
@.str = [11 x i8] c";; EXPORT\09\00"
define void @public(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @outnccname to i32 (i8*, ...)*)(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %6)
%8 = call i32 (i32, ...) bitcast (i32 (...)* @outnbyte to i32 (i32, ...)*)(i32 58)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c";; EXPORT\09\00"
define void @public(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outop0str to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outnccname to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outccname to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @outnbyte to i32 (i32, ...)*)(i32 58)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void itoa(int value, char *s, int base) { sprintf(s, "%d", value); }


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed0(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
mov    %rsi,%rax
mov    %edi,%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @itoa(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int(ars_d_set_ipopt_sec)(struct ars_packet *pkt, int layer, char *f, char *v) {
  return 0;
}


x86 assembly (clang, -O0):
<ars_d_set_ipopt_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_sec(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_sec(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
int vbench_clip3(int v, int i_min, int i_max) {
  return ((v < i_min) ? i_min : (v > i_max) ? i_max : v);
}


x86 assembly (clang, -O0):
<vbench_clip3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <vbench_clip3+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <vbench_clip3+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <vbench_clip3+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <vbench_clip3+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vbench_clip3>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @vbench_clip3(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 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @vbench_clip3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage(int rc) {
  fprintf(
      stdout,
      ("\nionice - sets or gets process io scheduling class and priority.\n"
       "\nUsage:\n"
       "  ionice [ options ] -p <pid> [<pid> ...]\n"
       "  ionice [ options ] <command> [<arg> ...]\n"
       "\nOptions:\n"
       "  -n <classdata>      class data (0-7, lower being higher prio)\n"
       "  -c <class>          scheduling class\n"
       "                      0: none, 1: realtime, 2: best-effort, 3: idle\n"
       "  -t                  ignore failures\n"
       "  -h                  this help\n\n"));
  exit(rc);
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [411 x i8] c"\0Aionice - sets or gets process io scheduling class and priority.\0A\0AUsage:\0A ionice [ options ] -p <pid> [<pid> ...]\0A ionice [ options ] <command> [<arg> ...]\0A\0AOptions:\0A -n <classdata> class data (0-7, lower being higher prio)\0A -c <class> scheduling class\0A 0: none, 1: realtime, 2: best-effort, 3: idle\0A -t ignore failures\0A -h this help\0A\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([411 x i8], [411 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [411 x i8] c"\0Aionice - sets or gets process io scheduling class and priority.\0A\0AUsage:\0A ionice [ options ] -p <pid> [<pid> ...]\0A ionice [ options ] <command> [<arg> ...]\0A\0AOptions:\0A -n <classdata> class data (0-7, lower being higher prio)\0A -c <class> scheduling class\0A 0: none, 1: realtime, 2: best-effort, 3: idle\0A -t ignore failures\0A -h this help\0A\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([411 x i8], [411 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ digitalWrite(int, int /*<<< orphan*/);
void unhang() { digitalWrite(2, 0); }


x86 assembly (clang, -O0):
<unhang>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <digitalWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unhang>:
mov    $0x2,%edi
xor    %esi,%esi
jmp    1030 <digitalWrite@plt>

LLVM IR (-O0):
define void @unhang() {
%1 = call i32 @digitalWrite(i32 2, i32 0)
ret void
}

LLVM IR (-O2):
define void @unhang() {
%1 = tail call i32 @digitalWrite(i32 2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void set_multiport(char *device, int fd, char ***in_arg) {
  printf("Setserial was compiled under a kernel which did not\n");
  printf("support the special serial multiport configs.\n");
}


x86 assembly (clang, -O0):
<set_multiport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_multiport>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Setserial was compiled under a kernel which did not\0A\00"
@.str.1 = [47 x i8] c"support the special serial multiport configs.\0A\00"
define void @set_multiport(i8* %0, i32 %1, i8*** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8***
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8*** %2, i8**** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"Setserial was compiled under a kernel which did not\00"
@str.2 = [46 x i8] c"support the special serial multiport configs.\00"
define void @set_multiport(i8* nocapture readnone %0, i32 %1, i8*** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret void
}
void dl_F3DEX_LOAD_UCODE() {}


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

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

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

LLVM IR (-O2):
define void @dl_F3DEX_LOAD_UCODE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void voce2(int x) { printf("voce2: %d\n", x); }


x86 assembly (clang, -O0):
<voce2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voce2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"voce2: %d\0A\00"
define void @voce2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned long long mantissa(double d) {
  return *(unsigned long long *)(&d) & (~(1ull << 52));
}


x86 assembly (clang, -O0):
<mantissa>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movabs $0xffefffffffffffff,%rax
ff ef ff
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mantissa>:
movq   %xmm0,%rcx
movabs $0xffefffffffffffff,%rax
ff ef ff
and    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @mantissa(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i64*
%4 = load i64, i64* %3
%5 = and i64 %4, -4503599627370497
ret i64 %5
}

LLVM IR (-O2):
define i64 @mantissa(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, -4503599627370497
ret i64 %3
}
void sched_yield(void) {}


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

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

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

LLVM IR (-O2):
define void @sched_yield() {
ret void
}
void BlinkNoTimerTaskC$Leds$led0Toggle(void) { LedsP$Leds$led0Toggle(); }


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

x86 assembly (clang, -O2):
<BlinkNoTimerTaskC$Leds$led0Toggle>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led0Toggle@plt>

LLVM IR (-O0):
define void @"BlinkNoTimerTaskC$Leds$led0Toggle"() {
%1 = call i32 (...) @"LedsP$Leds$led0Toggle"()
ret void
}

LLVM IR (-O2):
define void @"BlinkNoTimerTaskC$Leds$led0Toggle"() {
%1 = tail call i32 (...) @"LedsP$Leds$led0Toggle"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strdup(char *);
char *dec_to_hex(int dec) {
  char buf[256] = {0};
  snprintf(buf, sizeof(buf), "%02x", dec);
  return strdup(buf);
}


x86 assembly (clang, -O0):
<dec_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xe99(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <strdup@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_to_hex>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%ecx
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe65(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define i8* @dec_to_hex(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = bitcast [256 x i8]* %3 to i8*
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 256, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i8* @strdup(i8* %8)
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define noalias i8* @dec_to_hex(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ connection_handler(int);
int socketBind();
int main(int argc, char *argv[]) {
  int socket_desc;
  socket_desc = socketBind();
  connection_handler(socket_desc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <socketBind@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <connection_handler@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <socketBind@plt>
mov    %eax,%edi
call   1030 <connection_handler@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @socketBind()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @connection_handler(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @socketBind()
%4 = tail call i32 @connection_handler(i32 %3)
ret i32 0
}