xunge/DecIR huggingface dataset:
/* Variables and functions */
double M_PI;
double sin(double);
double du_dz(double L, double a_uz, double u_z, double z) {
  return -M_PI * a_uz * u_z * sin(M_PI * a_uz * z / L) / L;
}


x86 assembly (clang, -O0):
<du_dz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2e84(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<du_dz>:
sub    $0x28,%rsp
movapd %xmm0,%xmm4
movsd  %xmm0,0x8(%rsp)
mov    0x2ec3(%rip),%rax
movsd  (%rax),%xmm0
movapd 0xecf(%rip),%xmm5
xorpd  %xmm0,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm5,0x10(%rsp)
mulsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
divsd  %xmm4,%xmm0
call   1030 <sin@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @du_dz(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* @M_PI
%10 = fneg double %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = load double, double* @M_PI
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = load double, double* %5
%21 = fdiv double %19, %20
%22 = call double @sin(double %21)
%23 = fmul double %14, %22
%24 = load double, double* %5
%25 = fdiv double %23, %24
ret double %25
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @du_dz(double %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fneg double %5
%7 = fmul double %6, %1
%8 = fmul double %7, %2
%9 = fmul double %5, %1
%10 = fmul double %9, %3
%11 = fdiv double %10, %0
%12 = tail call double @sin(double %11)
%13 = fmul double %12, %8
%14 = fdiv double %13, %0
ret double %14
}
void calculator_unload(void) {}


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

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

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

LLVM IR (-O2):
define void @calculator_unload() {
ret void
}
BOOST_AUTO_TEST_CASE(lt) {
  TESTCASE2(lt, 0, 0, 0);
  TESTCASE2(lt, 0, 1, 1);
  TESTCASE2(lt, 1, 0, 0);
  TESTCASE2(lt, 1, 1, 0);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <TESTCASE2@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0, i32 0)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %6, i32 0, i32 1, i32 1)
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %8, i32 1, i32 0, i32 0)
%10 = load i32, i32* %3
%11 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %10, i32 1, i32 1, i32 0)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0, i32 0)
%3 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1, i32 1)
%4 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0, i32 0)
%5 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 1, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xcc() {
  Assert_real((isspace(204) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1025, ("isspace should be 0 for 0xcc"));
}


x86 assembly (clang, -O0):
<t_isspace_0xcc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcc,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x401,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xcc>:
push   %rax
mov    $0xcc,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x401,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xcc\00"
define void @t_isspace_0xcc() {
%1 = call i64 @isspace(i32 204)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1025, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xcc\00"
define void @t_isspace_0xcc() {
%1 = tail call i64 @isspace(i32 204)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1025, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int read_int(const unsigned char *data, int offset) {
  return (data[offset] << 24) + (data[offset + 1] << 16) +
         (data[offset + 2] << 8) + data[offset + 3];
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @read_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 24
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = add nsw i32 %11, %19
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 8
%29 = add nsw i32 %20, %28
%30 = load i8*, i8** %3
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %30, i64 %33
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = add nsw i32 %29, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @read_int(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw i32 %6, 24
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %13, %7
%15 = add nsw i32 %1, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl nuw nsw i32 %19, 8
%21 = or i32 %14, %20
%22 = add nsw i32 %1, 3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = or i32 %21, %26
ret i32 %27
}
int UTF8_encoded_len(int c) {
  if (c <= 0x7F)
    return 1;
  if (c <= 0x07FF)
    return 2;
  if (c <= 0xFFFF)
    return 3;
  if (c <= 0x10FFFF)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<UTF8_encoded_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jg     111d <UTF8_encoded_len+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    116f <UTF8_encoded_len+0x6f>
cmpl   $0x7ff,-0x8(%rbp)
jg     1136 <UTF8_encoded_len+0x36>
movl   $0x2,-0x4(%rbp)
jmp    116f <UTF8_encoded_len+0x6f>
cmpl   $0xffff,-0x8(%rbp)
jg     114f <UTF8_encoded_len+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    116f <UTF8_encoded_len+0x6f>
cmpl   $0x10ffff,-0x8(%rbp)
jg     1168 <UTF8_encoded_len+0x68>
movl   $0x4,-0x4(%rbp)
jmp    116f <UTF8_encoded_len+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTF8_encoded_len>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1135 <UTF8_encoded_len+0x35>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1135 <UTF8_encoded_len+0x35>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1135 <UTF8_encoded_len+0x35>
xor    %eax,%eax
cmp    $0x110000,%edi
setb   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @UTF8_encoded_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 2047
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 65535
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 1114111
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @UTF8_encoded_len(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 1114112
%9 = select i1 %8, i32 4, i32 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ messErr(int);
int /*<<< orphan*/ rotateBid(long, int);
void IF_unrot(void) {
  if (!rotateBid(3L, 1))
    messErr(4);
}


x86 assembly (clang, -O0):
<IF_unrot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <rotateBid@plt>
cmp    $0x0,%eax
jne    1146 <IF_unrot+0x26>
mov    $0x4,%edi
call   1030 <messErr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_unrot>:
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <rotateBid@plt>
test   %eax,%eax
je     1136 <IF_unrot+0x16>
pop    %rax
ret
mov    $0x4,%edi
pop    %rax
jmp    1030 <messErr@plt>

LLVM IR (-O0):
define void @IF_unrot() {
%1 = call i32 @rotateBid(i64 3, i32 1)
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @messErr(i32 4)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @IF_unrot() {
%1 = tail call i32 @rotateBid(i64 3, i32 1)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @messErr(i32 4)
br label %5
5: ; preds = %3, %0
ret void
}
const char *Push_Name(void) { return "Push"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"Push\00"
define i8* @Push_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"Push\00"
define i8* @Push_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void print_error(void *ctx, const char *msg) {
  fprintf(stderr, "%s: %s\n", (const char *)ctx, msg);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @print_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
define void @print_error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p1();
int main() {
  p1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @p1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void showResult(int sum) { printf("The sum is %i\n", sum); }


x86 assembly (clang, -O0):
<showResult>:
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):
<showResult>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"The sum is %i\0A\00"
define void @showResult(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void INT_Excep_RSCAN_GLERRINT(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSCAN_GLERRINT() {
ret void
}
int diff(int x, int y) { return (x > y ? x - y : y - x); }


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <diff+0x24>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <diff+0x2d>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @diff(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = sub nsw i32 %1, %0
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
double cos(double);
double toZ(double r, double theta, double phi) {
  return r * cos(phi) * cos(theta);
}


x86 assembly (clang, -O0):
<toZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toZ>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
call   1030 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @toZ(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = call double @cos(double %8)
%10 = fmul double %7, %9
%11 = load double, double* %5
%12 = call double @cos(double %11)
%13 = fmul double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @toZ(double %0, double %1, double %2) {
%4 = tail call double @cos(double %2)
%5 = fmul double %4, %0
%6 = tail call double @cos(double %1)
%7 = fmul double %5, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_PLAY;
scalar_t__ ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int videoPlay(int fd) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_PLAY) < 0)) {
    perror("VIDEO PLAY: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoPlay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0xc(%rbp)
test   $0x1,%al
jne    115b <videoPlay+0x3b>
jmp    1173 <videoPlay+0x53>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <videoPlay+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoPlay>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113b <videoPlay+0x1b>
pop    %rcx
ret
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_PLAY = global i32 0
@.str = [13 x i8] c"VIDEO PLAY: \00"
define i32 @videoPlay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @VIDEO_PLAY
%7 = call i64 @ioctl(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
br i1 %8, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@VIDEO_PLAY = global i32 0
@.str = [13 x i8] c"VIDEO PLAY: \00"
define i32 @videoPlay(i32 %0) {
%2 = load i32, i32* @VIDEO_PLAY
%3 = tail call i64 @ioctl(i32 %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
#define ETH_P_IP 129
#define ETH_P_IPV6 128
const char *ArpProTyp2Str(int protype) {
  switch (protype) {
  case ETH_P_IP:
    return "IPv4";
  case ETH_P_IPV6:
    return "IPv6";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<ArpProTyp2Str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1140 <ArpProTyp2Str+0x40>
jmp    111d <ArpProTyp2Str+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
jne    1150 <ArpProTyp2Str+0x50>
jmp    1130 <ArpProTyp2Str+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <ArpProTyp2Str+0x5b>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <ArpProTyp2Str+0x5b>
lea    0xeb3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArpProTyp2Str>:
cmp    $0x80,%edi
lea    0xef8(%rip),%rax
lea    0xef6(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x81,%edi
lea    0xedb(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"IPv4\00"
@.str.1 = [5 x i8] c"IPv6\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @ArpProTyp2Str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 129, label %5
i32 128, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"IPv4\00"
@.str.1 = [5 x i8] c"IPv6\00"
@.str.2 = [8 x i8] c"UNKNOWN\00"
define i8* @ArpProTyp2Str(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 129
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int, int, int, void *);
int shim_reboot(int magic, int magic2, int cmd, void *arg) {
  return shim_enosys(0, magic, magic2, cmd, arg);
}


x86 assembly (clang, -O0):
<shim_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_reboot>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_reboot(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @shim_enosys(i32 0, i32 %9, i32 %10, i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @shim_reboot(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2, i8* %3)
ret i32 %5
}
void fn0800_01FA() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn0800_01FA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_version(void) {
  printf("sord_validate "
         "0.12.0"
         " <http://drobilla.net/software/sord>\n");
  printf("Copyright 2012-2013 David Robillard <http://drobilla.net>.\n"
         "License: <http://www.opensource.org/licenses/isc>\n"
         "This is free software; you are free to change and redistribute it."
         "\nThere is NO WARRANTY, to the extent permitted by law.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"sord_validate 0.12.0 <http://drobilla.net/software/sord>\0A\00"
@.str.1 = [231 x i8] c"Copyright 2012-2013 David Robillard <http://drobilla.net>.\0ALicense: <http://www.opensource.org/licenses/isc>\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\00"
define i32 @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([231 x i8], [231 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [57 x i8] c"sord_validate 0.12.0 <http://drobilla.net/software/sord>\00"
@str.2 = [230 x i8] c"Copyright 2012-2013 David Robillard <http://drobilla.net>.\0ALicense: <http://www.opensource.org/licenses/isc>\0AThis is free software; you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\00"
define i32 @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([230 x i8], [230 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void SysCtlPWMClockSet(uint32_t ui32Config) {

  ;
  ;
  (*((volatile unsigned long *)(0x400FE060))) =
      (((*((volatile unsigned long *)(0x400FE060))) &
        ~(0x00100000 | 0x000E0000)) |
       ui32Config);
}


x86 assembly (clang, -O0):
<SysCtlPWMClockSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400fe060,%eax
mov    (%rax),%rcx
and    $0xffffffffffe1ffff,%rcx
mov    -0x8(%rbp),%rax
or     %rax,%rcx
mov    $0x400fe060,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPWMClockSet>:
mov    %rdi,-0x8(%rsp)
mov    $0xffffffffffe1ffff,%rax
and    0x400fe060,%rax
40
or     -0x8(%rsp),%rax
mov    %rax,0x400fe060
40
ret

LLVM IR (-O0):
define void @SysCtlPWMClockSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%4 = and i64 %3, -1966081
%5 = load volatile i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 1074782304 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlPWMClockSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%4 = and i64 %3, -1966081
%5 = load volatile i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 1074782304 to i64*)
ret void
}
/* Type definitions */
struct opencl_x86_device_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
void opencl_x86_device_mem_write(struct opencl_x86_device_t *device,
                                 void *device_ptr, void *host_ptr,
                                 unsigned int size) {
  memcpy(device_ptr, host_ptr, size);
}


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

x86 assembly (clang, -O2):
<opencl_x86_device_mem_write>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.opencl_x86_device_t = type { i32 }
define void @opencl_x86_device_mem_write(%struct.opencl_x86_device_t* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.opencl_x86_device_t*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.opencl_x86_device_t* %0, %struct.opencl_x86_device_t** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.opencl_x86_device_t = type { i32 }
define void @opencl_x86_device_mem_write(%struct.opencl_x86_device_t* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @memcpy(i8* %1, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int result(int *);
int binaryGame(void) {
  int byte[8] = {1, 0, 1, 0, 0, 0, 1, 0};
  printf("%d\n", result(byte));
  return (1);
}


x86 assembly (clang, -O0):
<binaryGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <result@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaryGame>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <result@plt>
lea    0xed6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.binaryGame.byte = [8 x i32] [i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1, i32 0]
@.str = [4 x i8] c"%d\0A\00"
define i32 @binaryGame() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @result(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}

LLVM IR (-O2):
@__const.binaryGame.byte = [8 x i32] [i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1, i32 0]
@.str = [4 x i8] c"%d\0A\00"
define i32 @binaryGame() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @result(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}
void put_user_dlong(unsigned long val, long long *addr) { *addr = val; }


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

x86 assembly (clang, -O2):
<put_user_dlong>:
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
define void @put_user_dlong(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64, i64* %3
%6 = load i64*, i64** %4
store i64 %5, i64* %6
ret void
}

LLVM IR (-O2):
define void @put_user_dlong(i64 %0, i64* nocapture writeonly %1) {
store i64 %0, i64* %1
ret void
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
struct fsm *fsm_sequentialize(struct fsm *net) {
  printf("Implementation pending\n");
  return (net);
}


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

x86 assembly (clang, -O2):
<fsm_sequentialize>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.fsm = type { i32 }
@.str = [24 x i8] c"Implementation pending\0A\00"
define %struct.fsm* @fsm_sequentialize(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.fsm*, %struct.fsm** %2
ret %struct.fsm* %4
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
@str = [23 x i8] c"Implementation pending\00"
define %struct.fsm* @fsm_sequentialize(%struct.fsm* readnone returned %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret %struct.fsm* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ wcstombs(char *, int /*<<< orphan*/ const *, size_t);
char *to_multibyte(const wchar_t *s) {
  size_t len;
  char *result;
  len = wcstombs(NULL, s, 0) + 1;
  if ((result = malloc(len * sizeof(char))) == NULL)
    return NULL;
  wcstombs(result, s, len);
  return result;
}


x86 assembly (clang, -O0):
<to_multibyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
call   1040 <wcstombs@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    116d <to_multibyte+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    1186 <to_multibyte+0x66>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <wcstombs@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_multibyte>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %edi,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <wcstombs@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <to_multibyte+0x38>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <wcstombs@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @to_multibyte(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i8*
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @wcstombs(i8* null, i32* %6, i64 0)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = mul i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %1
store i8* null, i8** %2
br label %21
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = load i32*, i32** %3
%18 = load i64, i64* %4
%19 = call i32 @wcstombs(i8* %16, i32* %17, i64 %18)
%20 = load i8*, i8** %5
store i8* %20, i8** %2
br label %21
21: ; preds = %15, %14
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @to_multibyte(i32* %0) {
%2 = tail call i32 @wcstombs(i8* null, i32* %0, i64 0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @wcstombs(i8* %5, i32* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
void dynamic() {}


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

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

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

LLVM IR (-O2):
define void @dynamic() {
ret void
}
int test_imm_C4uint8_reg(unsigned char val) {
  return ((val) & (-0xC4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C4uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4uint8_reg>:
test   $0x3c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C4uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 60
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void g7() {}


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

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

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

LLVM IR (-O2):
define void @g7() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank2High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank2();
void m22_setParamsCXX1(uint16_t addr, uint8_t val) {
  __setCHRBank2High(addr, val);
  m22_SetChrROMBank2();
}


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

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

LLVM IR (-O0):
define void @m22_setParamsCXX1(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 = load i32, i32* %4
%7 = call i32 @__setCHRBank2High(i32 %5, i32 %6)
%8 = call i32 (...) @m22_SetChrROMBank2()
ret void
}

LLVM IR (-O2):
define void @m22_setParamsCXX1(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank2High(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank2()
ret void
}
/* Variables and functions */
int maxDivide(int, int);
int isUgly(int no) {
  no = maxDivide(no, 2);
  no = maxDivide(no, 3);
  no = maxDivide(no, 5);
  return (no == 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<isUgly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <maxDivide@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1030 <maxDivide@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1030 <maxDivide@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUgly>:
push   %rax
mov    $0x2,%esi
call   1030 <maxDivide@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1030 <maxDivide@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1030 <maxDivide@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isUgly(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @maxDivide(i32 %3, i32 2)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @maxDivide(i32 %5, i32 3)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @maxDivide(i32 %7, i32 5)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @isUgly(i32 %0) {
%2 = tail call i32 @maxDivide(i32 %0, i32 2)
%3 = tail call i32 @maxDivide(i32 %2, i32 3)
%4 = tail call i32 @maxDivide(i32 %3, i32 5)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: cal [month] year\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 = [25 x i8] c"Usage: cal [month] year\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Usage: cal [month] year\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int hydra_data_ready_timed(int, int /*<<< orphan*/, int);
int hydra_data_ready(int socket) {
  return (hydra_data_ready_timed(socket, 0, 100));
}


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

x86 assembly (clang, -O2):
<hydra_data_ready>:
xor    %esi,%esi
mov    $0x64,%edx
jmp    1030 <hydra_data_ready_timed@plt>

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

LLVM IR (-O2):
define i32 @hydra_data_ready(i32 %0) {
%2 = tail call i32 @hydra_data_ready_timed(i32 %0, i32 0, i32 100)
ret i32 %2
}
void gdev_vsched_null_schedule_compute(struct gdev_sched_entity *se) {}


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

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

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

LLVM IR (-O2):
%struct.gdev_sched_entity = type opaque
define void @gdev_vsched_null_schedule_compute(%struct.gdev_sched_entity* nocapture %0) {
ret void
}
char *strcpy(char *dest, const char *src) {
  char *s = dest;
  while (*dest++ = *src++)
    ;
  return (s);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}