xunge/DecIR huggingface dataset:
/* Variables and functions */
int msm_hsusb_rpc_close();
int msm_hsusb_rpc_connect();
int hsusb_rpc_connect(int connect) {
  if (connect)
    return msm_hsusb_rpc_connect();
  else
    return msm_hsusb_rpc_close();
}


x86 assembly (clang, -O0):
<hsusb_rpc_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <hsusb_rpc_connect+0x24>
mov    $0x0,%al
call   1030 <msm_hsusb_rpc_connect@plt>
mov    %eax,-0x4(%rbp)
jmp    114e <hsusb_rpc_connect+0x2e>
mov    $0x0,%al
call   1040 <msm_hsusb_rpc_close@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsusb_rpc_connect>:
xor    %eax,%eax
test   %edi,%edi
je     112b <hsusb_rpc_connect+0xb>
jmp    1030 <msm_hsusb_rpc_connect@plt>
jmp    1040 <msm_hsusb_rpc_close@plt>

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

LLVM IR (-O2):
define i32 @hsusb_rpc_connect(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @msm_hsusb_rpc_connect()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @msm_hsusb_rpc_close()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ nand_rest();
void nand_init() {
  (*(volatile unsigned long *)0x4E000000) |= ((1 << 12) | (2 << 8) | (1 << 4));
  (*(volatile unsigned long *)0x4E000004) |= ((1 << 0) | (1 << 1));
  nand_rest();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000000,%eax
mov    (%rax),%rcx
or     $0x1210,%rcx
mov    $0x4e000000,%eax
mov    %rcx,(%rax)
mov    $0x4e000004,%eax
mov    (%rax),%rcx
or     $0x3,%rcx
mov    $0x4e000004,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <nand_rest@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
orq    $0x1210,0x4e000000
orq    $0x3,0x4e000004
4e 03
xor    %eax,%eax
jmp    1030 <nand_rest@plt>

LLVM IR (-O0):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 1308622848 to i64*)
%2 = or i64 %1, 4624
store volatile i64 %2, i64* inttoptr (i64 1308622848 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%4 = or i64 %3, 3
store volatile i64 %4, i64* inttoptr (i64 1308622852 to i64*)
%5 = call i32 (...) @nand_rest()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 1308622848 to i64*)
%2 = or i64 %1, 4624
store volatile i64 %2, i64* inttoptr (i64 1308622848 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%4 = or i64 %3, 3
store volatile i64 %4, i64* inttoptr (i64 1308622852 to i64*)
%5 = tail call i32 (...) @nand_rest()
ret void
}
void test_function(int a, int b, int c, int d) {
  int flag;
  char *buffer[10];
  flag = 31337;
  buffer[0] = "A";
}


x86 assembly (clang, -O0):
<test_function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x7a69,-0x14(%rbp)
lea    0xee2(%rip),%rax
mov    %rax,-0x70(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
define void @test_function(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [10 x i8*]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 31337, i32* %9
%11 = getelementptr inbounds [10 x i8*], [10 x i8*]* %10, i64 0, i64 0
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %11
ret void
}

LLVM IR (-O2):
define void @test_function(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
scalar_t__ floatToRawIntBits(float);
float const intBitsToFloat(scalar_t__);
__attribute__((always_)) const float ldexp3kf(float d, int e) {
  return intBitsToFloat(floatToRawIntBits(d) + (e << 23));
}


x86 assembly (clang, -O0):
<ldexp3kf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floatToRawIntBits@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%eax
shl    $0x17,%eax
cltq
add    %rax,%rdi
call   1030 <intBitsToFloat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp3kf>:
push   %rbx
mov    %edi,%ebx
call   1040 <floatToRawIntBits@plt>
shl    $0x17,%ebx
movslq %ebx,%rdi
add    %rax,%rdi
pop    %rbx
jmp    1030 <intBitsToFloat@plt>

LLVM IR (-O0):
define float @ldexp3kf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = call i64 @floatToRawIntBits(float %5)
%7 = load i32, i32* %4
%8 = shl i32 %7, 23
%9 = sext i32 %8 to i64
%10 = add nsw i64 %6, %9
%11 = call float @intBitsToFloat(i64 %10)
ret float %11
}

LLVM IR (-O2):
define float @ldexp3kf(float %0, i32 %1) {
%3 = tail call i64 @floatToRawIntBits(float %0)
%4 = shl i32 %1, 23
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
%7 = tail call float @intBitsToFloat(i64 %6)
ret float %7
}
void gdk_set_sm_client_id() {}


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

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

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

LLVM IR (-O2):
define void @gdk_set_sm_client_id() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ static_assert(int);
void main() {
  int x, y;
  x = -50;
  while (x < 0) {
    x = x + y;
    y++;
  }
  static_assert(y > 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffce,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1140 <main+0x30>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <main+0xf>
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <static_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <static_assert@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @static_assert(i32 0)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_after(struct list *, struct list *);
void list_add_head(struct list *list, struct list *elem) {
  list_add_after(list, elem);
}


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

x86 assembly (clang, -O2):
<list_add_head>:
jmp    1030 <list_add_after@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_add_head(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @list_add_after(%struct.list* %5, %struct.list* %6)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_add_head(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @list_add_after(%struct.list* %0, %struct.list* %1)
ret void
}
int test_imm_09int8_mem(signed char *val) {
  return ((*val) & (0x09 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_09int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 9
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ami_ctxmenu_release_hook(struct Hook *hook) {}


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

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

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

LLVM IR (-O2):
%struct.Hook = type opaque
define void @ami_ctxmenu_release_hook(%struct.Hook* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errorf(char *, int, char *, int, long, long);
void assert_int2(int line, long a, long b) {
  if (a != b)
    errorf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/"
           "utiltest.c",
           29, "%d: Expected %ld but got %ld", line, a, b);
}


x86 assembly (clang, -O0):
<assert_int2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1154 <assert_int2+0x44>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xebd(%rip),%rdi
mov    $0x1d,%esi
lea    0xf38(%rip),%rdx
call   1030 <errorf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_int2>:
cmp    %rdx,%rsi
jne    1116 <assert_int2+0x6>
ret
mov    %rdx,%r9
mov    %rsi,%r8
mov    %edi,%ecx
lea    0xedb(%rip),%rdi
lea    0xf5b(%rip),%rdx
mov    $0x1d,%esi
jmp    1030 <errorf@plt>

LLVM IR (-O0):
@.str = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/utiltest.c\00"
@.str.1 = [29 x i8] c"%d: Expected %ld but got %ld\00"
define void @assert_int2(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %6
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i64, i64* %5
%13 = load i64, i64* %6
%14 = call i32 @errorf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %11, i64 %12, i64 %13)
br label %15
15: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhuzhaoyuan/8cc/refs/heads/master/utiltest.c\00"
@.str.1 = [29 x i8] c"%d: Expected %ld but got %ld\00"
define void @assert_int2(i32 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, %2
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @errorf(i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %0, i64 %1, i64 %2)
br label %7
7: ; preds = %5, %3
ret void
}
double Double__MUL_(double x, double y) { return x * y; }


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

x86 assembly (clang, -O2):
<Double__MUL_>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Double__MUL_(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 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Double__MUL_(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
int main() {
  int x$1 = 20;
  int x$2 = 30;
  (x$1 = x$2);
  return x$1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 30, i32* %3
%4 = load i32, i32* %3
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 30
}
/* Variables and functions */
int /*<<< orphan*/ core4_print(char *, char const *);
void U_EMRSCALEVIEWPORTEXTEX_print(const char *contents) {
  core4_print("U_EMRSCALEVIEWPORTEXTEX", contents);
}


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"U_EMRSCALEVIEWPORTEXTEX\00"
define void @U_EMRSCALEVIEWPORTEXTEX_print(i8* %0) {
%2 = tail call i32 @core4_print(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u16;

/* Variables and functions */
void __put_unaligned_be16(__u16 val, __u8 *p) {
  *p++ = val >> 8;
  *p++ = val;
}


x86 assembly (clang, -O0):
<__put_unaligned_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_be16>:
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,(%rsi)
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @__put_unaligned_be16(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %4
store i32 %6, i32* %7
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_be16(i32 %0, i32* nocapture writeonly %1) {
%3 = ashr i32 %0, 8
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %1
store i32 %0, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ umain();
int /*<<< orphan*/ usetup();
int main() {
  usetup();
  umain();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @usetup()
%2 = tail call i32 (...) @umain()
ret i32 0
}
/* Variables and functions */
scalar_t__ en_US_islower(int);
int en_US_toupper(int c) {
  { return en_US_islower(c) ? (c - 'a' + 'A') : c; }
}


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

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

LLVM IR (-O0):
define i32 @en_US_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @en_US_islower(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, 97
%9 = add nsw i32 %8, 65
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 @en_US_toupper(i32 %0) {
%2 = tail call i64 @en_US_islower(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
}
f(float *p, float v) {
  int r = (int)v + (int)*p;
  *p = 7;
  return r;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cvttss2si (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0xed5(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cvttss2si (%rdi),%eax
cvttss2si %xmm0,%ecx
add    %ecx,%eax
movl   $0x40e00000,(%rdi)
ret

LLVM IR (-O0):
define i32 @f(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca i32
store float* %0, float** %3
store float %1, float* %4
%6 = load float, float* %4
%7 = fptosi float %6 to i32
%8 = load float*, float** %3
%9 = load float, float* %8
%10 = fptosi float %9 to i32
%11 = add nsw i32 %7, %10
store i32 %11, i32* %5
%12 = load float*, float** %3
store float 7.000000e+00, float* %12
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(float* nocapture %0, float %1) {
%3 = fptosi float %1 to i32
%4 = load float, float* %0
%5 = fptosi float %4 to i32
%6 = add nsw i32 %5, %3
store float 7.000000e+00, float* %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ llsif_rename_xml_full(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void llsif_rename_xml(int accnum) {
  char newname[260] = {0};
  sprintf(newname, "GameEngineActivity%d.xml", accnum);
  llsif_rename_xml_full(newname);
}


x86 assembly (clang, -O0):
<llsif_rename_xml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x104,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <llsif_rename_xml_full@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llsif_rename_xml>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    $0x104,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xeab(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <llsif_rename_xml_full@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"GameEngineActivity%d.xml\00"
define void @llsif_rename_xml(i32 %0) {
%2 = alloca [260 x i8]
%3 = getelementptr inbounds [260 x i8], [260 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @llsif_rename_xml_full(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430Usart1P__Usart__enableIntr();
void Msp430UartP__0__Usart__enableIntr(void) {
  HplMsp430Usart1P__Usart__enableIntr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430UartP__0__Usart__enableIntr() {
%1 = tail call i32 (...) @HplMsp430Usart1P__Usart__enableIntr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main() {
  char a = 0;
  foo(&a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @foo(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
unsigned int Command_Echo_Execute(char **args, unsigned int argCount) {
  unsigned int i;
  for (i = 1; i < argCount; i++) {
    printf("%s ", args[i]);
  }
  return 1;
}


x86 assembly (clang, -O0):
<Command_Echo_Execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1157 <Command_Echo_Execute+0x47>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Command_Echo_Execute+0x16>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Command_Echo_Execute>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%esi
jb     1145 <Command_Echo_Execute+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <Command_Echo_Execute+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @Command_Echo_Execute(i8** nocapture %0, i32 %1) {
%3 = icmp ugt i32 %1, 1
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 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %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
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void write_le_dword(FILE *f, unsigned int ledword) {
  unsigned char c;
  int x;
  for (x = 0; x < 4; x++) {
    c = (ledword >> (x << 3)) & 0xff;
    fwrite(&c, sizeof(char), 1, f);
  }
}


x86 assembly (clang, -O0):
<write_le_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1165 <write_le_dword+0x55>
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
shr    %cl,%eax
and    $0xff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xd(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <write_le_dword+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_le_dword>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movsbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x8,%eax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
sar    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @write_le_dword(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = shl i32 %12, 3
%14 = lshr i32 %11, %13
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
store i8 %16, i8* %5
%17 = load i32*, i32** %3
%18 = call i32 @fwrite(i8* %5, i32 1, i32 1, i32* %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @write_le_dword(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = tail call i32 @fputc(i32 %4, i32* %0)
%6 = shl i32 %1, 16
%7 = ashr i32 %6, 24
%8 = tail call i32 @fputc(i32 %7, i32* %0)
%9 = shl i32 %1, 8
%10 = ashr i32 %9, 24
%11 = tail call i32 @fputc(i32 %10, i32* %0)
%12 = ashr i32 %1, 24
%13 = tail call i32 @fputc(i32 %12, i32* %0)
ret void
}
int lengthOf(char *a) {
  int len;
  for (len = 0; a[len] != '\0'; len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<lengthOf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <lengthOf+0x37>
jmp    1129 <lengthOf+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lengthOf+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lengthOf>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <lengthOf+0x10>
ret

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

LLVM IR (-O2):
define i32 @lengthOf(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int Index(int v) {
  unsigned int r = 0;
  while (v >>= 1) {
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<Index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <Index+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Index+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Index>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <Index+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <Index+0x10>
ret

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

LLVM IR (-O2):
define i32 @Index(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ReverseGPIOP__1__Out__makeOutput();
void LedsP__Led2__makeOutput(void) { ReverseGPIOP__1__Out__makeOutput(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__makeOutput() {
%1 = tail call i32 (...) @ReverseGPIOP__1__Out__makeOutput()
ret void
}
to_xy(lhex, rhex, row, col) char lhex, rhex, *row, *col;
{
  *row = (lhex - rhex) + 7;
  *col = 50 - (lhex + rhex);
}


x86 assembly (clang, -O0):
<to_xy>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
sub    %ecx,%eax
add    $0x7,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x5(%rbp),%ecx
movsbl -0x6(%rbp),%eax
add    %eax,%ecx
mov    $0x32,%eax
sub    %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_xy>:
mov    %edi,%eax
sub    %esi,%eax
add    $0x7,%al
mov    %al,(%rdx)
add    %edi,%esi
mov    $0x32,%al
sub    %sil,%al
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define i32 @to_xy(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i8*
%10 = trunc i32 %0 to i8
%11 = trunc i32 %1 to i8
store i8 %10, i8* %6
store i8 %11, i8* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %13, %15
%17 = add nsw i32 %16, 7
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %8
store i8 %18, i8* %19
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
%22 = load i8, i8* %7
%23 = sext i8 %22 to i32
%24 = add nsw i32 %21, %23
%25 = sub nsw i32 50, %24
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %9
store i8 %26, i8* %27
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @to_xy(i32 %0, i32 %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = sub i32 %0, %1
%6 = trunc i32 %5 to i8
%7 = add i8 %6, 7
store i8 %7, i8* %2
%8 = add i32 %1, %0
%9 = trunc i32 %8 to i8
%10 = sub i8 50, %9
store i8 %10, i8* %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int x = 100;
  printf("dec = %d; octal = %o; hex = %x\n", x, x, x);
  printf("dec = %d; octal = %#o; hex = %#x\n", x, x, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [34 x i8] c"dec = %d; octal = %#o; hex = %#x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [34 x i8] c"dec = %d; octal = %#o; hex = %#x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 100, i32 100, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 100, i32 100)
ret i32 0
}
void RTPollSetEventsChange(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPollSetEventsChange() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int c;
  int mm[2] = {1, 2};
  c = mm[1] >= mm[0];
  print("c 1");
  printid(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.mm = [2 x i32] [i32 1, i32 2]
@.str = [4 x i8] c"c 1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 0, i32* %1
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%8 = load i32, i32* %7
%9 = icmp sge i32 %6, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %2
%11 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @printid(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"c 1\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 1)
ret i32 0
}
int kbase_rk_dvfs_init(struct kbase_device *kbdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kbase_device = type opaque
define i32 @kbase_rk_dvfs_init(%struct.kbase_device* nocapture readnone %0) {
ret i32 0
}
int implicationValue(int x, int y) {
  if (x == 1) {
    if (y == 1) {
      return 1;
      ;
    } else
      return 0;
    ;
  } else
    return 1;
  ;
}


x86 assembly (clang, -O0):
<implicationValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1136 <implicationValue+0x36>
cmpl   $0x1,-0xc(%rbp)
jne    112a <implicationValue+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    113d <implicationValue+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    113d <implicationValue+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<implicationValue>:
cmp    $0x1,%edi
setne  %al
cmp    $0x1,%esi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @implicationValue(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 1
%4 = icmp eq i32 %1, 1
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ getuid();
int /*<<< orphan*/ printf(char *, long);
int main() {
  printf("uid:%ld\n", (long)getuid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"uid:%ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getuid()
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"uid:%ld\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getuid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Type definitions */
struct mbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, struct mbuf *);
void m_freem(struct mbuf *m) { printf("free %p\n", m); }


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

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

LLVM IR (-O2):
%struct.mbuf = type { i32 }
@.str = [9 x i8] c"free %p\0A\00"
define void @m_freem(%struct.mbuf* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.mbuf* %0)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef unsigned long socklen_t;

/* Variables and functions */
int __socketcall(int, unsigned long *);
int bind(int sockfd, const struct sockaddr *myaddr, socklen_t addrlen) {
  unsigned long args[3];
  args[0] = sockfd;
  args[1] = (unsigned long)myaddr;
  args[2] = addrlen;
  return __socketcall(2, args);
}


x86 assembly (clang, -O0):
<bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x2,%edi
call   1030 <__socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
call   1030 <__socketcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @bind(i32 %0, %struct.sockaddr* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i64
%7 = alloca [3 x i64]
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
store i64 %9, i64* %10
%11 = load %struct.sockaddr*, %struct.sockaddr** %5
%12 = ptrtoint %struct.sockaddr* %11 to i64
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 1
store i64 %12, i64* %13
%14 = load i64, i64* %6
%15 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 2
store i64 %14, i64* %15
%16 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%17 = call i32 @__socketcall(i32 2, i64* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @bind(i32 %0, %struct.sockaddr* %1, i64 %2) {
%4 = alloca [3 x i64]
%5 = bitcast [3 x i64]* %4 to i8*
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
store i64 %6, i64* %7
%8 = ptrtoint %struct.sockaddr* %1 to i64
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
store i64 %8, i64* %9
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
store i64 %2, i64* %10
%11 = call i32 @__socketcall(i32 2, i64* %7)
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_color_sensor_get_ambient(int32_t port) { return 0; }


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

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

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

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

/* Variables and functions */
char *get_credentials_path(struct configuration *, char *);
char *get_credentials_file(struct configuration *config) {
  return get_credentials_path(config, "credentials");
}


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

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

LLVM IR (-O0):
%struct.configuration = type { i32 }
@.str = [12 x i8] c"credentials\00"
define i8* @get_credentials_file(%struct.configuration* %0) {
%2 = alloca %struct.configuration*
store %struct.configuration* %0, %struct.configuration** %2
%3 = load %struct.configuration*, %struct.configuration** %2
%4 = call i8* @get_credentials_path(%struct.configuration* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.configuration = type { i32 }
@.str = [12 x i8] c"credentials\00"
define i8* @get_credentials_file(%struct.configuration* %0) {
%2 = tail call i8* @get_credentials_path(%struct.configuration* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int kill(int /*<<< orphan*/, int);
int killpg(pid_t pgid, int sig) { return kill(-pgid, sig); }


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

x86 assembly (clang, -O2):
<killpg>:
neg    %edi
jmp    1030 <kill@plt>

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

LLVM IR (-O2):
define i32 @killpg(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
%4 = tail call i32 @kill(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_move(void *move) { printf("%d\n", *((int *)move)); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_move(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void xreset(void) { return; }


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

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

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

LLVM IR (-O2):
define void @xreset() {
ret void
}