xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int k;
  int n;
  if (!((i == 0) && (k == 0) && (n > 0)))
    return 0;
  while (i < n) {
    i++;
    k++;
  }
  assert((i == k) && (k == n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113d <main+0x2d>
cmpl   $0x0,-0xc(%rbp)
jne    113d <main+0x2d>
cmpl   $0x0,-0x10(%rbp)
jg     1149 <main+0x39>
movl   $0x0,-0x4(%rbp)
jmp    11a2 <main+0x92>
jmp    114e <main+0x3e>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1171 <main+0x61>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <main+0x3e>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jne    118e <main+0x7e>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10, %7, %0
store i32 0, i32* %1
br label %36
14: ; preds = %10
br label %15
15: ; preds = %19, %14
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %15
24: ; preds = %15
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %32
28: ; preds = %24
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = icmp eq i32 %29, %30
br label %32
32: ; preds = %28, %24
%33 = phi i1 [ false, %24 ], [ %31, %28 ]
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
store i32 0, i32* %1
br label %36
36: ; preds = %32, %13
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void endian_check(void) {
  unsigned int ia = 0x12345678;
  unsigned char cb = ia & 0xff;
  if (cb == 0x78) {
    printf("little endian\n");
  } else if (cb == 0x12) {
    printf("big endian\n");
  } else {
    fprintf(stderr, "Unkown endian\n");
  }
}


x86 assembly (clang, -O0):
<endian_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x12345678,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x78,%eax
jne    1158 <endian_check+0x38>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <endian_check+0x70>
movzbl -0x5(%rbp),%eax
cmp    $0x12,%eax
jne    1176 <endian_check+0x56>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    118b <endian_check+0x6b>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1190 <endian_check+0x70>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"little endian\0A\00"
@.str.1 = [12 x i8] c"big endian\0A\00"
@stderr = global i32 0
@.str.2 = [15 x i8] c"Unkown endian\0A\00"
define void @endian_check() {
%1 = alloca i32
%2 = alloca i8
store i32 305419896, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 255
%5 = trunc i32 %4 to i8
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 120
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %21
11: ; preds = %0
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 18
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %20
17: ; preds = %11
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %17, %15
br label %21
21: ; preds = %20, %9
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@str = [14 x i8] c"little endian\00"
define void @endian_check() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY_METHOD;

/* Variables and functions */
int pmeth_cmp(int /*<<< orphan*/ const *const *,
              int /*<<< orphan*/ const *const *);
int pmeth_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) {
  const EVP_PKEY_METHOD *const *a = a_;
  const EVP_PKEY_METHOD *const *b = b_;
  return pmeth_cmp(a, b);
}


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

x86 assembly (clang, -O2):
<pmeth_cmp_BSEARCH_CMP_FN>:
jmp    1030 <pmeth_cmp@plt>

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

LLVM IR (-O2):
define i32 @pmeth_cmp_BSEARCH_CMP_FN(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i32**
%4 = bitcast i8* %1 to i32**
%5 = tail call i32 @pmeth_cmp(i32** %3, i32** %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x1c() {
  Assert_real((ispunct(28) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              145, ("ispunct should be 0 for 0x1c"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x1c\00"
define void @t_ispunct_0x1c() {
%1 = tail call i64 @ispunct(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stderr;
int _kill_error(char const *message, int ret) {
  fprintf(stderr, "%s: %s\n", "kill", message);
  return ret;
}


x86 assembly (clang, -O0):
<_kill_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xecd(%rip),%rsi
lea    0xece(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill_error>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
lea    0xedb(%rip),%rdx
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [5 x i8] c"kill\00"
define i32 @_kill_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [5 x i8] c"kill\00"
define i32 @_kill_error(i8* %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 %1
}
double square(double p) { return p * p; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void _print_int(int32_t n) { printf("%d", (int)n); }


x86 assembly (clang, -O0):
<_print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_int>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @_print_int(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int get_lenght(const int str[]) {
  int lenght = 0;
  while (str[lenght] != '\0') {
    lenght++;
  }
  return lenght;
}


x86 assembly (clang, -O0):
<get_lenght>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     112f <get_lenght+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_lenght+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lenght>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpl   $0x0,(%rdi)
lea    0x4(%rdi),%rdi
jne    1110 <get_lenght+0x10>
ret

LLVM IR (-O0):
define i32 @get_lenght(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_lenght(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
__attribute__((always_)) int __test_facility(unsigned long nr,
                                             void *facilities) {
  unsigned char *ptr;
  if (nr >= (256 * 8))
    return 0;
  ptr = (unsigned char *)facilities + (nr >> 3);
  return (*ptr & (0x80 >> (nr & 7))) != 0;
}


x86 assembly (clang, -O0):
<__test_facility>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x800,-0x10(%rbp)
jb     1126 <__test_facility+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1161 <__test_facility+0x61>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
mov    $0x80,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_facility>:
xor    %eax,%eax
cmp    $0x7ff,%rdi
ja     1124 <__test_facility+0x24>
mov    %rdi,%rax
shr    $0x3,%rax
movzbl (%rsi,%rax,1),%eax
and    $0x7,%dil
mov    %edi,%ecx
shl    %cl,%eax
movzbl %al,%eax
shr    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @__test_facility(i64 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
%7 = load i64, i64* %4
%8 = icmp uge i64 %7, 2048
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %25
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i64, i64* %4
%13 = lshr i64 %12, 3
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i64, i64* %4
%19 = and i64 %18, 7
%20 = trunc i64 %19 to i32
%21 = ashr i32 128, %20
%22 = and i32 %17, %21
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i32
store i32 %24, i32* %3
br label %25
25: ; preds = %10, %9
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @__test_facility(i64 %0, i8* nocapture %1) {
%3 = icmp ugt i64 %0, 2047
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = lshr i64 %0, 3
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = trunc i64 %0 to i32
%10 = and i32 %9, 7
%11 = lshr i32 128, %10
%12 = and i32 %11, %8
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %2, %4
%16 = phi i32 [ %14, %4 ], [ 0, %2 ]
ret i32 %16
}
int input(int list[], int number, int max) {
  int i = 0;
  int top = 0;
  while (top != max) {
    if (list[i] == -1) {
      list[i] = number;
      return 1;
    } else {
      top++;
      i++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     116b <input+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    1154 <input+0x54>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
jmp    1172 <input+0x72>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <input+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
test   %edx,%edx
je     111f <input+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpl   $0xffffffff,(%rdi,%rcx,4)
je     1122 <input+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <input+0x10>
xor    %eax,%eax
ret
mov    %esi,(%rdi,%rcx,4)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @input(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %15
%8 = phi i64 [ 0, %5 ], [ %16, %15 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = and i64 %8, 4294967295
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 %1, i32* %14
br label %18
15: ; preds = %7
%16 = add nuw nsw i64 %8, 1
%17 = icmp eq i64 %16, %6
br i1 %17, label %18, label %7
18: ; preds = %15, %3, %12
%19 = phi i32 [ 1, %12 ], [ 0, %3 ], [ 0, %15 ]
ret i32 %19
}
/* Variables and functions */
char *measured_copy(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *copy_of(const char *string) {
  return measured_copy(string, strlen(string));
}


x86 assembly (clang, -O0):
<copy_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <measured_copy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_of>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <measured_copy@plt>

LLVM IR (-O0):
define i8* @copy_of(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @measured_copy(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @copy_of(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @measured_copy(i8* %0, i32 %2)
ret i8* %3
}
void FlashIntClear(unsigned long ulIntFlags) {
  (*((volatile unsigned long *)(0x400FD014))) = ulIntFlags;
}


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

x86 assembly (clang, -O2):
<FlashIntClear>:
mov    %rdi,0x400fd014
40
ret

LLVM IR (-O0):
define void @FlashIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074778132 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074778132 to i64*)
ret void
}
/* Type definitions */
struct cvec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FREE(struct cvec *);
void freecvec(struct cvec *cv) { FREE(cv); }


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

x86 assembly (clang, -O2):
<freecvec>:
jmp    1030 <FREE@plt>

LLVM IR (-O0):
%struct.cvec = type { i32 }
define void @freecvec(%struct.cvec* %0) {
%2 = alloca %struct.cvec*
store %struct.cvec* %0, %struct.cvec** %2
%3 = load %struct.cvec*, %struct.cvec** %2
%4 = call i32 @FREE(%struct.cvec* %3)
ret void
}

LLVM IR (-O2):
%struct.cvec = type { i32 }
define void @freecvec(%struct.cvec* %0) {
%2 = tail call i32 @FREE(%struct.cvec* %0)
ret void
}
int max(int x, int y) { return (x > y) ? x : y; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("?"); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @putchar(i32 63)
ret void
}
/* Variables and functions */
int CHAR_BIT;
unsigned rightrot(unsigned x, int n) {
  unsigned to_rotate, x_shifted, to_rotate_shifted, x_rotated;
  x_shifted = x >> n;
  to_rotate = x_shifted & ~(~0 << n);
  to_rotate_shifted = x << ((CHAR_BIT * sizeof x) - n);
  x_rotated = x_shifted | to_rotate_shifted;
  return x_rotated;
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eaa(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
movslq -0x8(%rbp),%rdx
sub    %rdx,%rcx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
mov    0x2ed3(%rip),%rdx
mov    (%rdx),%edx
shl    $0x2,%edx
sub    %esi,%edx
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = lshr i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = shl i32 -1, %13
%15 = xor i32 %14, -1
%16 = and i32 %12, %15
store i32 %16, i32* %5
%17 = load i32, i32* %3
%18 = load i32, i32* @CHAR_BIT
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 4
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = sub i64 %20, %22
%24 = trunc i64 %23 to i32
%25 = shl i32 %17, %24
store i32 %25, i32* %7
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = or i32 %26, %27
store i32 %28, i32* %8
%29 = load i32, i32* %8
ret i32 %29
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @rightrot(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = load i32, i32* @CHAR_BIT
%5 = shl i32 %4, 2
%6 = sub i32 %5, %1
%7 = shl i32 %0, %6
%8 = or i32 %7, %3
ret i32 %8
}
int test2() {
  return ({
    L:
      5;
  });
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test2() {
%1 = alloca i32
br label %2
2: ; preds = %0
store i32 5, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test2() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ zwave_sendClassCommand(unsigned int, int, int,
                                          unsigned char *, int);
void zwavecmd_configuration_get(unsigned int id, unsigned int no) {
  unsigned char buf[255];
  buf[0] = no;
  zwave_sendClassCommand(id, 0x70, 0x05, buf, 1);
}


x86 assembly (clang, -O0):
<zwavecmd_configuration_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x110(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rcx
mov    $0x70,%esi
mov    $0x5,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_configuration_get>:
sub    $0x108,%rsp
mov    %sil,(%rsp)
mov    %rsp,%rcx
mov    $0x70,%esi
mov    $0x5,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @zwavecmd_configuration_get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [255 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @zwave_sendClassCommand(i32 %9, i32 112, i32 5, i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @zwavecmd_configuration_get(i32 %0, i32 %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = call i32 @zwave_sendClassCommand(i32 %0, i32 112, i32 5, i8* %4, i32 1)
ret void
}
int ffi_test_1(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @ffi_test_1() {
ret i32 3
}

LLVM IR (-O2):
define i32 @ffi_test_1() {
ret i32 3
}
void transpose1(double out[2][2], const double in[2][2]) {}


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

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

LLVM IR (-O0):
define void @transpose1([2 x double]* %0, [2 x double]* %1) {
%3 = alloca [2 x double]*
%4 = alloca [2 x double]*
store [2 x double]* %0, [2 x double]** %3
store [2 x double]* %1, [2 x double]** %4
ret void
}

LLVM IR (-O2):
define void @transpose1([2 x double]* nocapture %0, [2 x double]* nocapture %1) {
ret void
}
/* Variables and functions */
int xlog2(size_t x) {
  int r = -1;
  while (x != 0) {
    x >>= 1;
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<xlog2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <xlog2+0x34>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <xlog2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlog2>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111f <xlog2+0x1f>
mov    %rdi,%rcx
nopl   (%rax)
shr    %rcx
add    $0x1,%eax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <xlog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @xlog2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
void av_ac3_parse_header() {}


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

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

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

LLVM IR (-O2):
define void @av_ac3_parse_header() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ req_func();
void handle_update_signal(int signum) { req_func(); }


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

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

LLVM IR (-O0):
define void @handle_update_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @req_func()
ret void
}

LLVM IR (-O2):
define void @handle_update_signal(i32 %0) {
%2 = tail call i32 (...) @req_func()
ret void
}
int dv(int val1, int val2) { return (val2 == 0) ? 0 : (val1 / val2); }


x86 assembly (clang, -O0):
<dv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111e <dv+0x1e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <dv+0x28>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv>:
test   %esi,%esi
je     110a <dv+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @dv(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ print_dependencies(char *);
void print_elf() { print_dependencies(".elf"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c".elf\00"
define void @print_elf() {
%1 = call i32 @print_dependencies(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".elf\00"
define void @print_elf() {
%1 = tail call i32 @print_dependencies(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void twd_save(void) {}


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

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

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

LLVM IR (-O2):
define void @twd_save() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e();
int /*<<< orphan*/ proc1();
void d(int param1) {
  proc1();
  if (param1 > 1) {
    e();
  }
  return;
}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <proc1@plt>
cmpl   $0x1,-0x4(%rbp)
jle    1143 <d+0x23>
mov    $0x0,%al
call   1040 <e@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <proc1@plt>
cmp    $0x2,%ebx
jl     1137 <d+0x17>
xor    %eax,%eax
pop    %rbx
jmp    1040 <e@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @proc1()
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @e()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @d(i32 %0) {
%2 = tail call i32 (...) @proc1()
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @e()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int f(char *);
int main() {
  char a = 0;
  return f(&a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <f@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%3 = call i32 @f(i8* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @f(i8* %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LCD(int /*<<< orphan*/, int);
void limpaLCD() { LCD(0, 0b00000001); }


x86 assembly (clang, -O0):
<limpaLCD>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <LCD@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpaLCD>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <LCD@plt>

LLVM IR (-O0):
define void @limpaLCD() {
%1 = call i32 @LCD(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @limpaLCD() {
%1 = tail call i32 @LCD(i32 0, i32 1)
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
void do_ungetc(int c) {
  if (c != EOF)
    ungetc(c, stdin);
}


x86 assembly (clang, -O0):
<do_ungetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%eax
je     113e <do_ungetc+0x2e>
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ungetc>:
mov    0x2ec9(%rip),%rax
cmp    %edi,(%rax)
jne    111c <do_ungetc+0xc>
ret
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stdin = global i32 0
define void @do_ungetc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @stdin
%9 = call i32 @ungetc(i32 %7, i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
define void @do_ungetc(i32 %0) {
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stdin
%6 = tail call i32 @ungetc(i32 %0, i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%.2f", 100 * (1 - 0.2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 80)
ret i32 0
}
/* Variables and functions */
int strncmp(char *, char *, int);
int stringMatches(char *str1, char *str2) {
  int check;
  check = strncmp(str1, str2, 4);
  if (check == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<stringMatches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    114b <stringMatches+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <stringMatches+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringMatches>:
push   %rax
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stringMatches(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %0, i8* %1, i32 4)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int main() {
  struct epoll_event event;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.epoll_event
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int abs(int);
float emu_rps(int sample_rate_hz) {
  if (abs(sample_rate_hz - 8680000) <= 90000) {
    return 52.0833;
  } else {
    return 60.0;
  }
}


x86 assembly (clang, -O0):
<emu_rps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x847240,%edi
call   1030 <abs@plt>
cmp    $0x15f90,%eax
jg     1146 <emu_rps+0x36>
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <emu_rps+0x43>
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emu_rps>:
lea    -0x847240(%rdi),%eax
lea    -0x847240(%rdi),%ecx
neg    %ecx
cmp    $0x847240,%edi
cmovge %eax,%ecx
xor    %eax,%eax
cmp    $0x15f91,%ecx
setl   %al
lea    0xed7(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @emu_rps(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sub nsw i32 %4, 8680000
%6 = call i32 @abs(i32 %5)
%7 = icmp sle i32 %6, 90000
br i1 %7, label %8, label %9
8: ; preds = %1
store float 0x404A0AA9A0000000, float* %2
br label %10
9: ; preds = %1
store float 6.000000e+01, float* %2
br label %10
10: ; preds = %9, %8
%11 = load float, float* %2
ret float %11
}

LLVM IR (-O2):
define float @emu_rps(i32 %0) {
%2 = add nsw i32 %0, -8680000
%3 = icmp slt i32 %0, 8680000
%4 = sub i32 8680000, %0
%5 = select i1 %3, i32 %4, i32 %2
%6 = icmp slt i32 %5, 90001
%7 = select i1 %6, float 0x404A0AA9A0000000, float 6.000000e+01
ret float %7
}
label(l) { printf("L%d:", l); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"L%d:\00"
define i32 @label(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
void gdk_drag_context_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_context_get_type() {
ret void
}
/* Variables and functions */
int u8islowerasciii(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char *);
int u8islowerasciic(char *c) { return u8islowerasciii(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8islowerasciic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <u8tointcc@plt>
mov    %eax,%edi
call   1030 <u8islowerasciii@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8islowerasciic>:
push   %rax
call   1040 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <u8islowerasciii@plt>

LLVM IR (-O0):
define i32 @u8islowerasciic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointcc(i8* %3)
%5 = call i32 @u8islowerasciii(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8islowerasciic(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8islowerasciii(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SBC_(int);
int /*<<< orphan*/ c64_memIndirectZeroX();
void SBC_izx(void) {
  c64_memIndirectZeroX();
  SBC_(1);
}


x86 assembly (clang, -O0):
<SBC_izx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c64_memIndirectZeroX@plt>
mov    $0x1,%edi
call   1040 <SBC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SBC_izx>:
push   %rax
xor    %eax,%eax
call   1030 <c64_memIndirectZeroX@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <SBC_@plt>

LLVM IR (-O0):
define void @SBC_izx() {
%1 = call i32 (...) @c64_memIndirectZeroX()
%2 = call i32 @SBC_(i32 1)
ret void
}

LLVM IR (-O2):
define void @SBC_izx() {
%1 = tail call i32 (...) @c64_memIndirectZeroX()
%2 = tail call i32 @SBC_(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ mvprintw(int, int, char *);
void anykey(int y, int x) {
  curs_set(0);
  mvprintw(y, x, "Press any key to continue...");
  getch();
}


x86 assembly (clang, -O0):
<anykey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <curs_set@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdx
call   1050 <mvprintw@plt>
mov    $0x0,%al
call   1030 <getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anykey>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <curs_set@plt>
lea    0xebb(%rip),%rdx
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <mvprintw@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <getch@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Press any key to continue...\00"
define void @anykey(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @curs_set(i32 0)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @mvprintw(i32 %6, i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Press any key to continue...\00"
define void @anykey(i32 %0, i32 %1) {
%3 = tail call i32 @curs_set(i32 0)
%4 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
long sysconf(int /*<<< orphan*/);
long get_vmem_pagesize(void) { return sysconf(_SC_PAGESIZE); }


x86 assembly (clang, -O0):
<get_vmem_pagesize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_vmem_pagesize>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i64 @get_vmem_pagesize() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i64 @get_vmem_pagesize() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_anl_direct(char *str, uint8_t direct) {
  sprintf(str,
          "ANL   A, "
          "0x%02X"
          "                   ",
          direct);
}


x86 assembly (clang, -O0):
<sprint_anl_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_anl_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ANL A, 0x%02X \00"
define void @sprint_anl_direct(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 i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ANL A, 0x%02X \00"
define void @sprint_anl_direct(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}