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

/* Variables and functions */
void cpu_to_be16wu(uint16_t *p, uint16_t v) {
  uint8_t *p1 = (uint8_t *)p;
  p1[0] = v >> 8;
  p1[1] = v;
}


x86 assembly (clang, -O0):
<cpu_to_be16wu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_be16wu>:
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,(%rdi)
mov    %esi,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @cpu_to_be16wu(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %4
ret void
}
long lrintl(long double x) {
  long retval;
  __asm__ __volatile__("fistpl %0" : "=m"(retval) : "t"(x) : "st");
  return retval;
}


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fistpl -0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
fldt   0x8(%rsp)
fistpl -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int dorun(char *, char **, int /*<<< orphan*/);
int runv(char *name, char **argv) { return (dorun(name, argv, 0)); }


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

x86 assembly (clang, -O2):
<runv>:
xor    %edx,%edx
jmp    1030 <dorun@plt>

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

LLVM IR (-O2):
define i32 @runv(i8* %0, i8** %1) {
%3 = tail call i32 @dorun(i8* %0, i8** %1, i32 0)
ret i32 %3
}
long syscall1(long num, long arg1) {
  long result;
  asm volatile("syscall" : "=a"(result) : "a"(num), "D"(arg1) : "rcx", "r11");
  return result;
}


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

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

