xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *reader(void *arg) {
  int i = 0;
  while (1) {
    printf("Reading node %d", i);
    i++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1123 <reader+0x13>

x86 assembly (clang, -O2):
<reader>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <reader+0x10>

LLVM IR (-O0):
@.str = [16 x i8] c"Reading node %d\00"
define i8* @reader(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %4
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
br label %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"Reading node %d\00"
define noalias i8* @reader(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ list;

/* Variables and functions */
int flistxattr(int, char *, int);
int main(void) {
  int fd = 3;
  char list[1024];
  return flistxattr(fd, list, sizeof(list));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1030 <flistxattr@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
mov    %rsp,%rsi
mov    $0x3,%edi
mov    $0x400,%edx
call   1030 <flistxattr@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1024 x i8]
store i32 0, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @flistxattr(i32 %4, i8* %5, i32 1024)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @flistxattr(i32 3, i8* %2, i32 1024)
ret i32 %3
}
double __fdim(double x, double y) { return x <= y ? 0 : x - y; }


x86 assembly (clang, -O0):
<__fdim>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     112f <__fdim+0x2f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113e <__fdim+0x3e>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fdim>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
cmplesd %xmm1,%xmm0
andnpd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @__fdim(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fsub double %10, %11
br label %13
13: ; preds = %9, %8
%14 = phi double [ 0.000000e+00, %8 ], [ %12, %9 ]
ret double %14
}

LLVM IR (-O2):
define double @__fdim(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = fsub double %0, %1
%5 = select i1 %3, double 0.000000e+00, double %4
ret double %5
}
void led(int index, int value) {}


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

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

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

LLVM IR (-O2):
define void @led(i32 %0, i32 %1) {
ret void
}
int ourkey(int n) {
  int ret = -1;
  if (n > 1) {
    if (n < 11)
      ret = (n - 1);
    if (n == 11)
      ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<ourkey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1141 <ourkey+0x41>
cmpl   $0xb,-0x4(%rbp)
jge    112b <ourkey+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xb,-0x4(%rbp)
jne    113c <ourkey+0x3c>
movl   $0x0,-0x8(%rbp)
jmp    1141 <ourkey+0x41>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ourkey>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     111d <ourkey+0x1d>
lea    -0x1(%rdi),%ecx
xor    %edx,%edx
cmp    $0xb,%edi
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ourkey(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = icmp ult i32 %0, 11
%5 = add nsw i32 %0, -1
%6 = select i1 %4, i32 %5, i32 -1
%7 = icmp eq i32 %0, 11
%8 = select i1 %7, i32 0, i32 %6
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int sign(int);
int main(void) {
  int number = 0;
  scanf("%d", &number);
  printf("%d\n", sign(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <sign@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <sign@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @sign(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @sign(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
void llarg(long long a, long long b, unsigned long long c,
           unsigned long long d) {
  printf("a=lld\n", a);
  printf("b=lld\n", b);
  printf("c=llu\n", c);
  printf("d=llu\n", d);
}


x86 assembly (clang, -O0):
<llarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llarg>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"a=lld\0A\00"
@.str.1 = [7 x i8] c"b=lld\0A\00"
@.str.2 = [7 x i8] c"c=llu\0A\00"
@.str.3 = [7 x i8] c"d=llu\0A\00"
define void @llarg(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i64, i64* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = load i64, i64* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 %13)
%15 = load i64, i64* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i64 %15)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"a=lld\0A\00"
@.str.1 = [7 x i8] c"b=lld\0A\00"
@.str.2 = [7 x i8] c"c=llu\0A\00"
@.str.3 = [7 x i8] c"d=llu\0A\00"
define void @llarg(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 %2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i64 %3)
ret void
}
long extract_mb6(unsigned long insn, int dialect __attribute__((unused)),
                 int *invalid __attribute__((unused))) {
  return ((insn >> 6) & 0x1f) | (insn & 0x20);
}


x86 assembly (clang, -O0):
<extract_mb6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x6,%rax
and    $0x1f,%rax
mov    -0x8(%rbp),%rcx
and    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_mb6>:
mov    %edi,%eax
shr    $0x6,%eax
and    $0x1f,%eax
and    $0x20,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @extract_mb6(i64 %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i64, i64* %4
%8 = lshr i64 %7, 6
%9 = and i64 %8, 31
%10 = load i64, i64* %4
%11 = and i64 %10, 32
%12 = or i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @extract_mb6(i64 %0, i32 %1, i32* nocapture readnone %2) {
%4 = lshr i64 %0, 6
%5 = and i64 %4, 31
%6 = and i64 %0, 32
%7 = or i64 %5, %6
ret i64 %7
}
unsigned long SysTickValueGet(void) {
  return ((*((volatile unsigned long *)(0xE000E018))));
}


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

x86 assembly (clang, -O2):
<SysTickValueGet>:
mov    $0xe000e018,%eax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @SysTickValueGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758153752 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @SysTickValueGet() {
%1 = load volatile i64, i64* inttoptr (i64 3758153752 to i64*)
ret i64 %1
}
/* Variables and functions */
bool nrf53_errata_76(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_76() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printSquare(int);
int main(int argc, const char *argv[]) {
  printSquare(5);
  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    $0x5,%edi
call   1030 <printSquare@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <printSquare@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 @printSquare(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printSquare(i32 5)
ret i32 0
}
int h() { return "bye" == "helloooobye" + 8; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
lea    0xefd(%rip),%rcx
lea    0xef6(%rip),%rax
sub    %rcx,%rax
sete   %al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
lea    0xf01(%rip),%rcx
lea    0xefa(%rip),%rdx
xor    %eax,%eax
cmp    %rcx,%rdx
sete   %al
ret

LLVM IR (-O0):
@.str = [4 x i8] c"bye\00"
@.str.1 = [12 x i8] c"helloooobye\00"
define i32 @h() {
ret i32 zext (i1 icmp eq (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 8)) to i32)
}

LLVM IR (-O2):
@.str = [4 x i8] c"bye\00"
@.str.1 = [12 x i8] c"helloooobye\00"
define i32 @h() {
ret i32 zext (i1 icmp eq (i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 8)) to i32)
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextXYw135(char const *, long, long, unsigned long,
                                  unsigned long);
void drawtextxyw(const char *s, long x, long y, unsigned long cfg,
                 unsigned long cbg) {
  DrawTextXYw135(s, x, y, cfg, cbg);
}


x86 assembly (clang, -O0):
<drawtextxyw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <DrawTextXYw135@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawtextxyw>:
jmp    1030 <DrawTextXYw135@plt>

LLVM IR (-O0):
define void @drawtextxyw(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @DrawTextXYw135(i8* %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @drawtextxyw(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @DrawTextXYw135(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
unsigned _cdio_len2blocks(unsigned len, int blocksize) {
  unsigned blocks;
  blocks = len / blocksize;
  if (len % blocksize)
    blocks++;
  return blocks;
}


x86 assembly (clang, -O0):
<_cdio_len2blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
cmp    $0x0,%edx
je     112f <_cdio_len2blocks+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cdio_len2blocks>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @_cdio_len2blocks(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
%4 = urem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add i32 %3, %6
ret i32 %7
}
int f_ble_cr1(float a1) { return (__builtin_islessequal(100, a1)); }


x86 assembly (clang, -O0):
<f_ble_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ble_cr1>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f_ble_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_ble_cr1(float %0) {
%2 = fcmp oge float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double exp(double);
double idfStandard(double);
double idfLognormal(double a, double b, double u) {
  double t;
  t = a + b * idfStandard(u);
  return (exp(t));
}


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

x86 assembly (clang, -O2):
<idfLognormal>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1040 <idfStandard@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @idfLognormal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @idfStandard(double %10)
%12 = call double @llvm.fmuladd.f64(double %9, double %11, double %8)
store double %12, double* %7
%13 = load double, double* %7
%14 = call double @exp(double %13)
ret double %14
}

LLVM IR (-O2):
define double @idfLognormal(double %0, double %1, double %2) {
%4 = tail call double @idfStandard(double %2)
%5 = tail call double @llvm.fmuladd.f64(double %1, double %4, double %0)
%6 = tail call double @exp(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_num_reverse(int begin) {
  if (begin < 10) {
    begin++;
    print_num_reverse(begin);
    printf("%d ", begin);
  }
}


x86 assembly (clang, -O0):
<print_num_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1155 <print_num_reverse+0x35>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print_num_reverse@plt>
mov    -0x4(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_num_reverse>:
cmp    $0xa,%edi
jge    1141 <print_num_reverse+0x21>
push   %rbx
mov    %edi,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <print_num_reverse@plt>
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_num_reverse(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %4, label %3
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = add nsw i32 %0, 1
tail call void @print_num_reverse(i32 %5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Cursor_Fire1(int value) {
  if (value) {
    cpc_key_press(0x22);
  } else {
    cpc_key_unpress(0x22);
  };
}


x86 assembly (clang, -O0):
<Joy_Cursor_Fire1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Cursor_Fire1+0x24>
mov    $0x22,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Cursor_Fire1+0x2e>
mov    $0x22,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Cursor_Fire1>:
test   %edi,%edi
je     112e <Joy_Cursor_Fire1+0xe>
mov    $0x22,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x22,%edi
jmp    1040 <cpc_key_unpress@plt>

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

LLVM IR (-O2):
define void @Joy_Cursor_Fire1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 34)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 34)
br label %7
7: ; preds = %5, %3
ret void
}
unsigned vadigits(unsigned n) { return n < 10 ? 1 : 1 + vadigits(n / 10); }


x86 assembly (clang, -O0):
<vadigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    1132 <vadigits+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <vadigits+0x3b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <vadigits@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vadigits>:
mov    $0x1,%eax
cmp    $0xa,%edi
jb     1134 <vadigits+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <vadigits+0x20>
ret

LLVM IR (-O0):
define i32 @vadigits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = udiv i32 %7, 10
%9 = call i32 @vadigits(i32 %8)
%10 = add i32 1, %9
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 1, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @vadigits(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = udiv i32 %4, 10
%7 = add i32 %5, 1
%8 = icmp ult i32 %4, 100
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = add i32 %5, 2
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 1, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int RAND_MAX;
int getrand();
int rrand(int m) {
  int i, k;
  if (m <= 0)
    return 0;
  k = RAND_MAX % m;
  do {
    i = getrand();
  } while (i >= (RAND_MAX - k));
  return i % m;
}


x86 assembly (clang, -O0):
<rrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <rrand+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116c <rrand+0x5c>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getrand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e93(%rip),%rcx
mov    (%rcx),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    1141 <rrand+0x31>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrand>:
test   %edi,%edi
jle    114a <rrand+0x3a>
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%eax
cltd
idiv   %edi
mov    %edx,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getrand@plt>
mov    (%rbx),%ecx
sub    %ebp,%ecx
cmp    %ecx,%eax
jge    1130 <rrand+0x20>
cltd
idiv   %r14d
mov    %edx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rrand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %25
9: ; preds = %1
%10 = load i32, i32* @RAND_MAX
%11 = load i32, i32* %3
%12 = srem i32 %10, %11
store i32 %12, i32* %5
br label %13
13: ; preds = %15, %9
%14 = call i32 (...) @getrand()
store i32 %14, i32* %4
br label %15
15: ; preds = %13
%16 = load i32, i32* %4
%17 = load i32, i32* @RAND_MAX
%18 = load i32, i32* %5
%19 = sub nsw i32 %17, %18
%20 = icmp sge i32 %16, %19
br i1 %20, label %13, label %21
21: ; preds = %15
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = srem i32 %22, %23
store i32 %24, i32* %2
br label %25
25: ; preds = %21, %8
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rrand(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i32, i32* @RAND_MAX
%5 = srem i32 %4, %0
br label %6
6: ; preds = %6, %3
%7 = tail call i32 (...) @getrand()
%8 = load i32, i32* @RAND_MAX
%9 = sub nsw i32 %8, %5
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = srem i32 %7, %0
br label %13
13: ; preds = %1, %11
%14 = phi i32 [ %12, %11 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
int init_for(int);
int next_for(int);
int /*<<< orphan*/ set_atom_ball(int, double);
void setup_ball_radii(double ball_radius, int atom_set) {
  int o;
  for (o = init_for(atom_set); o != 0; o = next_for(atom_set)) {
    set_atom_ball(o, ball_radius);
  }
}


x86 assembly (clang, -O0):
<setup_ball_radii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <init_for@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1172 <setup_ball_radii+0x42>
mov    -0x10(%rbp),%edi
movsd  -0x8(%rbp),%xmm0
call   1050 <set_atom_ball@plt>
mov    -0xc(%rbp),%edi
call   1040 <next_for@plt>
mov    %eax,-0x10(%rbp)
jmp    114b <setup_ball_radii+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_ball_radii>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x8(%rsp)
call   1030 <init_for@plt>
test   %eax,%eax
je     1168 <setup_ball_radii+0x38>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%edi
movsd  0x8(%rsp),%xmm0
call   1050 <set_atom_ball@plt>
mov    %ebx,%edi
call   1040 <next_for@plt>
test   %eax,%eax
jne    1150 <setup_ball_radii+0x20>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @setup_ball_radii(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @init_for(i32 %6)
store i32 %7, i32* %5
br label %8
8: ; preds = %15, %2
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load double, double* %3
%14 = call i32 @set_atom_ball(i32 %12, double %13)
br label %15
15: ; preds = %11
%16 = load i32, i32* %4
%17 = call i32 @next_for(i32 %16)
store i32 %17, i32* %5
br label %8
18: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @setup_ball_radii(double %0, i32 %1) {
%3 = tail call i32 @init_for(i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @set_atom_ball(i32 %6, double %0)
%8 = tail call i32 @next_for(i32 %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
void g_type_plugin_get_type() {}


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

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

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

LLVM IR (-O2):
define void @g_type_plugin_get_type() {
ret void
}
int takesOneInt(int y) { return 6; }


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

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

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

LLVM IR (-O2):
define i32 @takesOneInt(i32 %0) {
ret i32 6
}
/* Type definitions */
struct semaphore {
  int dummy;
};

/* Variables and functions */
scalar_t__ futex_down(struct semaphore *);
int /*<<< orphan*/ serv_perror(char const *);
void futex_down2(struct semaphore *sem, const char *msg) {
  while (futex_down(sem)) {
    serv_perror(msg);
  }
}


x86 assembly (clang, -O0):
<futex_down2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <futex_down@plt>
cmp    $0x0,%rax
je     1151 <futex_down2+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <serv_perror@plt>
jmp    1130 <futex_down2+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_down2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
call   1040 <futex_down@plt>
test   %rax,%rax
je     1147 <futex_down2+0x27>
mov    %r14,%rdi
call   1030 <serv_perror@plt>
mov    %rbx,%rdi
jmp    1130 <futex_down2+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.semaphore = type { i32 }
define void @futex_down2(%struct.semaphore* %0, i8* %1) {
%3 = alloca %struct.semaphore*
%4 = alloca i8*
store %struct.semaphore* %0, %struct.semaphore** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load %struct.semaphore*, %struct.semaphore** %3
%7 = call i64 @futex_down(%struct.semaphore* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %4
%11 = call i32 @serv_perror(i8* %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.semaphore = type { i32 }
define void @futex_down2(%struct.semaphore* %0, i8* %1) {
%3 = tail call i64 @futex_down(%struct.semaphore* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 @serv_perror(i8* %1)
%7 = tail call i64 @futex_down(%struct.semaphore* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ my_hold(int *);
int *my_malloc(int);
void af2c() {
  int *p = my_malloc(12);
  free(p);
  my_hold(p);
}


x86 assembly (clang, -O0):
<af2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <my_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1050 <my_hold@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<af2c>:
push   %rbx
mov    $0xc,%edi
call   1040 <my_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <my_hold@plt>

LLVM IR (-O0):
define void @af2c() {
%1 = alloca i32*
%2 = call i32* @my_malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @my_hold(i32* %5)
ret void
}

LLVM IR (-O2):
define void @af2c() {
%1 = tail call i32* @my_malloc(i32 12)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @my_hold(i32* %1)
ret void
}
/* Variables and functions */
int inb(unsigned int);
unsigned lpc47b397_gpio_offset_in(unsigned iobase, unsigned offset) {
  return inb(iobase + offset);
}


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

x86 assembly (clang, -O2):
<lpc47b397_gpio_offset_in>:
add    %esi,%edi
jmp    1030 <inb@plt>

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

LLVM IR (-O2):
define i32 @lpc47b397_gpio_offset_in(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call i32 @inb(i32 %3)
ret i32 %4
}
int peek(int *s) { return *s; }


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

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

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

LLVM IR (-O2):
define i32 @peek(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
void sigproc() {
  signal(SIGINT, sigproc);
  printf("you have pressed ctrl-c   \n");
}


x86 assembly (clang, -O0):
<sigproc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rsi
call   1040 <signal@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigproc>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rsi
call   1040 <signal@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [28 x i8] c"you have pressed ctrl-c \0A\00"
define void @sigproc() {
%1 = load i32, i32* @SIGINT
%2 = call i32 @signal(i32 %1, void (...)* bitcast (void ()* @sigproc to void (...)*))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [27 x i8] c"you have pressed ctrl-c \00"
define void @sigproc() {
%1 = load i32, i32* @SIGINT
%2 = tail call i32 @signal(i32 %1, void (...)* bitcast (void ()* @sigproc to void (...)*))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int hashnat(void *key) {
  int *p = key;
  return *p % 10;
}


x86 assembly (clang, -O0):
<hashnat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashnat>:
movslq (%rdi),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hashnat(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = srem i32 %7, 10
ret i32 %8
}

LLVM IR (-O2):
define i32 @hashnat(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
ret i32 %4
}
void coprocessor_segement_overrun_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @coprocessor_segement_overrun_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solve_with_standard_doubles(int max, double eps, int *nit) {
  int fail = _ada_use_c2phc4c(272, &max, nit, &eps, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_with_standard_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    $0x110,%edi
lea    -0x4(%rbp),%rsi
lea    -0x10(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_with_standard_doubles>:
sub    $0x18,%rsp
mov    %rsi,%rdx
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x110,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @solve_with_standard_doubles(i32 %0, double %1, i32* %2) {
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%6 = call i32 @_ada_use_c2phc4c(i32 272, i32* %4, i32* %2, double* %5, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int i = 0;
  char k;
  for (i = 0; i < 256; i++) {
    printf("%c ", k);
    k = k + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1162 <main+0x52>
lea    0xebf(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x9(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [4 x i8] c"%c \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i8, i8* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, 1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
/* Variables and functions */
char sml(char);
int strlen(char *);
char *ssml(char *str) {
  int len = strlen(str);
  for (int i = 0; i < len; i++)
    str[i] = sml(str[i]);
  return str;
}


x86 assembly (clang, -O0):
<ssml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <ssml+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <sml@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <ssml+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssml>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <ssml+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <sml@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <ssml+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ssml(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %7
6: ; preds = %7, %1
ret i8* %0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call signext i8 @sml(i8 signext %10)
store i8 %11, i8* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int f376(int *);
int f377(int *p) { return f376(p); }


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

x86 assembly (clang, -O2):
<f377>:
jmp    1030 <f376@plt>

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

LLVM IR (-O2):
define i32 @f377(i32* %0) {
%2 = tail call i32 @f376(i32* %0)
ret i32 %2
}
int test_imm_65uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x65 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_65uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x65,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_65uint64_highword_mem>:
testb  $0x65,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_65uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 433791696896
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void lll_prof_enter_ull_high(void) {}


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

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

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

LLVM IR (-O2):
define void @lll_prof_enter_ull_high() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dio_set(unsigned char, unsigned char);
int /*<<< orphan*/ dio_set_dir(unsigned char, unsigned char);
int /*<<< orphan*/ dio_set_pinmux(unsigned char);
void DIOInit(unsigned char pin, unsigned char dir, unsigned char init_value) {
  dio_set_pinmux(pin);
  dio_set_dir(pin, dir);
  dio_set(pin, init_value);
}


x86 assembly (clang, -O0):
<DIOInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <dio_set_pinmux@plt>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1050 <dio_set_dir@plt>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x3(%rbp),%esi
call   1040 <dio_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIOInit>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <dio_set_pinmux@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <dio_set_dir@plt>
mov    %ebx,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <dio_set@plt>

LLVM IR (-O0):
define void @DIOInit(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = call i32 @dio_set_pinmux(i8 zeroext %7)
%9 = load i8, i8* %4
%10 = load i8, i8* %5
%11 = call i32 @dio_set_dir(i8 zeroext %9, i8 zeroext %10)
%12 = load i8, i8* %4
%13 = load i8, i8* %6
%14 = call i32 @dio_set(i8 zeroext %12, i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @DIOInit(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @dio_set_pinmux(i8 zeroext %0)
%5 = tail call i32 @dio_set_dir(i8 zeroext %0, i8 zeroext %1)
%6 = tail call i32 @dio_set(i8 zeroext %0, i8 zeroext %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
bool sancus_get_u8zu(size_t v, uint8_t *out) {
  if (v <= 0xff) {
    if (out != NULL)
      *out = (uint8_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u8zu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0xff,-0x10(%rbp)
ja     113c <sancus_get_u8zu+0x3c>
cmpq   $0x0,-0x18(%rbp)
je     1130 <sancus_get_u8zu+0x30>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1143 <sancus_get_u8zu+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u8zu>:
xor    %eax,%eax
cmp    $0xff,%rdi
ja     1118 <sancus_get_u8zu+0x18>
mov    $0x1,%eax
test   %rsi,%rsi
je     1118 <sancus_get_u8zu+0x18>
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @sancus_get_u8zu(i64 %0, i64* writeonly %1) {
%3 = icmp ult i64 %0, 256
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 %0, i64* %1
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}