xunge/DecIR huggingface dataset:
/* Variables and functions */
float nsvg__atof(char const *);
float nsvg__parseOpacity(const char *str) {
  float val = nsvg__atof(str);
  if (val < 0.0f)
    val = 0.0f;
  if (val > 1.0f)
    val = 1.0f;
  return val;
}


x86 assembly (clang, -O0):
<nsvg__parseOpacity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <nsvg__atof@plt>
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    113f <nsvg__parseOpacity+0x2f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1162 <nsvg__parseOpacity+0x52>
movss  0xea3(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__parseOpacity>:
push   %rax
call   1030 <nsvg__atof@plt>
xorps  %xmm1,%xmm1
maxss  %xmm0,%xmm1
movss  0xedb(%rip),%xmm0
minss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @nsvg__parseOpacity(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call float @nsvg__atof(i8* %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store float 0.000000e+00, float* %3
br label %9
9: ; preds = %8, %1
%10 = load float, float* %3
%11 = fcmp ogt float %10, 1.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %9
store float 1.000000e+00, float* %3
br label %13
13: ; preds = %12, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @nsvg__parseOpacity(i8* %0) {
%2 = tail call float @nsvg__atof(i8* %0)
%3 = fcmp olt float %2, 0.000000e+00
%4 = select i1 %3, float 0.000000e+00, float %2
%5 = fcmp ogt float %4, 1.000000e+00
%6 = select i1 %5, float 1.000000e+00, float %4
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("going to access bad address 0xc0000001 (kernel)...\n");
  char *adr = (char *)(0xc0000001);
  char x = *adr;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc0000001,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"going to access bad address 0xc0000001 (kernel)...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
store i8* inttoptr (i64 3221225473 to i8*), i8** %6
%9 = load i8*, i8** %6
%10 = load i8, i8* %9
store i8 %10, i8* %7
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [51 x i8] c"going to access bad address 0xc0000001 (kernel)...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ agindex(void *, char *);
int agxset(void *, int /*<<< orphan*/, char *);
int agset(void *obj, char *attr, char *value) {
  return agxset(obj, agindex(obj, attr), value);
}


x86 assembly (clang, -O0):
<agset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <agindex@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1030 <agxset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agset>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1040 <agindex@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <agxset@plt>

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

LLVM IR (-O2):
define i32 @agset(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @agindex(i8* %0, i8* %1)
%5 = tail call i32 @agxset(i8* %0, i32 %4, i8* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ check(int, int, int);
int /*<<< orphan*/ reg_set(int, int, int);
void _lc(int des, int const8) {
  check(des, 1, 1);
  check(const8, 3, 2);
  reg_set(0x1, des, const8);
}


x86 assembly (clang, -O0):
<_lc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <check@plt>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1040 <check@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x1,%edi
call   1030 <reg_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%esi
mov    $0x1,%edx
call   1040 <check@plt>
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1040 <check@plt>
mov    $0x1,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <reg_set@plt>

LLVM IR (-O0):
define void @_lc(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 = call i32 @check(i32 %5, i32 1, i32 1)
%7 = load i32, i32* %4
%8 = call i32 @check(i32 %7, i32 3, i32 2)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @reg_set(i32 1, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @_lc(i32 %0, i32 %1) {
%3 = tail call i32 @check(i32 %0, i32 1, i32 1)
%4 = tail call i32 @check(i32 %1, i32 3, i32 2)
%5 = tail call i32 @reg_set(i32 1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rijndaelEncrypt(unsigned int *, int, unsigned char *,
                                   unsigned char *);
void aescrypt(unsigned char *blockout, unsigned char *blockin,
              unsigned int *space) {
  rijndaelEncrypt(space, 14, blockin, blockout);
}


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

x86 assembly (clang, -O2):
<aescrypt>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    %rax,%rdi
mov    $0xe,%esi
jmp    1030 <rijndaelEncrypt@plt>

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

LLVM IR (-O2):
define void @aescrypt(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @rijndaelEncrypt(i32* %2, i32 14, i8* %1, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ resources_get_int(char *, int *);
int get_warp_mode(void) {
  int value;
  if (resources_get_int("WarpMode", &value) < 0) {
    return 0;
  }
  return value;
}


x86 assembly (clang, -O0):
<get_warp_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <resources_get_int@plt>
cmp    $0x0,%rax
jge    113e <get_warp_mode+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1144 <get_warp_mode+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_warp_mode>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <resources_get_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1130 <get_warp_mode+0x20>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"WarpMode\00"
define i32 @get_warp_mode() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 @resources_get_int(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"WarpMode\00"
define i32 @get_warp_mode() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @resources_get_int(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp slt i64 %3, 0
%5 = load i32, i32* %1
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int popen_plus_kill_by_id(int process_id) {
  char command[64];
  sprintf(command, "kill -9 %d", process_id);
  system(command);
  return 0;
}


x86 assembly (clang, -O0):
<popen_plus_kill_by_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popen_plus_kill_by_id>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"kill -9 %d\00"
define i32 @popen_plus_kill_by_id(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @system(i8* %3)
ret i32 0
}
void abort(void) {
  while (1) {
  };
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
jmp    1109 <abort+0x9>

x86 assembly (clang, -O2):
<abort>:
jmp    1100 <abort>

LLVM IR (-O0):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int round1_c();
int round1_b() { return round1_c(); }


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

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

LLVM IR (-O0):
define i32 @round1_b() {
%1 = call i32 (...) @round1_c()
ret i32 %1
}

LLVM IR (-O2):
define i32 @round1_b() {
%1 = tail call i32 (...) @round1_c()
ret i32 %1
}
void ECDSA_set_method(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_subs_pi16(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
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 <_mm_subs_pi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_subs_pi16@plt>

LLVM IR (-O0):
define i32 @test(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 @_mm_subs_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
bool nrf52_errata_26(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_26() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exibeMenuAnt(int);
int /*<<< orphan*/ printf(char *);
void menu5(int at) {
  exibeMenuAnt(at);
  printf("ATUAL: 5\n");
}


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

x86 assembly (clang, -O2):
<menu5>:
push   %rax
call   1040 <exibeMenuAnt@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [9 x i8] c"ATUAL: 5\00"
define void @menu5(i32 %0) {
%2 = tail call i32 @exibeMenuAnt(i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int main() {
  int a1 = 1, a2 = 1, a3 = 2, sum = 0;
  while (a3 < 4000000) {
    a3 = a1 + a2;
    sum += a3 * !(a3 % 2);
    a1 = a2;
    a2 = a3;
  }
  if (sum != 4613732) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3d0900,-0x10(%rbp)
jge    117a <main+0x7a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
imul   %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <main+0x27>
cmpl   $0x466664,-0x14(%rbp)
je     1193 <main+0x93>
movl   $0x1,-0x4(%rbp)
jmp    119a <main+0x9a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%eax
nopl   0x0(%rax)
mov    %edx,%esi
add    %edx,%eax
mov    %eax,%edx
not    %edx
and    $0x1,%edx
imul   %eax,%edx
add    %edx,%ecx
mov    %eax,%edx
cmp    $0x3d0900,%eax
mov    %esi,%eax
jl     1110 <main+0x10>
xor    %eax,%eax
cmp    $0x466664,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 4000000
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = load i32, i32* %4
%15 = srem i32 %14, 2
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = mul nsw i32 %13, %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %3
store i32 %22, i32* %2
%23 = load i32, i32* %4
store i32 %23, i32* %3
br label %6
24: ; preds = %6
%25 = load i32, i32* %5
%26 = icmp ne i32 %25, 4613732
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %1
br label %29
28: ; preds = %24
store i32 0, i32* %1
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = phi i32 [ 1, %0 ], [ %5, %1 ]
%4 = phi i32 [ 1, %0 ], [ %3, %1 ]
%5 = add nsw i32 %3, %4
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
%8 = mul nuw nsw i32 %7, %5
%9 = add nsw i32 %8, %2
%10 = icmp slt i32 %5, 4000000
br i1 %10, label %1, label %11
11: ; preds = %1
%12 = icmp ne i32 %9, 4613732
%13 = zext i1 %12 to i32
ret i32 %13
}
void clock_unload(void) {}


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

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

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

LLVM IR (-O2):
define void @clock_unload() {
ret void
}
void foo502(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo502(i32 %0) {
ret void
}
void do_two_times_Good(int n) {
  char a[1];
  for (int i = 0; i < n; i++) {
    n = 1;
    a[i] = 3;
  }
}


x86 assembly (clang, -O0):
<do_two_times_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <do_two_times_Good+0x38>
movl   $0x1,-0x4(%rbp)
movslq -0xc(%rbp),%rax
movb   $0x3,-0x5(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <do_two_times_Good+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_two_times_Good(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void PaHost_FreeFastMemory(void *addr, long numBytes) {
  numBytes = numBytes;
  if (addr != NULL)
    free(addr);
}


x86 assembly (clang, -O0):
<PaHost_FreeFastMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <PaHost_FreeFastMemory+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @PaHost_FreeFastMemory(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void store16_be(uint8_t dst[2], uint16_t w) {
  dst[1] = (uint8_t)w;
  w >>= 8;
  dst[0] = (uint8_t)w;
}


x86 assembly (clang, -O0):
<store16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store16_be>:
movslq %esi,%rax
mov    %rax,0x8(%rdi)
sar    $0x8,%eax
cltq
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @store16_be(i64* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %3, i64* %4
%5 = ashr i32 %1, 8
%6 = sext i32 %5 to i64
store i64 %6, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeArrayCharMap(unsigned char ***t) {
  free((char *)t[0]);
  free((char *)t);
}


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

x86 assembly (clang, -O2):
<FreeArrayCharMap>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeArrayCharMap(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = getelementptr inbounds i8**, i8*** %3, i64 0
%5 = load i8**, i8*** %4
%6 = bitcast i8** %5 to i8*
%7 = call i32 @free(i8* %6)
%8 = load i8***, i8**** %2
%9 = bitcast i8*** %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @FreeArrayCharMap(i8*** nocapture %0) {
%2 = bitcast i8*** %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = bitcast i8*** %0 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int get_lines_since_vbl(double);
int in_vblank(double dcycs) {
  int lines_since_vbl;
  lines_since_vbl = get_lines_since_vbl(dcycs);
  if (lines_since_vbl >= 0xc000) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<in_vblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <get_lines_since_vbl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xc000,-0x14(%rbp)
jl     1143 <in_vblank+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <in_vblank+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_vblank>:
push   %rax
call   1030 <get_lines_since_vbl@plt>
xor    %ecx,%ecx
cmp    $0xc000,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @in_vblank(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = call i32 @get_lines_since_vbl(double %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 49152
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @in_vblank(double %0) {
%2 = tail call i32 @get_lines_since_vbl(double %0)
%3 = icmp sgt i32 %2, 49151
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, float);
void F_FloatToStr(char *str, float f) { sprintf(str, "%2.2f", f); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%2.2f\00"
define void @F_FloatToStr(i8* nocapture writeonly %0, float %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %1)
ret void
}
int wInputShape(void *pWin) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wInputShape(i8* nocapture readnone %0) {
ret i32 0
}
int main(void) {
  const int *a;
  int *c;
  c = a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int smaller(int a, int b) {
  if (a <= b) {
    return a;
  }
  return b;
}


x86 assembly (clang, -O0):
<smaller>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <smaller+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <smaller+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smaller>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @smaller(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 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @smaller(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int eisneg(x)
unsigned short x[];
{
  if (eisnan(x))
    return (0);
  if (x[6 - 1] & 0x8000)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<eisneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <eisnan@plt>
cmp    $0x0,%eax
je     113c <eisneg+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1165 <eisneg+0x55>
mov    -0x10(%rbp),%rax
movzwl 0xa(%rax),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     115e <eisneg+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <eisneg+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eisneg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <eisnan@plt>
test   %eax,%eax
jne    112c <eisneg+0x1c>
movzwl 0xa(%r14),%ebx
shr    $0xf,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @eisneg(i16* %0) {
%2 = alloca i32
%3 = alloca i16*
store i16* %0, i16** %3
%4 = load i16*, i16** %3
%5 = call i32 (i16*, ...) bitcast (i32 (...)* @eisnan to i32 (i16*, ...)*)(i16* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %17
8: ; preds = %1
%9 = load i16*, i16** %3
%10 = getelementptr inbounds i16, i16* %9, i64 5
%11 = load i16, i16* %10
%12 = zext i16 %11 to i32
%13 = and i32 %12, 32768
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 1, i32* %2
br label %17
16: ; preds = %8
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @eisneg(i16* %0) {
%2 = tail call i32 (i16*, ...) bitcast (i32 (...)* @eisnan to i32 (i16*, ...)*)(i16* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i16, i16* %0, i64 5
%6 = load i16, i16* %5
%7 = lshr i16 %6, 15
%8 = zext i16 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [options] \n", name);
  fprintf(stderr, "For more information type: %s -h \n\n", name);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedc(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s [options] \0A\00"
@.str.1 = [36 x i8] c"For more information type: %s -h \0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int satuw(int x) {
  if (x < 0) {
    return 0;
  } else if (x > 65535) {
    return 65535;
  } else {
    return x;
  }
}


x86 assembly (clang, -O0):
<satuw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <satuw+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <satuw+0x3c>
cmpl   $0xffff,-0x8(%rbp)
jle    1136 <satuw+0x36>
movl   $0xffff,-0x4(%rbp)
jmp    113c <satuw+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<satuw>:
cmp    $0xffff,%edi
mov    $0xffff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @satuw(i32 %0) {
%2 = icmp slt i32 %0, 65535
%3 = select i1 %2, i32 %0, i32 65535
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
char *Diss_char(char *, char);
char *Diss_comma(char *pString) { return Diss_char(pString, ','); }


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

x86 assembly (clang, -O2):
<Diss_comma>:
mov    $0x2c,%esi
jmp    1030 <Diss_char@plt>

LLVM IR (-O0):
define i8* @Diss_comma(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @Diss_char(i8* %3, i8 signext 44)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Diss_comma(i8* %0) {
%2 = tail call i8* @Diss_char(i8* %0, i8 signext 44)
ret i8* %2
}
void uevent_handler() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @pathconN_nm8_decref() {
ret void
}
int test_imm_5Eint16_reg(short val) {
  return ((val) & (0x5E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Eint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x5e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_5Eint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 94
%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_5Eint16_reg(i16 signext %0) {
%2 = and i16 %0, 94
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long g(int a, int b) { return a / b; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
cltd
idiv   %esi
cltq
ret

LLVM IR (-O0):
define i64 @g(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 = sdiv i32 %5, %6
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @g(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = sext i32 %3 to i64
ret i64 %4
}
int KAPI_ia64_GetXVersion_MINOR() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @KAPI_ia64_GetXVersion_MINOR() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_vi5();
int /*<<< orphan*/ take_struct_vi5(int /*<<< orphan*/);
void test_struct_vi5() { take_struct_vi5(return_struct_vi5()); }


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

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

LLVM IR (-O0):
define void @test_struct_vi5() {
%1 = call i32 (...) @return_struct_vi5()
%2 = call i32 @take_struct_vi5(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_vi5() {
%1 = tail call i32 (...) @return_struct_vi5()
%2 = tail call i32 @take_struct_vi5(i32 %1)
ret void
}
int MPI_Dims_create(int nnodes, int ndims, int *dims) {
  dims[0] = dims[1] = dims[2] = 1;
  return 1;
}


x86 assembly (clang, -O0):
<MPI_Dims_create>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Dims_create>:
movl   $0x1,0x8(%rdx)
movabs $0x100000001,%rax
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @MPI_Dims_create(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i32, i32* %2, i64 2
store i32 1, i32* %4
%5 = getelementptr inbounds i32, i32* %2, i64 1
store i32 1, i32* %5
store i32 1, i32* %2
ret i32 1
}
double calcMeanObliquityOfEcliptic(double t) {
  return 23.0 +
         (26.0 +
          ((21.448 - t * (46.8150 + t * (0.00059 - t * (0.001813)))) / 60.0)) /
             60.0;
}


x86 assembly (clang, -O0):
<calcMeanObliquityOfEcliptic>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xef1(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xeed(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xecd(%rip),%xmm2
addsd  %xmm2,%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7e(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe6a(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe56(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcMeanObliquityOfEcliptic>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeec(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calcMeanObliquityOfEcliptic(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fneg double %5
%7 = call double @llvm.fmuladd.f64(double %6, double 1.813000e-03, double 5.900000e-04)
%8 = call double @llvm.fmuladd.f64(double %4, double %7, double 4.681500e+01)
%9 = fneg double %3
%10 = call double @llvm.fmuladd.f64(double %9, double %8, double 2.144800e+01)
%11 = fdiv double %10, 6.000000e+01
%12 = fadd double 2.600000e+01, %11
%13 = fdiv double %12, 6.000000e+01
%14 = fadd double 2.300000e+01, %13
ret double %14
}

LLVM IR (-O2):
define double @calcMeanObliquityOfEcliptic(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.813000e-03, double 5.900000e-04)
%4 = tail call double @llvm.fmuladd.f64(double %0, double %3, double 4.681500e+01)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 2.144800e+01)
%6 = fdiv double %5, 6.000000e+01
%7 = fadd double %6, 2.600000e+01
%8 = fdiv double %7, 6.000000e+01
%9 = fadd double %8, 2.300000e+01
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void saerr(char *hname) {
  fprintf(stderr, "sigaction failed to set %s handler\n", hname);
  exit(1);
}


x86 assembly (clang, -O0):
<saerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<saerr>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"sigaction failed to set %s handler\0A\00"
define void @saerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"sigaction failed to set %s handler\0A\00"
define void @saerr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int addTwo(int num) { return (num + 2); }


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

x86 assembly (clang, -O2):
<addTwo>:
lea    0x2(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @addTwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
ret i32 %4
}

LLVM IR (-O2):
define i32 @addTwo(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
const char *dclass_get_version() { return "dClass 2.0.11"; }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"dClass 2.0.11\00"
define i8* @dclass_get_version() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int *malloc(int);
void f1_b() { int *p = malloc(10); }


x86 assembly (clang, -O0):
<f1_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1_b>:
mov    $0xa,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @f1_b() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 10)
store i32* %2, i32** %1
ret void
}

LLVM IR (-O2):
define void @f1_b() {
%1 = tail call i32* @malloc(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int mkfifo(const char *pathname, mode_t mode) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<mkfifo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkfifo>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @mkfifo(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void make_npname(bufferp) char *bufferp;
{ sprintf(bufferp, "/usr/tmp/pmf%d", getpid()); }


x86 assembly (clang, -O0):
<make_npname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_npname>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/usr/tmp/pmf%d\00"
define void @make_npname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @getpid()
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/usr/tmp/pmf%d\00"
define void @make_npname(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_rect(int, int, int, int, int);
void update_char(int sid, int x, int y) { update_rect(sid, x, y, (8), (16)); }


x86 assembly (clang, -O0):
<update_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x8,%ecx
mov    $0x10,%r8d
call   1030 <update_rect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_char>:
mov    $0x8,%ecx
mov    $0x10,%r8d
jmp    1030 <update_rect@plt>

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

LLVM IR (-O2):
define void @update_char(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @update_rect(i32 %0, i32 %1, i32 %2, i32 8, i32 16)
ret void
}
/* Type definitions */
typedef int u_int64_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int __get_unaligned_be32(int /*<<< orphan*/ const *);
u_int64_t __get_unaligned_be64(const u_char *p) {
  return (u_int64_t)__get_unaligned_be32(p) << 32 | __get_unaligned_be32(p + 4);
}


x86 assembly (clang, -O0):
<__get_unaligned_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__get_unaligned_be32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <__get_unaligned_be32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_unaligned_be64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__get_unaligned_be32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__get_unaligned_be32@plt>

LLVM IR (-O0):
define i32 @__get_unaligned_be64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @__get_unaligned_be32(i32* %3)
%5 = shl i32 %4, 32
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = call i32 @__get_unaligned_be32(i32* %7)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__get_unaligned_be64(i32* %0) {
%2 = tail call i32 @__get_unaligned_be32(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @__get_unaligned_be32(i32* %3)
ret i32 poison
}