LLVM IR (-O0):
define i64 @syscall1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @syscall1(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
void rop3_149_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk1 = *D ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_149_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_149_1_0>:
and    %esi,%edx
mov    (%rdi),%al
xor    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_149_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_149_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %4
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
%9 = and i8 %5, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UARTprintf(char *);
void FaultISR(void) {
  while (1) {
    UARTprintf("FaultISR\r\n");
  }
}


x86 assembly (clang, -O0):
<FaultISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <FaultISR+0x9>
lea    0xee0(%rip),%rdi
call   1030 <UARTprintf@plt>
jmp    1119 <FaultISR+0x9>

x86 assembly (clang, -O2):
<FaultISR>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <UARTprintf@plt>
jmp    1120 <FaultISR+0x10>

LLVM IR (-O0):
@.str = [11 x i8] c"FaultISR\0D\0A\00"
define void @FaultISR() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @UARTprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"FaultISR\0D\0A\00"
define void @FaultISR() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @UARTprintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ nexttoward(double, double);
int /*<<< orphan*/ nexttowardf(float, float);
int /*<<< orphan*/ nexttowardl(long double, long double);
void uninitvar_nexttoward(void) {
  float f1, f2;
  (void)nexttowardf(f1, f2);
  double d1, d2;
  (void)nexttoward(d1, d2);
  long double ld1, ld2;
  (void)nexttowardl(ld1, ld2);
}


x86 assembly (clang, -O0):
<uninitvar_nexttoward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1050 <nexttowardf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <nexttoward@plt>
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <nexttowardl@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_nexttoward>:
sub    $0x28,%rsp
call   1050 <nexttowardf@plt>
call   1030 <nexttoward@plt>
call   1040 <nexttowardl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_nexttoward() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = load float, float* %1
%8 = load float, float* %2
%9 = call i32 @nexttowardf(float %7, float %8)
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call i32 @nexttoward(double %10, double %11)
%13 = load x86_fp80, x86_fp80* %5
%14 = load x86_fp80, x86_fp80* %6
%15 = call i32 @nexttowardl(x86_fp80 %13, x86_fp80 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_nexttoward() {
%1 = tail call i32 @nexttowardf(float undef, float undef)
%2 = tail call i32 @nexttoward(double undef, double undef)
%3 = tail call i32 @nexttowardl(x86_fp80 undef, x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  struct {
    char ca[16];
  } s;
  int i;
  for (i = 0; i < 16; i++) {
    s.ca[i] = 5;
  }
  for (i = 0; i < 16; i++) {
    if (s.ca[i] != 5)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    1147 <main+0x37>
movslq -0x1c(%rbp),%rax
movb   $0x5,-0x18(%rbp,%rax,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    1184 <main+0x74>
movslq -0x1c(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%eax
cmp    $0x5,%eax
je     1171 <main+0x61>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1176 <main+0x66>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <main+0x3e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { [16 x i8] }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 %10
store i8 5, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
store i32 0, i32* %3
br label %16
16: ; preds = %30, %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 16
br i1 %18, label %19, label %33
19: ; preds = %16
%20 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %20, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 5
br i1 %26, label %27, label %29
27: ; preds = %19
%28 = call i32 (...) @abort()
unreachable
29: ; preds = %19
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %16
33: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
bool point_gt(int x1, int y1, int x2, int y2) {
  if ((x1 > x2) || (x1 == x2 && y1 >= y2)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<point_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1134 <point_gt+0x34>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1140 <point_gt+0x40>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1140 <point_gt+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <point_gt+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_gt>:
cmp    %edx,%edi
setg   %al
sete   %dl
cmp    %ecx,%esi
setge  %cl
and    %dl,%cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @point_gt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = icmp sgt i32 %10, %11
br i1 %12, label %21, label %13
13: ; preds = %4
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i32, i32* %7
%19 = load i32, i32* %9
%20 = icmp sge i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17, %4
store i32 1, i32* %5
br label %23
22: ; preds = %17, %13
store i32 0, i32* %5
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @point_gt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, %2
%6 = icmp eq i32 %0, %2
%7 = icmp sge i32 %1, %3
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ M_PI;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("pi = %lf\n", M_PI);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"pi = %lf\0A\00"
@M_PI = global i32 0
define i32 @main() {
%1 = load i32, i32* @M_PI
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned long SPIRxCRCGet(unsigned long ulBase) {

  ;
  return (*((volatile unsigned long *)(ulBase + 0x00000014)));
}


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

x86 assembly (clang, -O2):
<SPIRxCRCGet>:
mov    0x14(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @SPIRxCRCGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 20
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @SPIRxCRCGet(i64 %0) {
%2 = add i64 %0, 20
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
void otPlatDiagProcess(int argc, char *argv[], char *aOutput,
                       size_t aOutputMaxLen) {
  (void)argc;
  (void)argv;
  (void)aOutput;
  (void)aOutputMaxLen;
}


x86 assembly (clang, -O0):
<otPlatDiagProcess>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @otPlatDiagProcess(i32 %0, i8** nocapture %1, i8* nocapture %2, i64 %3) {
ret void
}
int splitString(char string[], int index) {
  int i;
  for (i = index; i >= 0; --i)
    if (string[i] == ' ') {
      string[i] = '\n';
      break;
    }
  return (index - i) + 1;
}


x86 assembly (clang, -O0):
<splitString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <splitString+0x54>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1141 <splitString+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0xa,(%rax,%rcx,1)
jmp    1154 <splitString+0x54>
jmp    1146 <splitString+0x46>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <splitString+0x11>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitString>:
mov    %esi,%eax
mov    %esi,%ecx
test   %esi,%esi
js     112f <splitString+0x2f>
mov    %eax,%edx
add    %rdi,%rdx
mov    %eax,%ecx
nop
mov    %ecx,%esi
cmpb   $0x20,(%rdi,%rsi,1)
je     112c <splitString+0x2c>
lea    -0x1(%rcx),%esi
add    $0xffffffffffffffff,%rdx
test   %ecx,%ecx
mov    %esi,%ecx
jg     1110 <splitString+0x10>
mov    $0xffffffff,%ecx
jmp    112f <splitString+0x2f>
movb   $0xa,(%rdx)
sub    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @splitString(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 i32, i32* %4
store i32 %6, i32* %5
br label %7
7: ; preds = %24, %2
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br i1 %17, label %18, label %23
18: ; preds = %10
%19 = load i8*, i8** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 10, i8* %22
br label %27
23: ; preds = %10
br label %24
24: ; preds = %23
%25 = load i32, i32* %5
%26 = add nsw i32 %25, -1
store i32 %26, i32* %5
br label %7
27: ; preds = %18, %7
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = sub nsw i32 %28, %29
%31 = add nsw i32 %30, 1
ret i32 %31
}

LLVM IR (-O2):
define i32 @splitString(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %16
4: ; preds = %2, %13
%5 = phi i32 [ %14, %13 ], [ %1, %2 ]
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = zext i32 %5 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 10, i8* %12
br label %16
13: ; preds = %4
%14 = add nsw i32 %5, -1
%15 = icmp sgt i32 %5, 0
br i1 %15, label %4, label %16
16: ; preds = %13, %2, %10
%17 = phi i32 [ %5, %10 ], [ %1, %2 ], [ -1, %13 ]
%18 = add i32 %1, 1
%19 = sub i32 %18, %17
ret i32 %19
}
unsigned char func2(unsigned char a, int b) { return b ? a : b; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <func2+0x23>
movzbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <func2+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
mov    %edi,%eax
test   %esi,%esi
cmove  %esi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @func2(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @func2(i8 zeroext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8 0, i8 %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ captureVisualImage();
int /*<<< orphan*/ transferVisualImage();
void sendVisualImg() {
  captureVisualImage();
  transferVisualImage();
}


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

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

LLVM IR (-O0):
define void @sendVisualImg() {
%1 = call i32 (...) @captureVisualImage()
%2 = call i32 (...) @transferVisualImage()
ret void
}

LLVM IR (-O2):
define void @sendVisualImg() {
%1 = tail call i32 (...) @captureVisualImage()
%2 = tail call i32 (...) @transferVisualImage()
ret void
}
/* Type definitions */
typedef int __u8;
typedef int __u32;

/* Variables and functions */
__u32 __exfat_checksum32(__u32 sum, __u8 val) {
  return ((sum << 31) | (sum >> 1)) + val;
}


x86 assembly (clang, -O0):
<__exfat_checksum32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
or     %ecx,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__exfat_checksum32>:
mov    %edi,%eax
shl    $0x1f,%eax
sar    %edi
or     %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @__exfat_checksum32(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 = shl i32 %5, 31
%7 = load i32, i32* %3
%8 = ashr i32 %7, 1
%9 = or i32 %6, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__exfat_checksum32(i32 %0, i32 %1) {
%3 = shl i32 %0, 31
%4 = ashr i32 %0, 1
%5 = or i32 %3, %4
%6 = add nsw i32 %5, %1
ret i32 %6
}
int gpio_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_init() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int chown(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int rpl_chown(const char *file, uid_t uid, gid_t gid) {
  return chown(file, uid, gid);
}


x86 assembly (clang, -O0):
<rpl_chown>:
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),%esi
mov    -0x10(%rbp),%edx
call   1030 <chown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_chown>:
jmp    1030 <chown@plt>

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

LLVM IR (-O2):
define i32 @rpl_chown(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @chown(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void XtCalloc() {}


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

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

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

LLVM IR (-O2):
define void @XtCalloc() {
ret void
}
/* Variables and functions */
int send(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int send_str(int socket, const char *str) {
  return send(socket, str, strlen(str), 0);
}


x86 assembly (clang, -O0):
<send_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
define i32 @send_str(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @send(i32 %5, i8* %6, i32 %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
define i32 @send_str(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(void) { bar(123); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x7b,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @bar(i32 123)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 123)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t fonctionAvant(int32_t z) { return z; }


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

x86 assembly (clang, -O2):
<fonctionAvant>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fonctionAvant(i32 returned %0) {
ret i32 %0
}
void caller_1_1_1_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_2_1_1_2() {
ret void
}
/* Variables and functions */
double __nv_drcp_ru(double);
double __drcp_ru(double __a) { return __nv_drcp_ru(__a); }


x86 assembly (clang, -O0):
<__drcp_ru>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__nv_drcp_ru@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__drcp_ru>:
jmp    1030 <__nv_drcp_ru@plt>

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

LLVM IR (-O2):
define double @__drcp_ru(double %0) {
%2 = tail call double @__nv_drcp_ru(double %0)
ret double %2
}
unsigned int cvmx_coremask_core(unsigned int core_id) {
  return (1u << core_id);
}


x86 assembly (clang, -O0):
<cvmx_coremask_core>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_coremask_core>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @cvmx_coremask_core(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
void gentlbwr() {}


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

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

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

LLVM IR (-O2):
define void @gentlbwr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void print_version(const char *version) {
  puts("lsa:  Copyright (C) 2016  Tino Gfroerer");
  printf("Version: %s\n", version);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xee5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"lsa: Copyright (C) 2016 Tino Gfroerer\00"
@.str.1 = [13 x i8] c"Version: %s\0A\00"
define void @print_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"lsa: Copyright (C) 2016 Tino Gfroerer\00"
@.str.1 = [13 x i8] c"Version: %s\0A\00"
define void @print_version(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CameraStabSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void CameraStabSettingsLogging() { UAVObjLogging(CameraStabSettingsHandle()); }


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

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

LLVM IR (-O0):
define void @CameraStabSettingsLogging() {
%1 = call i32 (...) @CameraStabSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @CameraStabSettingsLogging() {
%1 = tail call i32 (...) @CameraStabSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_who(char *, int);
void nsblk_spam_who(int id) { nsblk_who("spam", id); }


x86 assembly (clang, -O0):
<nsblk_spam_who>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <nsblk_who@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"spam\00"
define void @nsblk_spam_who(i32 %0) {
%2 = tail call i32 @nsblk_who(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
__attribute__((always_)) void flush_cache_dup_mm(struct mm_struct *mm) {}


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

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @flush_cache_dup_mm(%struct.mm_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arraySum(int *array, const int n);
  int values[10] = {3, 7, -9, 3, 6, -1, 7, 9, 1, -5};
  printf("The sum is %i\n", arraySum(values, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <arraySum@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <arraySum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.values = [10 x i32] [i32 3, i32 7, i32 -9, i32 3, i32 6, i32 -1, i32 7, i32 9, i32 1, i32 -5]
@.str = [15 x i8] c"The sum is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @arraySum(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.values = [10 x i32] [i32 3, i32 7, i32 -9, i32 3, i32 6, i32 -1, i32 7, i32 9, i32 1, i32 -5]
@.str = [15 x i8] c"The sum is %i\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @arraySum(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) {}


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

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

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

LLVM IR (-O2):
%struct.bcma_drv_gmac_cmn = type opaque
define void @bcma_core_gmac_cmn_init(%struct.bcma_drv_gmac_cmn* nocapture %0) {
ret void
}
/* Variables and functions */
long round(double);
long to_fixed(char resolution, double float_num) {
  return round(float_num * (double)(1 << resolution));
}


x86 assembly (clang, -O0):
<to_fixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsbl -0x1(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_fixed>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
jmp    1030 <round@plt>

LLVM IR (-O0):
define i64 @to_fixed(i8 signext %0, double %1) {
%3 = alloca i8
%4 = alloca double
store i8 %0, i8* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = shl i32 1, %7
%9 = sitofp i32 %8 to double
%10 = fmul double %5, %9
%11 = call i64 @round(double %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @to_fixed(i8 signext %0, double %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw i32 1, %3
%5 = sitofp i32 %4 to double
%6 = fmul double %5, %1
%7 = tail call i64 @round(double %6)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ InitGraphicInfo_EM();
int /*<<< orphan*/ create_obj_graphics_info_em();
int /*<<< orphan*/ create_spr_graphics_info_em();
void tab_generate_graphics_info_em() {
  create_obj_graphics_info_em();
  create_spr_graphics_info_em();
  InitGraphicInfo_EM();
}


x86 assembly (clang, -O0):
<tab_generate_graphics_info_em>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <create_obj_graphics_info_em@plt>
mov    $0x0,%al
call   1050 <create_spr_graphics_info_em@plt>
mov    $0x0,%al
call   1040 <InitGraphicInfo_EM@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tab_generate_graphics_info_em>:
push   %rax
xor    %eax,%eax
call   1030 <create_obj_graphics_info_em@plt>
xor    %eax,%eax
call   1050 <create_spr_graphics_info_em@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <InitGraphicInfo_EM@plt>

LLVM IR (-O0):
define void @tab_generate_graphics_info_em() {
%1 = call i32 (...) @create_obj_graphics_info_em()
%2 = call i32 (...) @create_spr_graphics_info_em()
%3 = call i32 (...) @InitGraphicInfo_EM()
ret void
}

LLVM IR (-O2):
define void @tab_generate_graphics_info_em() {
%1 = tail call i32 (...) @create_obj_graphics_info_em()
%2 = tail call i32 (...) @create_spr_graphics_info_em()
%3 = tail call i32 (...) @InitGraphicInfo_EM()
ret void
}
void RTSymlinkDelete(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSymlinkDelete() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isPrime(int);
int nextPrime(int n) {
  if (n <= 2) {
    return 2;
  }
  n |= 0x01;
  while (!isPrime(n)) {
    n += 2;
  }
  return n;
}


x86 assembly (clang, -O0):
<nextPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1131 <nextPrime+0x21>
movl   $0x2,-0x4(%rbp)
jmp    116b <nextPrime+0x5b>
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isPrime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1157 <nextPrime+0x47>
jmp    1165 <nextPrime+0x55>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <nextPrime+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextPrime>:
mov    $0x2,%eax
cmp    $0x3,%edi
jl     1134 <nextPrime+0x24>
push   %rbx
mov    %edi,%ebx
or     $0x1,%ebx
mov    %ebx,%edi
call   1030 <isPrime@plt>
add    $0x2,%ebx
test   %eax,%eax
je     1120 <nextPrime+0x10>
add    $0xfffffffe,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nextPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 1
store i32 %9, i32* %3
br label %10
10: ; preds = %15, %7
%11 = load i32, i32* %3
%12 = call i32 @isPrime(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 2
store i32 %17, i32* %3
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @nextPrime(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = or i32 %0, 1
br label %5
5: ; preds = %5, %3
%6 = phi i32 [ %4, %3 ], [ %9, %5 ]
%7 = tail call i32 @isPrime(i32 %6)
%8 = icmp eq i32 %7, 0
%9 = add nsw i32 %6, 2
br i1 %8, label %5, label %10
10: ; preds = %5, %1
%11 = phi i32 [ 2, %1 ], [ %6, %5 ]
ret i32 %11
}
int output(int list[], int max) {
  int i = max - 1;
  int fetch;
  while (i >= 0) {
    if (list[i] != -1) {
      fetch = list[i];
      list[i] = -1;
      break;
    }
    i--;
  }
  return fetch;
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1160 <output+0x60>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1152 <output+0x52>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
jmp    1160 <output+0x60>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <output+0x14>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
mov    %esi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %ecx,%ecx
jle    112a <output+0x2a>
mov    -0x4(%rdi,%rcx,4),%eax
add    $0xffffffffffffffff,%rcx
cmp    $0xffffffff,%eax
je     1110 <output+0x10>
mov    %ecx,%ecx
movl   $0xffffffff,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @output(i32* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = getelementptr inbounds i32, i32* %0, i64 %6
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, -1
br i1 %12, label %4, label %13
13: ; preds = %9
%14 = and i64 %6, 4294967295
%15 = getelementptr inbounds i32, i32* %0, i64 %14
store i32 -1, i32* %15
br label %16
16: ; preds = %4, %13
%17 = phi i32 [ %11, %13 ], [ undef, %4 ]
ret i32 %17
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int sweep_get_indices_numerically(int *idx) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(615, idx, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_indices_numerically>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x267,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_indices_numerically>:
mov    %rdi,%rsi
mov    $0x267,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @sweep_get_indices_numerically(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 615, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @sweep_get_indices_numerically(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 615, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ write(int, void *, int);
void *thrfunc(void *arg) {
  int i;
  fprintf(stderr, "Starting thread %s\n", (char *)arg);
  for (i = 1; i <= 10000; i++)
    write(2, arg, 1);
  return NULL;
}


x86 assembly (clang, -O0):
<thrfunc>:
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   1040 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jg     117a <thrfunc+0x5a>
mov    -0x8(%rbp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <thrfunc+0x2c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrfunc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x2710,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebp
jne    1150 <thrfunc+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Starting thread %s\0A\00"
define i8* @thrfunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
store i32 1, i32* %3
br label %7
7: ; preds = %13, %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 10000
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = call i32 @write(i32 2, i8* %11, i32 1)
br label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Starting thread %s\0A\00"
define noalias i8* @thrfunc(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 1, %1 ], [ %7, %4 ]
%6 = tail call i32 @write(i32 2, i8* %0, i32 1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 10001
br i1 %8, label %9, label %4
9: ; preds = %4
ret i8* null
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  struct timeval tv;
  while (1) {
    gettimeofday(&tv, NULL);
    printf("time %u : %u\n", tv.tv_sec, tv.tv_usec);
    sleep(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [14 x i8] c"time %u : %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = call i32 @sleep(i32 2)
br label %3
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [14 x i8] c"time %u : %u\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
br label %5
5: ; preds = %5, %0
%6 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = tail call i32 @sleep(i32 2)
br label %5
}