xunge/DecIR huggingface dataset:
void mmi_acpu_bin_set(int *speed, int *pvs, int *ver) {}


x86 assembly (clang, -O0):
<mmi_acpu_bin_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mmi_acpu_bin_set(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
ret void
}

LLVM IR (-O2):
define void @mmi_acpu_bin_set(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("\nHello\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\0AHello\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"\0AHello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void CyDelayUs(int us) {}


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

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

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

LLVM IR (-O2):
define void @CyDelayUs(i32 %0) {
ret void
}
/* Variables and functions */
int libc_system(char const *);
int /*<<< orphan*/ watch_log(char *, char const *);
int system(const char *command) {
  watch_log("exec %s\n", command);
  return libc_system(command);
}


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

x86 assembly (clang, -O2):
<system>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <watch_log@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <libc_system@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"exec %s\0A\00"
define i32 @system(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @libc_system(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"exec %s\0A\00"
define i32 @system(i8* %0) {
%2 = tail call i32 @watch_log(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @libc_system(i8* %0)
ret i32 %3
}
int sys_is_big_endian(void) {
  long one = 1;
  return !(*((char *)(&one)));
}


x86 assembly (clang, -O0):
<sys_is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sys_is_big_endian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sys_is_big_endian() {
ret i32 0
}
char test_40_0(char *mem) { return __atomic_fetch_add(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_40_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%al
lock xadd %al,0x4(%rcx)
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_40_0>:
mov    $0x1,%al
lock xadd %al,0x4(%rdi)
ret

LLVM IR (-O0):
define signext i8 @test_40_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw add i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_40_0(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = atomicrmw add i8* %2, i8 1 acq_rel
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (ptr)
    free(ptr);
  ;
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
long g_free_library(long);
long xrdp_mm_sync_unload(long param1, long param2) {
  return g_free_library(param1);
}


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

x86 assembly (clang, -O2):
<xrdp_mm_sync_unload>:
jmp    1030 <g_free_library@plt>

LLVM IR (-O0):
define i64 @xrdp_mm_sync_unload(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 = call i64 @g_free_library(i64 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @xrdp_mm_sync_unload(i64 %0, i64 %1) {
%3 = tail call i64 @g_free_library(i64 %0)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x66() {
  Assert_real((isascii(102)),
              "/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_isascii.c",
              515, ("isascii should be 1 for f"));
}


x86 assembly (clang, -O0):
<t_isascii_0x66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x66,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x203,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x66>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x203,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for f\00"
define void @t_isascii_0x66() {
%1 = call i32 @isascii(i32 102)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for f\00"
define void @t_isascii_0x66() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ rw_msg(int, void *, int, size_t);
ssize_t write_msg(int sd, void *msg, size_t size) {
  return rw_msg(sd, msg, 0x01, size);
}


x86 assembly (clang, -O0):
<write_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <rw_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_msg>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <rw_msg@plt>

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

LLVM IR (-O2):
define i32 @write_msg(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @rw_msg(i32 %0, i8* %1, i32 1, i64 %2)
ret i32 %4
}
regx0regx1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     1140 <regx0regx1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <regx0regx1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0regx1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

LLVM IR (-O0):
define i32 @regx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = load i32, i32* %10
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32*, i32** %13
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = icmp ule i32 %18, %23
br i1 %24, label %25, label %26
25: ; preds = %6
store i32 1, i32* %7
br label %27
26: ; preds = %6
store i32 0, i32* %7
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
define i32 @regx0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* %5, i64 %10
%12 = load i32, i32* %11
%13 = icmp ule i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ initializeRandom();
int rand();
int getRandom(void) {
  static char flag = 1;
  if (flag) {
    flag = 0;
    initializeRandom();
  }
  return rand();
}


x86 assembly (clang, -O0):
<getRandom>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f05(%rip)
je     113f <getRandom+0x1f>
movb   $0x0,0x2ef8(%rip)
mov    $0x0,%al
call   1030 <initializeRandom@plt>
mov    $0x0,%al
call   1040 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandom>:
push   %rax
cmpb   $0x0,0x2f09(%rip)
jne    1138 <getRandom+0x18>
movb   $0x1,0x2f00(%rip)
xor    %eax,%eax
call   1030 <initializeRandom@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <rand@plt>

LLVM IR (-O0):
@getRandom.flag = internal global i8 1
define i32 @getRandom() {
%1 = load i8, i8* @getRandom.flag
%2 = icmp ne i8 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
store i8 0, i8* @getRandom.flag
%4 = call i32 (...) @initializeRandom()
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @rand()
ret i32 %6
}

LLVM IR (-O2):
@getRandom.flag = internal unnamed_addr global i1 false
define i32 @getRandom() {
%1 = load i1, i1* @getRandom.flag
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @getRandom.flag
%3 = tail call i32 (...) @initializeRandom()
br label %4
4: ; preds = %2, %0
%5 = tail call i32 (...) @rand()
ret i32 %5
}
int AnyBitsSet(unsigned short *pt, int bits, int bite) {
  int i;
  for (i = bits; i < bite; ++i)
    if (pt[i >> 4] & (1 << (15 - (i & 15))))
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<AnyBitsSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1171 <AnyBitsSet+0x71>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
movzwl (%rax,%rcx,2),%eax
mov    -0x1c(%rbp),%edx
and    $0xf,%edx
mov    $0xf,%ecx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115e <AnyBitsSet+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1178 <AnyBitsSet+0x78>
jmp    1163 <AnyBitsSet+0x63>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1114 <AnyBitsSet+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AnyBitsSet>:
xor    %eax,%eax
cmp    %edx,%esi
jge    1134 <AnyBitsSet+0x34>
cs nopw 0x0(%rax,%rax,1)
mov    %esi,%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
movzwl (%rdi,%rcx,2),%r8d
mov    %esi,%ecx
not    %cl
and    $0xf,%cl
movzbl %cl,%ecx
bt     %ecx,%r8d
jb     1135 <AnyBitsSet+0x35>
add    $0x1,%esi
cmp    %esi,%edx
jne    1110 <AnyBitsSet+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @AnyBitsSet(i16* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i16* %0, i16** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
store i32 %9, i32* %8
br label %10
10: ; preds = %30, %3
%11 = load i32, i32* %8
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %33
14: ; preds = %10
%15 = load i16*, i16** %5
%16 = load i32, i32* %8
%17 = ashr i32 %16, 4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %15, i64 %18
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = load i32, i32* %8
%23 = and i32 %22, 15
%24 = sub nsw i32 15, %23
%25 = shl i32 1, %24
%26 = and i32 %21, %25
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %14
store i32 1, i32* %4
br label %34
29: ; preds = %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %8
%32 = add nsw i32 %31, 1
store i32 %32, i32* %8
br label %10
33: ; preds = %10
store i32 0, i32* %4
br label %34
34: ; preds = %33, %28
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @AnyBitsSet(i16* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %7, label %20
5: ; preds = %7
%6 = icmp eq i32 %19, %2
br i1 %6, label %20, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %19, %5 ], [ %1, %3 ]
%9 = ashr i32 %8, 4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* %0, i64 %10
%12 = load i16, i16* %11
%13 = zext i16 %12 to i32
%14 = and i32 %8, 15
%15 = xor i32 %14, 15
%16 = shl nuw i32 1, %15
%17 = and i32 %16, %13
%18 = icmp eq i32 %17, 0
%19 = add i32 %8, 1
br i1 %18, label %5, label %20
20: ; preds = %7, %5, %3
%21 = phi i32 [ 0, %3 ], [ 0, %5 ], [ 1, %7 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void good() { printf("Hello!"); }


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

x86 assembly (clang, -O2):
<good>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Hello!\00"
define void @good() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello!\00"
define void @good() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int positiveEdge_0(int a, int b) { return ((!a) && b); }


x86 assembly (clang, -O0):
<positiveEdge_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <positiveEdge_0+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<positiveEdge_0>:
test   %edi,%edi
sete   %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @positiveEdge_0(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @positiveEdge_0(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int do_535() { return 535; }


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

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

LLVM IR (-O0):
define i32 @do_535() {
ret i32 535
}

LLVM IR (-O2):
define i32 @do_535() {
ret i32 535
}
/* Variables and functions */
int /*<<< orphan*/ armRaiseSafe(int /*<<< orphan*/);
void armFlatSafe() { armRaiseSafe(0); }


x86 assembly (clang, -O0):
<armFlatSafe>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <armRaiseSafe@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @armFlatSafe() {
%1 = call i32 @armRaiseSafe(i32 0)
ret void
}

LLVM IR (-O2):
define void @armFlatSafe() {
%1 = tail call i32 @armRaiseSafe(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ main(int, char **);
void _start(int argc, char *argv[]) { exit(main(argc, argv)); }


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @_start(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @main(i32 %5, i8** %6)
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1) {
%3 = tail call i32 @main(i32 %0, i8** %1)
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void unregister_partial_resume(struct partial_resume *handler) {}


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

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

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

LLVM IR (-O2):
%struct.partial_resume = type opaque
define void @unregister_partial_resume(%struct.partial_resume* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int hea_test_u64_bit(int /*<<< orphan*/ const, int);
int hea_cq_aer_eq_out_of_range_err_check(const __u64 *aer) {
  return hea_test_u64_bit(*aer, 11);
}


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

x86 assembly (clang, -O2):
<hea_cq_aer_eq_out_of_range_err_check>:
mov    (%rdi),%edi
mov    $0xb,%esi
jmp    1030 <hea_test_u64_bit@plt>

LLVM IR (-O0):
define i32 @hea_cq_aer_eq_out_of_range_err_check(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @hea_test_u64_bit(i32 %4, i32 11)
ret i32 %5
}

LLVM IR (-O2):
define i32 @hea_cq_aer_eq_out_of_range_err_check(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_test_u64_bit(i32 %2, i32 11)
ret i32 %3
}
/* Type definitions */
struct usb_endpoint_descriptor {
  int dummy;
};

/* Variables and functions */
scalar_t__ usb_endpoint_dir_out(struct usb_endpoint_descriptor const *);
scalar_t__ usb_endpoint_xfer_int(struct usb_endpoint_descriptor const *);
int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd) {
  return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd));
}


x86 assembly (clang, -O0):
<usb_endpoint_is_int_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <usb_endpoint_xfer_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <usb_endpoint_is_int_out+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <usb_endpoint_dir_out@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_endpoint_is_int_out>:
push   %rbx
mov    %rdi,%rbx
call   1040 <usb_endpoint_xfer_int@plt>
test   %rax,%rax
je     1143 <usb_endpoint_is_int_out+0x23>
mov    %rbx,%rdi
call   1030 <usb_endpoint_dir_out@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_int_out(%struct.usb_endpoint_descriptor* %0) {
%2 = alloca %struct.usb_endpoint_descriptor*
store %struct.usb_endpoint_descriptor* %0, %struct.usb_endpoint_descriptor** %2
%3 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%4 = call i64 @usb_endpoint_xfer_int(%struct.usb_endpoint_descriptor* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%8 = call i64 @usb_endpoint_dir_out(%struct.usb_endpoint_descriptor* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_int_out(%struct.usb_endpoint_descriptor* %0) {
%2 = tail call i64 @usb_endpoint_xfer_int(%struct.usb_endpoint_descriptor* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @usb_endpoint_dir_out(%struct.usb_endpoint_descriptor* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int open(char const *, int);
int /*<<< orphan*/ perror(char *);
int i_open(const char *pathname, int flags) {
  int fd;
  if ((fd = open(pathname, flags)) == -1) {
    perror("open_failed");
    exit(1);
  }
  return (fd);
}


x86 assembly (clang, -O0):
<i_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
jne    116d <i_open+0x3d>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_open>:
push   %rax
call   1030 <open@plt>
cmp    $0xffffffff,%eax
je     113d <i_open+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"open_failed\00"
define i32 @i_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"open_failed\00"
define i32 @i_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ endian_rev32(int /*<<< orphan*/);
uint32_t endian_to_big32(uint32_t data) { return endian_rev32(data); }


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

x86 assembly (clang, -O2):
<endian_to_big32>:
jmp    1030 <endian_rev32@plt>

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

LLVM IR (-O2):
define i32 @endian_to_big32(i32 %0) {
%2 = tail call i32 @endian_rev32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int _binary_search(int *, int /*<<< orphan*/, int, int);
int binary_search(int *array, int length, int key) {
  return _binary_search(array, 0, length - 1, key);
}


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

x86 assembly (clang, -O2):
<binary_search>:
mov    %edx,%ecx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <_binary_search@plt>

LLVM IR (-O0):
define i32 @binary_search(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 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @_binary_search(i32* %7, i32 0, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @binary_search(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @_binary_search(i32* %0, i32 0, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ nmm_get_cpu(int *, int *);
void nmm_get_cpu_(int *c, int *i) { nmm_get_cpu(c, i); }


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

x86 assembly (clang, -O2):
<nmm_get_cpu_>:
jmp    1030 <nmm_get_cpu@plt>

LLVM IR (-O0):
define void @nmm_get_cpu_(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 @nmm_get_cpu(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @nmm_get_cpu_(i32* %0, i32* %1) {
%3 = tail call i32 @nmm_get_cpu(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "socket headers are missing, cannot test networking\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"socket headers are missing, cannot test networking\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"socket headers are missing, cannot test networking\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int module(int n, int mo) {
  n = n % mo;
  while (n < 0) {
    n += mo;
  }
  return n;
}


x86 assembly (clang, -O0):
<module>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112c <module+0x2c>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1114 <module+0x14>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<module>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sub    %esi,%eax
nopl   0x0(%rax)
add    %esi,%eax
js     1110 <module+0x10>
ret

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

LLVM IR (-O2):
define i32 @module(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %3, %2 ], [ %7, %4 ]
%6 = icmp slt i32 %5, 0
%7 = add nsw i32 %5, %1
br i1 %6, label %4, label %8
8: ; preds = %4
ret i32 %5
}
int test_imm_42int64_midword_reg(long long val) {
  return ((val >> 16) & (0x42 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_42int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x42,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_42int64_midword_reg>:
test   $0x420000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_42int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 66
%6 = icmp ne i64 %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_42int64_midword_reg(i64 %0) {
%2 = and i64 %0, 4325376
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int wait() {
  int retval;
  __asm__("int $0x80      \n\t"
          "mov %%eax, %0"
          : "=m"(retval)
          : "a"(8)
          : "memory");
  return retval;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%eax
int    $0x80
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
mov    $0x8,%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @wait() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @wait() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
/* Variables and functions */
double ln_get_uranus_earth_dist(double);
double ln_get_uranus_sdiam(double JD) {
  double So = 35.02;
  double dist;
  dist = ln_get_uranus_earth_dist(JD);
  return So / dist;
}


x86 assembly (clang, -O0):
<ln_get_uranus_sdiam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_uranus_earth_dist@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_uranus_sdiam>:
push   %rax
call   1030 <ln_get_uranus_earth_dist@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ln_get_uranus_sdiam(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 3.502000e+01, double* %3
%5 = load double, double* %2
%6 = call double @ln_get_uranus_earth_dist(double %5)
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @ln_get_uranus_sdiam(double %0) {
%2 = tail call double @ln_get_uranus_earth_dist(double %0)
%3 = fdiv double 3.502000e+01, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
int main(int argc, char *argv[]) { rmdir(argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <rmdir@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @rmdir(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @rmdir(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"hello!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ _hurd_get_host_config(char *, char *, size_t);
int getdomainname(char *name, size_t len) {
  ssize_t n = _hurd_get_host_config("/etc/nisdomain", name, len);
  return n < 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<getdomainname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <_hurd_get_host_config@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdomainname>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <_hurd_get_host_config@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/etc/nisdomain\00"
define i32 @getdomainname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @_hurd_get_host_config(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp slt i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 -1, i32 0
ret i32 %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"/etc/nisdomain\00"
define i32 @getdomainname(i8* %0, i64 %1) {
%3 = tail call i64 @_hurd_get_host_config(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ name;

/* Variables and functions */
int getdomainname(char *, int);
int setdomainname(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(void) {
  char name[128];
  int ret;
  ret = getdomainname(name, sizeof(name));
  if (ret == 0) {
    ret = setdomainname(name, strlen(name));
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x80,%esi
call   1030 <getdomainname@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
jne    1194 <main+0x64>
lea    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x90(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xa0(%rbp),%rdi
mov    %eax,%esi
call   1050 <setdomainname@plt>
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rdi
mov    $0x80,%esi
call   1030 <getdomainname@plt>
test   %eax,%eax
jne    115e <main+0x2e>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <setdomainname@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = call i32 @getdomainname(i8* %4, i32 128)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @setdomainname(i8* %9, i32 %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %8, %0
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @getdomainname(i8* %2, i32 128)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @strlen(i8* %2)
%7 = call i32 @setdomainname(i8* %2, i32 %6)
br label %8
8: ; preds = %5, %0
%9 = phi i32 [ %7, %5 ], [ %3, %0 ]
ret i32 %9
}
int execute_mknod() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mknod() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
int get_XReparentEvent_y(void *_p) { return (int)((XReparentEvent *)_p)->y; }


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

x86 assembly (clang, -O2):
<get_XReparentEvent_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XReparentEvent_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XReparentEvent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
cbuf15(f, n) { return (cbuf(f, n, 15)); }


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

x86 assembly (clang, -O2):
<cbuf15>:
mov    $0xf,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf15(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 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 15)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf15(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 15)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void circle(double x, double y) {
  double a = x * x + y * y;
  if (a > 1.0) {
    printf("Bad points %g, %g\n", x, y);
  } else {
    printf("Good points %g, %g\n", x, y);
  }
}


x86 assembly (clang, -O0):
<circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1175 <circle+0x65>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    118b <circle+0x7b>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle>:
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
ucomisd 0xed4(%rip),%xmm3
lea    0xed5(%rip),%rax
lea    0xee1(%rip),%rdi
cmova  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Bad points %g, %g\0A\00"
@.str.1 = [20 x i8] c"Good points %g, %g\0A\00"
define void @circle(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = call double @llvm.fmuladd.f64(double %6, double %7, double %10)
store double %11, double* %5
%12 = load double, double* %5
%13 = fcmp ogt double %12, 1.000000e+00
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load double, double* %3
%16 = load double, double* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %15, double %16)
br label %22
18: ; preds = %2
%19 = load double, double* %3
%20 = load double, double* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), double %19, double %20)
br label %22
22: ; preds = %18, %14
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Bad points %g, %g\0A\00"
@.str.1 = [20 x i8] c"Good points %g, %g\0A\00"
define void @circle(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = fcmp ogt double %4, 1.000000e+00
%6 = select i1 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, double %0, double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char prog_name[]) {
  fprintf(stderr, "usage:  %s <order of matrices> \n", prog_name);
  exit(0);
}


x86 assembly (clang, -O0):
<Usage>:
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>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"usage: %s <order of matrices> \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 ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: %s <order of matrices> \0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int ioprio2class(int ioprio) { return ioprio >> 13; }


x86 assembly (clang, -O0):
<ioprio2class>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioprio2class>:
mov    %edi,%eax
sar    $0xd,%eax
ret

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

LLVM IR (-O2):
define i32 @ioprio2class(i32 %0) {
%2 = ashr i32 %0, 13
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int scmLock(sqlite3_file *pFile, int eLock) { return SQLITE_OK; }


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

x86 assembly (clang, -O2):
<scmLock>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @scmLock(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *pname) { fprintf(stderr, "usage: %s <port>\n", pname); }


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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <port>\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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"usage: %s <port>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}