xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
int main(void) {
  time_t cur_time;
  if ((cur_time = time(NULL)) == -1) {
    perror("time");
    exit(1);
  }
  printf("the current time is : %d \n", (int)cur_time);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    117a <main+0x3a>
lea    0xe95(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
cmp    $0xffffffff,%eax
jne    1163 <main+0x23>
lea    0xeac(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"time\00"
@.str.1 = [27 x i8] c"the current time is : %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"time\00"
@.str.1 = [27 x i8] c"the current time is : %d \0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%8 = tail call i32 @exit(i32 0)
unreachable
}
unsigned hashpjw(const void *key) {
  const char *ptr = key;
  unsigned int val = 0, tmp;
  while (*ptr != '\0') {
    val = (val << 4) + *ptr++;
    if ((tmp = val & (unsigned int)0xf0000000) != 0)
      val = (val ^ (tmp >> 24)) ^ tmp;
  }
  return val;
}


x86 assembly (clang, -O0):
<hashpjw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116e <hashpjw+0x6e>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xf0000000,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1169 <hashpjw+0x69>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
shr    $0x18,%ecx
xor    %ecx,%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <hashpjw+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashpjw>:
mov    (%rdi),%cl
test   %cl,%cl
je     1140 <hashpjw+0x40>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
shl    $0x4,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf0000000,%ecx
mov    %ecx,%edx
shr    $0x18,%edx
mov    %eax,%esi
and    $0xfffffff,%esi
xor    %edx,%esi
test   %ecx,%ecx
cmovne %esi,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashpjw+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hashpjw(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %18, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %17, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = shl i32 %7, 4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i32 %9, %8
%12 = and i32 %11, -268435456
%13 = icmp eq i32 %12, 0
%14 = lshr exact i32 %12, 24
%15 = and i32 %11, 268435455
%16 = xor i32 %15, %14
%17 = select i1 %13, i32 %11, i32 %16
%18 = load i8, i8* %10
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %4
20: ; preds = %4, %1
%21 = phi i32 [ 0, %1 ], [ %17, %4 ]
ret i32 %21
}
int octdigitp(int c) {
  int ret = 0;
  switch (c) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
    ret = 1;
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<octdigitp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0x7,%eax
ja     1129 <octdigitp+0x29>
jmp    1122 <octdigitp+0x22>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octdigitp>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @octdigitp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 48, label %5
i32 49, label %5
i32 50, label %5
i32 51, label %5
i32 52, label %5
i32 53, label %5
i32 54, label %5
i32 55, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %6
6: ; preds = %1, %5
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @octdigitp(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
int minmax(int min, int v, int max) {
  return (v < min) ? min : (max < v) ? max : v;
}


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

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

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

LLVM IR (-O2):
define i32 @minmax(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp slt i32 %2, %1
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int compare_gsdlines(const void *p1, const void *p2) {
  const char *const *l1 = p1, *const *l2 = p2;
  return strcmp(*l1, *l2);
}


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

x86 assembly (clang, -O2):
<compare_gsdlines>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_gsdlines(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_gsdlines(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xdb() {
  Assert_real((isdigit(219) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1100, ("isdigit should be 0 for 0xdb"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xdb\00"
define void @t_isdigit_0xdb() {
%1 = tail call i64 @isdigit(i32 219)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNCDigitLeft() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(44);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCDigitLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x2c,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCDigitLeft>:
push   %rax
mov    $0x2c,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCDigitLeft() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 44)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCDigitLeft() {
%1 = tail call i32 @BNCIO(i32 44)
ret i32 99
}
int getByteOrder() {
  union {
    long l;
    char c[4];
  } test;
  int ret = 0;
  test.l = 1;
  if (!test.c[3] && !test.c[2] && !test.c[1] && test.c[0]) {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<getByteOrder>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x5(%rbp)
jne    1145 <getByteOrder+0x45>
cmpb   $0x0,-0x6(%rbp)
jne    1145 <getByteOrder+0x45>
cmpb   $0x0,-0x7(%rbp)
jne    1145 <getByteOrder+0x45>
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1145 <getByteOrder+0x45>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i64 }
define i32 @getByteOrder() {
%1 = alloca %union.anon
%2 = alloca i32
store i32 0, i32* %2
%3 = bitcast %union.anon* %1 to i64*
store i64 1, i64* %3
%4 = bitcast %union.anon* %1 to [4 x i8]*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %25, label %8
8: ; preds = %0
%9 = bitcast %union.anon* %1 to [4 x i8]*
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 2
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %25, label %13
13: ; preds = %8
%14 = bitcast %union.anon* %1 to [4 x i8]*
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 1
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %13
%19 = bitcast %union.anon* %1 to [4 x i8]*
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %19, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %2
br label %25
25: ; preds = %24, %18, %13, %8, %0
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @getByteOrder() {
ret i32 1
}
void ARGBToARGB4444() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB4444() {
ret void
}
int main() {
  int int_bits = 8 * sizeof(int);
  int num = 0;
  int i = 0;
  while (i < int_bits) {
    num = num << 1 | 1;
    i++;
  }
  return -1 == num;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1146 <main+0x46>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <main+0x20>
mov    $0xffffffff,%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ die_out_of_memory();
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *p = strdup(str);
  if (!p)
    die_out_of_memory();
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <die_out_of_memory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xstrdup+0x15>
xor    %eax,%eax
call   1030 <die_out_of_memory@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @die_out_of_memory()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void ARGBToRAWRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRAWRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *strdup(char *);
char *xstrdup(char *str) {
  char *p = strdup(str);
  if (!p)
    die("Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xstrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void pwm_start(void) {
  (*((volatile unsigned long *)0x7F006008)) |= (1 << 1);
  (*((volatile unsigned long *)0x7F006008)) |= (1 << 0);
  (*((volatile unsigned long *)0x7F006008)) &= ~(1 << 1);
}


x86 assembly (clang, -O0):
<pwm_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f006008,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x7f006008,%eax
mov    %rcx,(%rax)
mov    $0x7f006008,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x7f006008,%eax
mov    %rcx,(%rax)
mov    $0x7f006008,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0x7f006008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_start>:
orq    $0x2,0x7f006008
7f 02
orq    $0x1,0x7f006008
7f 01
andq   $0xfffffffffffffffd,0x7f006008
7f fd
ret

LLVM IR (-O0):
define void @pwm_start() {
%1 = load volatile i64, i64* inttoptr (i64 2130731016 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 2130731016 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130731016 to i64*)
%4 = or i64 %3, 1
store volatile i64 %4, i64* inttoptr (i64 2130731016 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 2130731016 to i64*)
%6 = and i64 %5, -3
store volatile i64 %6, i64* inttoptr (i64 2130731016 to i64*)
ret void
}

LLVM IR (-O2):
define void @pwm_start() {
%1 = load volatile i64, i64* inttoptr (i64 2130731016 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 2130731016 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130731016 to i64*)
%4 = or i64 %3, 1
store volatile i64 %4, i64* inttoptr (i64 2130731016 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 2130731016 to i64*)
%6 = and i64 %5, -3
store volatile i64 %6, i64* inttoptr (i64 2130731016 to i64*)
ret void
}
unsigned int f4(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f4() {
ret i32 0
}
void _Exit(int i) {
  extern void abort(void);
  abort();
}


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @_Exit(i32 %0) {
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ debugmsg(int, char *, void *, void *, int);
void null_callback(void *user_handle, void *message_handle, int auth_status) {
  debugmsg(1, "iscsi-login: null_callback(%p, %p, %d)\n", user_handle,
           message_handle, auth_status);
}


x86 assembly (clang, -O0):
<null_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
call   1030 <debugmsg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_callback>:
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee0(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <debugmsg@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"iscsi-login: null_callback(%p, %p, %d)\0A\00"
define void @null_callback(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 i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @debugmsg(i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"iscsi-login: null_callback(%p, %p, %d)\0A\00"
define void @null_callback(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @debugmsg(i32 1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
int stbi__pnm_isspace(char c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' ||
         c == '\r';
}


x86 assembly (clang, -O0):
<stbi__pnm_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1171 <stbi__pnm_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1171 <stbi__pnm_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1171 <stbi__pnm_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xb,%ecx
mov    %al,-0x2(%rbp)
je     1171 <stbi__pnm_isspace+0x71>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x2(%rbp)
je     1171 <stbi__pnm_isspace+0x71>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__pnm_isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x4,%cl
jae    110e <stbi__pnm_isspace+0xe>
ret
cmp    $0x20,%dil
je     110d <stbi__pnm_isspace+0xd>
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @stbi__pnm_isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %26, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 11
br i1 %17, label %26, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 12
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 13
br label %26
26: ; preds = %22, %18, %14, %10, %6, %1
%27 = phi i1 [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @stbi__pnm_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 12, label %5
i8 11, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void extra_consts() {
  printf("    mod extra {\n");
  printf("    }\n");
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c" mod extra {\00"
@str.2 = [6 x i8] c" }\00"
define void @extra_consts() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
void cut_trailing_newline(char *string_in) {
  if (string_in[strlen(string_in) - 1] == '\n')
    string_in[strlen(string_in) - 1] = '\0';
}


x86 assembly (clang, -O0):
<cut_trailing_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1167 <cut_trailing_newline+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cut_trailing_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1131 <cut_trailing_newline+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cut_trailing_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %1
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int a_ctz_32(int);
int a_ctz_64(uint64_t x) {
  static const char debruijn64[64] = {
      0,  1,  2,  53, 3,  7,  54, 27, 4,  38, 41, 8,  34, 55, 48, 28,
      62, 5,  39, 46, 44, 42, 22, 9,  24, 35, 59, 56, 49, 18, 29, 11,
      63, 52, 6,  26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10,
      51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12};
  if (sizeof(long) < 8) {
    uint32_t y = x;
    if (!y) {
      y = x >> 32;
      return 32 + a_ctz_32(y);
    }
    return a_ctz_32(y);
  }
  return debruijn64[(x & -x) * 0x022fdd63cc95386dull >> 58];
}


x86 assembly (clang, -O0):
<a_ctz_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
movslq %eax,%rcx
movabs $0x22fdd63cc95386d,%rax
dd 2f 02
imul   %rax,%rcx
shr    $0x3a,%rcx
lea    0xed3(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_ctz_64>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
cltq
movabs $0x22fdd63cc95386d,%rcx
dd 2f 02
imul   %rax,%rcx
shr    $0x3a,%rcx
lea    0xedf(%rip),%rax
movsbl (%rcx,%rax,1),%eax
ret

LLVM IR (-O0):
@a_ctz_64.debruijn64 = internal constant [64 x i8] c"\00\01\025\03\076\1B\04&)\08\2270\1C>\05'.,*\16\09\18#;81\12\1D\0B?4\06\1A%(!/=-+\15\17:\11\0A3\19$ <\149\102\1F\13\0F\1E\0E\0D\0C"
define i32 @a_ctz_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 157587932685088877
%9 = lshr i64 %8, 58
%10 = getelementptr inbounds [64 x i8], [64 x i8]* @a_ctz_64.debruijn64, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@a_ctz_64.debruijn64 = internal unnamed_addr constant [64 x i8] c"\00\01\025\03\076\1B\04&)\08\2270\1C>\05'.,*\16\09\18#;81\12\1D\0B?4\06\1A%(!/=-+\15\17:\11\0A3\19$ <\149\102\1F\13\0F\1E\0E\0D\0C"
define i32 @a_ctz_64(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 157587932685088877
%6 = lshr i64 %5, 58
%7 = getelementptr inbounds [64 x i8], [64 x i8]* @a_ctz_64.debruijn64, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
ret i32 %9
}
int sort_float(const void *a, const void *b) {
  float fa = *(const float *)a;
  float fb = *(const float *)b;
  return (fa > fb) - (fa < fb);
}


x86 assembly (clang, -O0):
<sort_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sort_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
store float %9, float* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
%16 = zext i1 %15 to i32
%17 = load float, float* %5
%18 = load float, float* %6
%19 = fcmp olt float %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @sort_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp olt float %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_add_sub_cmp();
int /*<<< orphan*/ test_bin();
int /*<<< orphan*/ test_cpu_behavior();
int /*<<< orphan*/ test_mul_inv();
int /*<<< orphan*/ test_shifts();
int /*<<< orphan*/ test_valid_point();
int main(int argc, char *argv[]) {
  test_cpu_behavior();
  test_shifts();
  test_add_sub_cmp();
  test_mul_inv();
  test_valid_point();
  test_bin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <test_cpu_behavior@plt>
mov    $0x0,%al
call   1050 <test_shifts@plt>
mov    $0x0,%al
call   1070 <test_add_sub_cmp@plt>
mov    $0x0,%al
call   1040 <test_mul_inv@plt>
mov    $0x0,%al
call   1030 <test_valid_point@plt>
mov    $0x0,%al
call   1060 <test_bin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_cpu_behavior@plt>
xor    %eax,%eax
call   1050 <test_shifts@plt>
xor    %eax,%eax
call   1070 <test_add_sub_cmp@plt>
xor    %eax,%eax
call   1040 <test_mul_inv@plt>
xor    %eax,%eax
call   1030 <test_valid_point@plt>
xor    %eax,%eax
call   1060 <test_bin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_cpu_behavior()
%7 = call i32 (...) @test_shifts()
%8 = call i32 (...) @test_add_sub_cmp()
%9 = call i32 (...) @test_mul_inv()
%10 = call i32 (...) @test_valid_point()
%11 = call i32 (...) @test_bin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_cpu_behavior()
%4 = tail call i32 (...) @test_shifts()
%5 = tail call i32 (...) @test_add_sub_cmp()
%6 = tail call i32 (...) @test_mul_inv()
%7 = tail call i32 (...) @test_valid_point()
%8 = tail call i32 (...) @test_bin()
ret i32 0
}
/* Variables and functions */
short print_str(char *);
short println() { return print_str("\r\n"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define signext i16 @println() {
%1 = call signext i16 @print_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i16 %1
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define signext i16 @println() {
%1 = tail call signext i16 @print_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i16 %1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void min_caml_print_newline(void *fv, int unit) { putchar('\n'); }


x86 assembly (clang, -O0):
<min_caml_print_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @min_caml_print_newline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @min_caml_print_newline(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int int_cmp(const void *a, const void *b) {
  const uint64_t *ia = (const uint64_t *)a;
  const uint64_t *ib = (const uint64_t *)b;
  return *ia - *ib;
}


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

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

LLVM IR (-O0):
define i32 @int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void INT_Excep_AD2_ADI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_AD2_ADI2() {
ret void
}
double mp_dmax1(double a, double b) {
  if (a >= b)
    return (a);
  else
    return (b);
}


x86 assembly (clang, -O0):
<mp_dmax1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <mp_dmax1+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <mp_dmax1+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_dmax1>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @mp_dmax1(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ key_stop();
void cw_stop(void) { key_stop(); }


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

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

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

LLVM IR (-O2):
define void @cw_stop() {
%1 = tail call i32 (...) @key_stop()
ret void
}
/* Type definitions */
struct transient {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void code_unknown(struct transient *trans __attribute__((unused))) {
  fprintf(stderr, "Unknown code !\n");
  abort();
}


x86 assembly (clang, -O0):
<code_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<code_unknown>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.transient = type { i32 }
@stderr = global i32 0
@.str = [16 x i8] c"Unknown code !\0A\00"
define void @code_unknown(%struct.transient* %0) {
%2 = alloca %struct.transient*
store %struct.transient* %0, %struct.transient** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.transient = type { i32 }
@stderr = global i32 0
@.str = [16 x i8] c"Unknown code !\0A\00"
define void @code_unknown(%struct.transient* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @abort()
unreachable
}
void spoilPtr(volatile char *p) {
  if (p) {
  };
}


x86 assembly (clang, -O0):
<spoilPtr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <spoilPtr+0x18>
jmp    1118 <spoilPtr+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spoilPtr(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 %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @spoilPtr(i8* nocapture %0) {
ret void
}
int simulate_get_open_fd() {
  static int fd = 1000 - 1;
  fd++;
  return fd;
}


x86 assembly (clang, -O0):
<simulate_get_open_fd>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    0x2f07(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simulate_get_open_fd>:
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
ret

LLVM IR (-O0):
@simulate_get_open_fd.fd = internal global i32 999
define i32 @simulate_get_open_fd() {
%1 = load i32, i32* @simulate_get_open_fd.fd
%2 = add nsw i32 %1, 1
store i32 %2, i32* @simulate_get_open_fd.fd
%3 = load i32, i32* @simulate_get_open_fd.fd
ret i32 %3
}

LLVM IR (-O2):
@simulate_get_open_fd.fd = internal unnamed_addr global i32 999
define i32 @simulate_get_open_fd() {
%1 = load i32, i32* @simulate_get_open_fd.fd
%2 = add nsw i32 %1, 1
store i32 %2, i32* @simulate_get_open_fd.fd
ret i32 %2
}
void MEMWRTerminate(unsigned char Channel, unsigned short data) {}


x86 assembly (clang, -O0):
<MEMWRTerminate>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @MEMWRTerminate(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @MEMWRTerminate(i8 zeroext %0, i16 zeroext %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ *svcfd_create(int, int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  int test_status = 1;
  int fd = 0;
  SVCXPRT *svcr = NULL;
  svcr = svcfd_create(fd, 0, 0);
  test_status = ((SVCXPRT *)svcr != NULL) ? 0 : 1;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <svcfd_create@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <svcfd_create@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @svcfd_create(i32 0, i32 0, i32 0)
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
unsigned int kgsl_get_alloc_size(int detailed) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kgsl_get_alloc_size(i32 %0) {
ret i32 0
}
int scm_set_boot_addr(void *addr, int flags) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @scm_set_boot_addr(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
void clntudp_abort() {}


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

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

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

LLVM IR (-O2):
define void @clntudp_abort() {
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *myRealloc(void *ptr, size_t size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<myRealloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @myRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @myRealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}