xunge/DecIR huggingface dataset:
int validate(char *buffer, int size, char value) {
  register int i;
  register char *cp;
  register int size1;
  register char v1;
  v1 = value;
  cp = buffer;
  size1 = size;
  for (i = 0; i < size; i++) {
    if (*cp++ != v1)
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<validate>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    %al,-0x2d(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1174 <validate+0x74>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movsbl (%rax),%eax
movsbl -0x2d(%rbp),%ecx
cmp    %ecx,%eax
je     1161 <validate+0x61>
movl   $0x1,-0x4(%rbp)
jmp    117b <validate+0x7b>
jmp    1166 <validate+0x66>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <validate+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate>:
test   %esi,%esi
jle    111d <validate+0x1d>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %dl,(%rdi,%rcx,1)
jne    1120 <validate+0x20>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <validate+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @validate(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %10
%6 = phi i32 [ %12, %10 ], [ 0, %3 ]
%7 = phi i8* [ %11, %10 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %2
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %3
%15 = phi i32 [ 0, %3 ], [ 0, %10 ], [ 1, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ __dorand48(unsigned short *);
long nrand48(unsigned short xseed[3]) {
  __dorand48(xseed);
  return ((long)xseed[2] << 15) + ((long)xseed[1] >> 1);
}


x86 assembly (clang, -O0):
<nrand48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__dorand48@plt>
mov    -0x8(%rbp),%rax
movzwl 0x4(%rax),%eax
shl    $0xf,%rax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
sar    $0x1,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrand48>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__dorand48@plt>
movzwl 0x4(%rbx),%ecx
shl    $0xf,%rcx
movzwl 0x2(%rbx),%eax
shr    %rax
or     %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @nrand48(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i32 @__dorand48(i16* %3)
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 2
%7 = load i16, i16* %6
%8 = zext i16 %7 to i64
%9 = shl i64 %8, 15
%10 = load i16*, i16** %2
%11 = getelementptr inbounds i16, i16* %10, i64 1
%12 = load i16, i16* %11
%13 = zext i16 %12 to i64
%14 = ashr i64 %13, 1
%15 = add nsw i64 %9, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @nrand48(i16* %0) {
%2 = tail call i32 @__dorand48(i16* %0)
%3 = getelementptr inbounds i16, i16* %0, i64 2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i64
%6 = shl nuw nsw i64 %5, 15
%7 = getelementptr inbounds i16, i16* %0, i64 1
%8 = load i16, i16* %7
%9 = lshr i16 %8, 1
%10 = zext i16 %9 to i64
%11 = or i64 %6, %10
ret i64 %11
}
int gcd_mod(int a, int b) {
  while (b != 0) {
    int tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd_mod+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd_mod+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_mod>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd_mod+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_mod+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd_mod(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ expected_pk_fault(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ pkey_write_deny(int /*<<< orphan*/);
int /*<<< orphan*/ sigsafe_printf(char *, int /*<<< orphan*/);
void test_write_of_write_disabled_region(int *ptr, uint16_t pkey) {
  do {
    if (1 <= 0)
      sigsafe_printf("disabling write access to PKEY[%02d], doing write\n",
                     pkey);
    fflush(NULL);
  } while (0);
  pkey_write_deny(pkey);
  *ptr = 1153;
  expected_pk_fault(pkey);
}


x86 assembly (clang, -O0):
<test_write_of_write_disabled_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0xc(%rbp),%edi
call   1030 <pkey_write_deny@plt>
mov    -0x8(%rbp),%rax
movl   $0x481,(%rax)
mov    -0xc(%rbp),%edi
call   1050 <expected_pk_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_write_of_write_disabled_region>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
call   1030 <pkey_write_deny@plt>
movl   $0x481,(%r14)
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <expected_pk_fault@plt>

LLVM IR (-O0):
define void @test_write_of_write_disabled_region(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = call i32 @fflush(i32* null)
br label %7
7: ; preds = %5
%8 = load i32, i32* %4
%9 = call i32 @pkey_write_deny(i32 %8)
%10 = load i32*, i32** %3
store i32 1153, i32* %10
%11 = load i32, i32* %4
%12 = call i32 @expected_pk_fault(i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_write_of_write_disabled_region(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @fflush(i32* null)
%4 = tail call i32 @pkey_write_deny(i32 %1)
store i32 1153, i32* %0
%5 = tail call i32 @expected_pk_fault(i32 %1)
ret void
}
int pop(int x) {
  x = ((x & ~0x5555) >> 1) + (x & 0x5555);
  x = ((x & ~0x3333) >> 2) + (x & 0x3333);
  x = ((x >> 4) + x) & 0x0f0f;
  x = ((x >> 8) + x) & 0xff;
  return x;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffaaaa,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x5555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffcccc,%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
add    -0x4(%rbp),%eax
and    $0xf0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
add    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
mov    %edi,%eax
sar    %eax
and    $0xffffd555,%eax
and    $0x5555,%edi
add    %eax,%edi
mov    %edi,%eax
sar    $0x2,%eax
and    $0xfffff333,%eax
and    $0x3333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @pop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -21846
%5 = ashr i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 21845
%8 = add nsw i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, -13108
%11 = ashr i32 %10, 2
%12 = load i32, i32* %2
%13 = and i32 %12, 13107
%14 = add nsw i32 %11, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 4
%17 = load i32, i32* %2
%18 = add nsw i32 %16, %17
%19 = and i32 %18, 3855
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = ashr i32 %20, 8
%22 = load i32, i32* %2
%23 = add nsw i32 %21, %22
%24 = and i32 %23, 255
store i32 %24, i32* %2
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @pop(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %2, -10923
%4 = and i32 %0, 21845
%5 = add nsw i32 %3, %4
%6 = ashr i32 %5, 2
%7 = and i32 %6, -3277
%8 = and i32 %5, 13107
%9 = add nsw i32 %7, %8
%10 = lshr i32 %9, 4
%11 = add nsw i32 %10, %9
%12 = and i32 %11, 3855
%13 = lshr i32 %12, 8
%14 = add nuw nsw i32 %13, %12
%15 = and i32 %14, 31
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  register int i;
  int tmp = 0;
  for (i = 0; i <= 100; i++)
    tmp += i;
  printf("The sum is %d\n", tmp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     1147 <main+0x37>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x13ba,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"The sum is %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 5050)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ywidGetMainWid();
int /*<<< orphan*/ ywidRend(int /*<<< orphan*/);
void ygUpdateScreen(void) { ywidRend(ywidGetMainWid()); }


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

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

LLVM IR (-O0):
define void @ygUpdateScreen() {
%1 = call i32 (...) @ywidGetMainWid()
%2 = call i32 @ywidRend(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ygUpdateScreen() {
%1 = tail call i32 (...) @ywidGetMainWid()
%2 = tail call i32 @ywidRend(i32 %1)
ret void
}
/* Variables and functions */
int linux_audio_close(int);
int oss_mus_audio_close(int line) { return (linux_audio_close(line)); }


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

x86 assembly (clang, -O2):
<oss_mus_audio_close>:
jmp    1030 <linux_audio_close@plt>

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

LLVM IR (-O2):
define i32 @oss_mus_audio_close(i32 %0) {
%2 = tail call i32 @linux_audio_close(i32 %0)
ret i32 %2
}
int ITEMmaxKeyLen() { return 10; }


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

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

LLVM IR (-O0):
define i32 @ITEMmaxKeyLen() {
ret i32 10
}

LLVM IR (-O2):
define i32 @ITEMmaxKeyLen() {
ret i32 10
}
void foo067() {}


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

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

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

LLVM IR (-O2):
define void @foo067() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int lstat(char const *, struct stat *);
int rpl_lstat(const char *path, struct stat *buf) {
  if (*path == '\0') {
    errno = ENOENT;
    return -1;
  }
  return lstat(path, buf);
}


x86 assembly (clang, -O0):
<rpl_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <rpl_lstat+0x3e>
mov    0x2e99(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <rpl_lstat+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <lstat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_lstat>:
cmpb   $0x0,(%rdi)
je     111a <rpl_lstat+0xa>
jmp    1030 <lstat@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    0x2eb6(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @rpl_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.stat*
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @ENOENT
store i32 %11, i32* @errno
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load %struct.stat*, %struct.stat** %5
%15 = call i32 @lstat(i8* %13, %struct.stat* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @rpl_lstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i32, i32* @ENOENT
store i32 %6, i32* @errno
br label %9
7: ; preds = %2
%8 = tail call i32 @lstat(i8* %0, %struct.stat* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ %8, %7 ]
ret i32 %10
}
int notifier_list_notify() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @notifier_list_notify() {
ret i32 0
}
int okn_tsm_rot_y2(struct okn_tsm *t, float y) { return 1; }


x86 assembly (clang, -O0):
<okn_tsm_rot_y2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_y2(%struct.okn_tsm* %0, float %1) {
%3 = alloca %struct.okn_tsm*
%4 = alloca float
store %struct.okn_tsm* %0, %struct.okn_tsm** %3
store float %1, float* %4
ret i32 1
}

LLVM IR (-O2):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_y2(%struct.okn_tsm* nocapture readnone %0, float %1) {
ret i32 1
}
void avpriv_bprint_to_extradata() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_bprint_to_extradata() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void enomem() { error("Out of memory."); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory.\00"
define void @enomem() {
%1 = call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory.\00"
define void @enomem() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
void ball_refresh() {}


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

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

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

LLVM IR (-O2):
define void @ball_refresh() {
ret void
}
/* Variables and functions */
__attribute__((weak)) void rgblight_decrease_sat(void) {}


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

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

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

LLVM IR (-O2):
define weak void @rgblight_decrease_sat() {
ret void
}
int capture_c(const char *carg, void *pvar) {
  char *p = pvar;
  if (!p)
    return 1;
  *p = 'c';
  return 0;
}


x86 assembly (clang, -O0):
<capture_c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    112b <capture_c+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1139 <capture_c+0x39>
mov    -0x20(%rbp),%rax
movb   $0x63,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_c>:
test   %rsi,%rsi
je     110b <capture_c+0xb>
movb   $0x63,(%rsi)
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @capture_c(i8* nocapture readnone %0, i8* writeonly %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i8 99, i8* %1
br label %5
5: ; preds = %2, %4
%6 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %6
}
unsigned sumOfNNaturalNumbers(unsigned number) {
  unsigned result = 0;
  int i;
  for (i = 0; i < number; i++)
    result += number - i;
  return result;
}


x86 assembly (clang, -O0):
<sumOfNNaturalNumbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    113b <sumOfNNaturalNumbers+0x3b>
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sumOfNNaturalNumbers+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOfNNaturalNumbers>:
test   %edi,%edi
je     1119 <sumOfNNaturalNumbers+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumOfNNaturalNumbers(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ ft_strdel(char **);
char *ft_strjoin(char *, char *);
char *ft_stradd(char *s1, char *s2) {
  char *tmp;
  tmp = ft_strjoin(s1, s2);
  ft_strdel(&s1);
  return (tmp);
}


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

x86 assembly (clang, -O2):
<ft_stradd>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
call   1040 <ft_strjoin@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1030 <ft_strdel@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_stradd(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = tail call i8* @ft_strjoin(i8* %0, i8* %1)
%5 = call i32 @ft_strdel(i8** %3)
ret i8* %4
}
struct A {
  int i, j;
} f() {
  return (struct A){1, 2};
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movabs $0x200000001,%rax
ret

LLVM IR (-O0):
%struct.A = type { i32, i32 }
define i64 @f() {
%1 = alloca %struct.A
%2 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 1
store i32 2, i32* %3
%4 = bitcast %struct.A* %1 to i64*
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @f() {
ret i64 8589934593
}
/* Variables and functions */
char *cloneStringZExt(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
char *cloneStringZ(const char *s, int size) {
  return cloneStringZExt(s, strlen(s), size);
}


x86 assembly (clang, -O0):
<cloneStringZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <cloneStringZExt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cloneStringZ>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <cloneStringZExt@plt>

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

LLVM IR (-O2):
define i8* @cloneStringZ(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @cloneStringZExt(i8* %0, i32 %3, i32 %1)
ret i8* %4
}
void init(void) {}


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

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

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

LLVM IR (-O2):
define void @init() {
ret void
}
/* Variables and functions */
scalar_t__ is_digit(char);
int read_number(char *start) {
  int value = 0;
  while (is_digit(*start)) {
    int digit = *start - '0';
    value *= 10;
    value += digit;
    start++;
  }
  return value;
}


x86 assembly (clang, -O0):
<read_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_digit@plt>
cmp    $0x0,%rax
je     1167 <read_number+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <read_number+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_number>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <is_digit@plt>
test   %rax,%rax
je     1153 <read_number+0x43>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
movsbl -0x1(%rbx),%eax
lea    (%r14,%r14,4),%ecx
lea    (%rax,%rcx,2),%r14d
add    $0xffffffd0,%r14d
movsbl (%rbx),%edi
call   1030 <is_digit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <read_number+0x20>
jmp    1156 <read_number+0x46>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @read_number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_digit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %13, %5 ], [ %0, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = tail call i64 @is_digit(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
unsigned _src_iter_get_column(const char *current, unsigned back_column) {
  return (unsigned)((unsigned long long)(current - (const char *)0) & ~0u) -
         back_column;
}


x86 assembly (clang, -O0):
<_src_iter_get_column>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x0,%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_src_iter_get_column>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @_src_iter_get_column(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = sub i64 %6, 0
%8 = and i64 %7, 4294967295
%9 = trunc i64 %8 to i32
%10 = load i32, i32* %4
%11 = sub i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_src_iter_get_column(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = sub i32 %4, %1
ret i32 %5
}
/* Type definitions */
struct btrfs_delayed_extent_op {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct btrfs_delayed_extent_op *);
void btrfs_free_delayed_extent_op(struct btrfs_delayed_extent_op *op) {
  if (op)
    free(op);
}


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

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

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

LLVM IR (-O2):
%struct.btrfs_delayed_extent_op = type { i32 }
define void @btrfs_free_delayed_extent_op(%struct.btrfs_delayed_extent_op* %0) {
%2 = icmp eq %struct.btrfs_delayed_extent_op* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.btrfs_delayed_extent_op* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void badsfmt(void) { errx(1, "%%s: requires a precision or a byte count"); }


x86 assembly (clang, -O0):
<badsfmt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<badsfmt>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"%%s: requires a precision or a byte count\00"
define void @badsfmt() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"%%s: requires a precision or a byte count\00"
define void @badsfmt() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bbm_long_read(void *, unsigned short, unsigned short, unsigned int *);
int bbm_com_long_read(void *handle, unsigned short devid, unsigned short addr,
                      unsigned int *data) {
  int res;
  res = bbm_long_read(handle, devid, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_long_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0xc(%rbp),%ax
mov    -0x18(%rbp),%rcx
movzwl %dx,%esi
movzwl %ax,%edx
call   1030 <bbm_long_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_long_read>:
jmp    1030 <bbm_long_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_long_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i32*
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i32* %3, i32** %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i16, i16* %7
%13 = load i32*, i32** %8
%14 = call i32 @bbm_long_read(i8* %10, i16 zeroext %11, i16 zeroext %12, i32* %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_long_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i32* %3) {
%5 = tail call i32 @bbm_long_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i32* %3)
ret i32 %5
}
/* Variables and functions */
double log10(double);
double _hz2mel(const double f) { return 2595.0 * log10(1.0 + (f / 700.0)); }


x86 assembly (clang, -O0):
<_hz2mel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hz2mel>:
push   %rax
divsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
call   1030 <log10@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_hz2mel(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 7.000000e+02
%5 = fadd double 1.000000e+00, %4
%6 = call double @log10(double %5)
%7 = fmul double 2.595000e+03, %6
ret double %7
}

LLVM IR (-O2):
define double @_hz2mel(double %0) {
%2 = fdiv double %0, 7.000000e+02
%3 = fadd double %2, 1.000000e+00
%4 = tail call double @log10(double %3)
%5 = fmul double %4, 2.595000e+03
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
long strtol(char *, char **, int);
long alternative_reader() {
  char *str;
  long number;
  char aux[12];
  printf("Enter a number: ");
  fgets(aux, 12, stdin);
  number = strtol(aux, &str, 10);
  return number;
}


x86 assembly (clang, -O0):
<alternative_reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0xc,%esi
call   1040 <fgets@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alternative_reader>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
lea    0x14(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <fgets@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1050 <strtol@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@stdin = global i32 0
define i64 @alternative_reader() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca [12 x i8]
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 12, i32 %6)
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%9 = call i64 @strtol(i8* %8, i8** %1, i32 10)
store i64 %9, i64* %2
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@stdin = global i32 0
define i64 @alternative_reader() {
%1 = alloca i8*
%2 = alloca [12 x i8]
%3 = bitcast i8** %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 12, i32 %6)
%8 = call i64 @strtol(i8* %4, i8** %1, i32 10)
ret i64 %8
}
/* Variables and functions */
int roadmap_line_speed_get_cross_time_at(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int roadmap_line_speed_get_cross_time(int line, int against_dir) {
  return roadmap_line_speed_get_cross_time_at(line, against_dir, time(NULL));
}


x86 assembly (clang, -O0):
<roadmap_line_speed_get_cross_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1030 <roadmap_line_speed_get_cross_time_at@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_line_speed_get_cross_time>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <time@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <roadmap_line_speed_get_cross_time_at@plt>

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

LLVM IR (-O2):
define i32 @roadmap_line_speed_get_cross_time(i32 %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @roadmap_line_speed_get_cross_time_at(i32 %0, i32 %1, i32 %3)
ret i32 %4
}
int f5(int y, int x) {
  int a = y & x;
  return a | x;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f5(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 = and i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = or i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 returned %1) {
ret i32 %1
}
float max(float value, float maxium) {
  return (value < maxium) ? maxium : value;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <max+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <max+0x3a>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %4
br label %12
10: ; preds = %2
%11 = load float, float* %3
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
int g(int *arr, int *in) { return arr[*in + 5]; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movslq (%rsi),%rax
mov    0x14(%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_IntRegister(int, void (*)());
void stub1(uint32_t);
void SHA2IntRegister(void (*handlerFxn)(void)) {
  NOROM_IntRegister(39, handlerFxn);
  ((void (*)(uint32_t ui32Interrupt))(
      (uint32_t *)(((uint32_t *)0x10000180)[12]))[4])(39);
}


x86 assembly (clang, -O0):
<SHA2IntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x27,%edi
call   1030 <NOROM_IntRegister@plt>
mov    $0x10000180,%eax
mov    0x60(%rax),%rax
mov    $0x27,%edi
call   *0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA2IntRegister>:
push   %rax
mov    %rdi,%rsi
mov    $0x27,%edi
call   1030 <NOROM_IntRegister@plt>
mov    0x100001e0,%rax
10
mov    $0x27,%edi
pop    %rcx
jmp    *0x20(%rax)

LLVM IR (-O0):
define void @SHA2IntRegister(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @NOROM_IntRegister(i32 39, void (...)* %4)
%6 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 268435840 to i64*), i64 12)
%7 = inttoptr i64 %6 to i64*
%8 = getelementptr inbounds i64, i64* %7, i64 4
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to void (i64)*
ret void
}

LLVM IR (-O2):
define void @SHA2IntRegister(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @NOROM_IntRegister(i32 39, void (...)* %2)
%4 = load i64, i64* inttoptr (i64 268435936 to i64*)
%5 = inttoptr i64 %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 4
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to void (i64)*
tail call void %8(i64 39)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_gyrate(int, char **);
int main(int argc, char *argv[]) {
  gmx_gyrate(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_gyrate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_gyrate@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_gyrate(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_gyrate(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int bar(int);
int foo(int y) {
  int a, b;
  a = bar(7) + 6;
  b = bar(7) + 6;
  return a + b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7,%edi
call   1030 <bar@plt>
add    $0x6,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
call   1030 <bar@plt>
add    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    $0x7,%edi
call   1030 <bar@plt>
mov    %eax,%ebx
mov    $0x7,%edi
call   1030 <bar@plt>
add    %ebx,%eax
add    $0xc,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 @bar(i32 7)
%6 = add nsw i32 %5, 6
store i32 %6, i32* %3
%7 = call i32 @bar(i32 7)
%8 = add nsw i32 %7, 6
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @bar(i32 7)
%3 = tail call i32 @bar(i32 7)
%4 = add i32 %2, 12
%5 = add i32 %4, %3
ret i32 %5
}
indreg0adrreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((*p0) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
ja     113a <indreg0adrreg1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <indreg0adrreg1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrreg1>:
mov    (%r8),%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %4
%8 = getelementptr inbounds i32, i32* %5, i64 277777
%9 = load i32, i32* %8
%10 = icmp ule i32 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
void printcall(tcp) struct tcb *tcp;
{}


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

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

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

LLVM IR (-O2):
%struct.tcb = type opaque
define void @printcall(%struct.tcb* nocapture %0) {
ret void
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t rol8x(unsigned char input, int count) {
  return ((input << count)) | (input) >> (8 - count);
}


x86 assembly (clang, -O0):
<rol8x>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol8x>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @rol8x(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}