xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int,
                          ...);
int main(void) {
  int i = 2147483647;
  unsigned int j = 4294967295;
  printf("%d %d %d\n", i, i + 1, i + 2);
  printf("%u (%d) %u %u\n", j, j, j + 1, j + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0xc(%rbp),%r8d
add    $0x2,%r8d
lea    0xea5(%rip),%rdi
mov    $0x0,%al
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    $0x7fffffff,%esi
mov    $0x80000000,%edx
mov    $0x80000001,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [15 x i8] c"%u (%d) %u %u\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 -2147483648, i32 -2147483647)
%2 = tail call i32 (i8*, i32, i32, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 -1, i32 0, i32 1)
ret i32 0
}
void gdk_window_reparent() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_reparent() {
ret void
}
int similarities(char S2, char (*BLOSUM)[6]) { return BLOSUM[S2][S2]; }


x86 assembly (clang, -O0):
<similarities>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
imul   $0x6,%rcx,%rcx
add    %rcx,%rax
movsbq -0x1(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<similarities>:
movslq %edi,%rax
lea    (%rax,%rax,2),%rcx
lea    (%rsi,%rcx,2),%rcx
movsbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i32 @similarities(i8 signext %0, [6 x i8]* %1) {
%3 = alloca i8
%4 = alloca [6 x i8]*
store i8 %0, i8* %3
store [6 x i8]* %1, [6 x i8]** %4
%5 = load [6 x i8]*, [6 x i8]** %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i64
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 %7
%9 = load i8, i8* %3
%10 = sext i8 %9 to i64
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @similarities(i8 signext %0, [6 x i8]* nocapture %1) {
%3 = sext i8 %0 to i64
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 %3, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fchkhdl(int /*<<< orphan*/ *);
int write(int, void *, int);
int fdfwrite(void *ptr, int size, int num, FILE *fp) {
  if (fchkhdl(fp))
    return (write((int)fp, ptr, size * num));
}


x86 assembly (clang, -O0):
<fdfwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <fchkhdl@plt>
cmp    $0x0,%rax
je     1162 <fdfwrite+0x42>
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdfwrite>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r15
mov    %rcx,%rdi
call   1030 <fchkhdl@plt>
test   %rax,%rax
je     1158 <fdfwrite+0x38>
imul   %ebp,%ebx
mov    %r14d,%edi
mov    %r15,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fdfwrite(i8* nocapture %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i64 @fchkhdl(i32* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = ptrtoint i32* %3 to i64
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %2, %1
%11 = tail call i32 @write(i32 %9, i8* %0, i32 %10)
br label %12
12: ; preds = %7, %4
%13 = phi i32 [ %11, %7 ], [ undef, %4 ]
ret i32 %13
}
int test_imm_04int64_lowword_mem(long long *val) {
  return ((*val) & (0x04 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_04int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((always_)) int dma_get_cache_alignment(void) { return (1 << 7); }


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

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

LLVM IR (-O0):
define i32 @dma_get_cache_alignment() {
ret i32 128
}

LLVM IR (-O2):
define i32 @dma_get_cache_alignment() {
ret i32 128
}
unsigned int Strings_CanDeleteAll(unsigned int stringLength,
                                  unsigned int startIndex,
                                  unsigned int numberToDelete) {
  return (startIndex + numberToDelete) <= stringLength;
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<Strings_CanDeleteAll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strings_CanDeleteAll>:
add    %edx,%esi
xor    %eax,%eax
cmp    %edi,%esi
setbe  %al
ret

LLVM IR (-O0):
define i32 @Strings_CanDeleteAll(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = add i32 %7, %8
%10 = load i32, i32* %4
%11 = icmp ule i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @Strings_CanDeleteAll(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %2, %1
%5 = icmp ule i32 %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int strlen(char const *);
int strlen_trim(const char *str) {
  int len;
  int i;
  len = strlen(str);
  for (i = len - 1; i >= 0; i++) {
    if (str[i] != ' ' || str[i] != '\t')
      return i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strlen_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1186 <strlen_trim+0x76>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1165 <strlen_trim+0x55>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
je     1173 <strlen_trim+0x63>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    118d <strlen_trim+0x7d>
jmp    1178 <strlen_trim+0x68>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <strlen_trim+0x21>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_trim>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @strlen_trim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
int get_unit_number() { return 1; }


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

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

LLVM IR (-O0):
define i32 @get_unit_number() {
ret i32 1
}

LLVM IR (-O2):
define i32 @get_unit_number() {
ret i32 1
}
INSTRUCTION(scf) { set_flag_c(1); }


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

x86 assembly (clang, -O2):
<INSTRUCTION>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <set_flag_c@plt>

LLVM IR (-O0):
define i32 @INSTRUCTION(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @set_flag_c to i32 (i32, ...)*)(i32 1)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @INSTRUCTION(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_flag_c to i32 (i32, ...)*)(i32 1)
ret i32 undef
}
double multiple(double x, double y) { return x * y; }


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

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

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

LLVM IR (-O2):
define double @multiple(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ ACUTE_assert_print(int, unsigned char *);
void ACUTE_assert_equal(int acutal, int expected, int line,
                        unsigned char *exception) {
  if (acutal != expected) {
    ACUTE_assert_print(line, exception);
  }
}


x86 assembly (clang, -O0):
<ACUTE_assert_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113d <ACUTE_assert_equal+0x2d>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <ACUTE_assert_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ACUTE_assert_equal>:
cmp    %esi,%edi
jne    1115 <ACUTE_assert_equal+0x5>
ret
mov    %edx,%edi
mov    %rcx,%rsi
jmp    1030 <ACUTE_assert_print@plt>

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

LLVM IR (-O2):
define void @ACUTE_assert_equal(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %0, %1
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @ACUTE_assert_print(i32 %2, i8* %3)
br label %8
8: ; preds = %6, %4
ret void
}
int c081(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c081() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_whitespace(char *p) {
  while (*p && isspace(*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_whitespace+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_whitespace+0x47>
jmp    1168 <skip_whitespace+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_whitespace+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_whitespace+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ f2(int);
int f1(int limite) {
  int i;
  for (i = 1; i < limite; i++)
    f2(i);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1144 <f1+0x34>
mov    -0xc(%rbp),%edi
call   1030 <f2@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <f1+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     112e <f1+0x1e>
mov    %edi,%ebx
mov    $0x1,%ebp
nop
mov    %ebp,%edi
call   1030 <f2@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <f1+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @f2(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
void *malloc(size_t);
void *MallocWrap(void *userdata, size_t size) {
  (void)userdata;
  return malloc(size);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @MallocWrap(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
DIR *__fdopendir(int fd) {
  __set_errno(ENOSYS);
  return NULL;
}


x86 assembly (clang, -O0):
<__fdopendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fdopendir>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32* @__fdopendir(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define noalias i32* @__fdopendir(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32* null
}
/* Variables and functions */
int func();
int main(void) { return func() == 42 ? 0 : 1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x2a,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func@plt>
xor    %ecx,%ecx
cmp    $0x2a,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func()
%3 = icmp eq i32 %2, 42
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
%2 = icmp ne i32 %1, 42
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SCB_1_UartInit();
void SCB_1_Init(void) { SCB_1_UartInit(); }


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

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

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

LLVM IR (-O2):
define void @SCB_1_Init() {
%1 = tail call i32 (...) @SCB_1_UartInit()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ spi(int);
uint32_t sdmmc_read_word() {
  return ((uint32_t)spi(0xff) << 24) | ((uint32_t)spi(0xff) << 16) |
         ((uint32_t)spi(0xff) << 8) | ((uint32_t)spi(0xff));
}


x86 assembly (clang, -O0):
<sdmmc_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff,%edi
call   1030 <spi@plt>
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    $0xff,%edi
call   1030 <spi@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xff,%edi
call   1030 <spi@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0xff,%edi
call   1030 <spi@plt>
mov    %rax,%rcx
mov    -0x4(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdmmc_read_word>:
push   %r14
push   %rbx
push   %rax
mov    $0xff,%edi
call   1030 <spi@plt>
mov    %rax,%r14
shl    $0x18,%r14d
mov    $0xff,%edi
call   1030 <spi@plt>
mov    %rax,%rbx
shl    $0x10,%ebx
or     %r14d,%ebx
mov    $0xff,%edi
call   1030 <spi@plt>
mov    %rax,%r14
shl    $0x8,%r14d
mov    $0xff,%edi
call   1030 <spi@plt>
or     %r14d,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @sdmmc_read_word() {
%1 = call i64 @spi(i32 255)
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 24
%4 = call i64 @spi(i32 255)
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 16
%7 = or i32 %3, %6
%8 = call i64 @spi(i32 255)
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = call i64 @spi(i32 255)
%13 = trunc i64 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @sdmmc_read_word() {
%1 = tail call i64 @spi(i32 255)
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 24
%4 = tail call i64 @spi(i32 255)
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = tail call i64 @spi(i32 255)
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = tail call i64 @spi(i32 255)
%13 = trunc i64 %12 to i32
%14 = or i32 %11, %13
ret i32 %14
}
void after_count(void) {}


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

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

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

LLVM IR (-O2):
define void @after_count() {
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void uppercase(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++) {
    s[i] = toupper(s[i]);
  }
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <uppercase+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <uppercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <uppercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <uppercase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @uppercase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_malloc(void *p) {
  if (NULL == p) {
    fprintf(stderr, "Out of memory. Bailing\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    115b <check_malloc+0x3b>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc>:
test   %rdi,%rdi
je     1126 <check_malloc+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Out of memory. Bailing\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_malloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* null, %3
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Out of memory. Bailing\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_malloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void padding(int c) {
  while (c-- > 0) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <padding+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <padding+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padding>:
push   %rbx
test   %edi,%edi
jle    1132 <padding+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <padding+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @padding(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i32 32)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CONCEPT_AWARE_header2N(char *, char *);
int /*<<< orphan*/ qError(char *);
int qGetContentFlag();
void qRedirect(char *url) {
  if (qGetContentFlag() == 1)
    qError("qRedirect(): qRedirect() must be called before qContentType() and "
           "any stream out.");
  CONCEPT_AWARE_header2N("Location", url);
}


x86 assembly (clang, -O0):
<qRedirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <qGetContentFlag@plt>
cmp    $0x1,%eax
jne    1158 <qRedirect+0x28>
lea    0xead(%rip),%rdi
call   1040 <qError@plt>
mov    -0x8(%rbp),%rsi
lea    0xeef(%rip),%rdi
call   1030 <CONCEPT_AWARE_header2N@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qRedirect>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <qGetContentFlag@plt>
cmp    $0x1,%eax
jne    114c <qRedirect+0x1c>
lea    0xeb9(%rip),%rdi
call   1040 <qError@plt>
lea    0xeff(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <CONCEPT_AWARE_header2N@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"qRedirect(): qRedirect() must be called before qContentType() and any stream out.\00"
@.str.1 = [9 x i8] c"Location\00"
define void @qRedirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @qGetContentFlag()
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @qError(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @CONCEPT_AWARE_header2N(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [82 x i8] c"qRedirect(): qRedirect() must be called before qContentType() and any stream out.\00"
@.str.1 = [9 x i8] c"Location\00"
define void @qRedirect(i8* %0) {
%2 = tail call i32 (...) @qGetContentFlag()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @qError(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @CONCEPT_AWARE_header2N(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int fibo(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int k;
  for (k = 0; k < 32; k++) {
    printf("%d %10d\n", k, fibo(k));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibo@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <fibo@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %10d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @fibo(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 32
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Variables and functions */
scalar_t__ hex2mem(char *, char *, int, int);
char *make_return_packet(int);
char *gdb_write_memory(long addr, int nbytes, char *mem) {
  if (hex2mem(mem, (char *)addr, nbytes, 1))
    return (make_return_packet(0));
  else {
    return (make_return_packet(3));
  }
}


x86 assembly (clang, -O0):
<gdb_write_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <hex2mem@plt>
cmp    $0x0,%rax
je     1162 <gdb_write_memory+0x42>
xor    %edi,%edi
call   1040 <make_return_packet@plt>
mov    %rax,-0x8(%rbp)
jmp    1170 <gdb_write_memory+0x50>
mov    $0x3,%edi
call   1040 <make_return_packet@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_write_memory>:
push   %rax
mov    %rdx,%rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rax,%rdi
mov    $0x1,%ecx
call   1030 <hex2mem@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,2),%edi
pop    %rax
jmp    1040 <make_return_packet@plt>

LLVM IR (-O0):
define i8* @gdb_write_memory(i64 %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i8*, i8** %7
%9 = load i64, i64* %5
%10 = inttoptr i64 %9 to i8*
%11 = load i32, i32* %6
%12 = call i64 @hex2mem(i8* %8, i8* %10, i32 %11, i32 1)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i8* @make_return_packet(i32 0)
store i8* %15, i8** %4
br label %18
16: ; preds = %3
%17 = call i8* @make_return_packet(i32 3)
store i8* %17, i8** %4
br label %18
18: ; preds = %16, %14
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @gdb_write_memory(i64 %0, i32 %1, i8* %2) {
%4 = inttoptr i64 %0 to i8*
%5 = tail call i64 @hex2mem(i8* %2, i8* %4, i32 %1, i32 1)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 3, i32 0
%8 = tail call i8* @make_return_packet(i32 %7)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ shuffle(char *, int);
scalar_t__ strcmp(char *, char *);
int bogoSort(char arr[], char sorted[], int size) {
  int count = 0;
  while (!(strcmp(arr, sorted) == 0)) {
    shuffle(arr, size);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<bogoSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    115d <bogoSort+0x3d>
jmp    1177 <bogoSort+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <shuffle@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <bogoSort+0x1a>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bogoSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115e <bogoSort+0x3e>
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r14d,%esi
call   1030 <shuffle@plt>
add    $0x1,%ebx
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1140 <bogoSort+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bogoSort(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = tail call i32 @shuffle(i8* %0, i32 %2)
%9 = add nuw nsw i32 %7, 1
%10 = tail call i64 @strcmp(i8* %0, i8* %1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %3
%13 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void copy_int2(char **pointer, int16_t value) {
  value = htons(value);
  memcpy(*pointer, &value, 2);
  *pointer += 2;
}


x86 assembly (clang, -O0):
<copy_int2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_int2>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
lea    0xc(%rsp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
addq   $0x2,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @copy_int2(i8** nocapture %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %1)
store i32 %4, i32* %3
%5 = load i8*, i8** %0
%6 = call i32 @memcpy(i8* %5, i32* %3, i32 2)
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8* %8, i8** %0
ret void
}
void rwx(unsigned short bits, char *chars) {
  chars[0] = (bits & 00400) ? 'r' : '-';
  chars[1] = (bits & 00200) ? 'w' : '-';
  chars[2] = (bits & 00100) ? 'x' : '-';
}


x86 assembly (clang, -O0):
<rwx>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x100,%edx
mov    $0x2d,%eax
mov    $0x72,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%edx
and    $0x80,%edx
mov    $0x2d,%eax
mov    $0x77,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0x2(%rbp),%edx
and    $0x40,%edx
mov    $0x2d,%eax
mov    $0x78,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rwx>:
test   $0x100,%edi
mov    $0x2d,%eax
mov    $0x72,%ecx
cmove  %eax,%ecx
mov    %cl,(%rsi)
test   $0x80,%dil
mov    $0x77,%ecx
cmove  %eax,%ecx
mov    %cl,0x1(%rsi)
test   $0x40,%dil
mov    $0x78,%ecx
cmove  %eax,%ecx
mov    %cl,0x2(%rsi)
ret

LLVM IR (-O0):
define void @rwx(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 256
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 114, i32 45
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = and i32 %15, 128
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 119, i32 45
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i16, i16* %3
%24 = zext i16 %23 to i32
%25 = and i32 %24, 64
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 120, i32 45
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 %29, i8* %31
ret void
}

LLVM IR (-O2):
define void @rwx(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = zext i16 %0 to i32
%4 = and i32 %3, 256
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8 45, i8 114
store i8 %6, i8* %1
%7 = and i32 %3, 128
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8 45, i8 119
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %10
%11 = and i32 %3, 64
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8 45, i8 120
%14 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %13, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int fork(void) {
  printf("fork() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fork>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"fork() not implemented\0A\00"
define i32 @fork() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"fork() not implemented\00"
define i32 @fork() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
void *find_in_auxvec(long *x, long what) {
  while (*x) {
    if (*x == what)
      return (void *)x[1];
    x += 2;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<find_in_auxvec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114d <find_in_auxvec+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    113c <find_in_auxvec+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <find_in_auxvec+0x55>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <find_in_auxvec+0xc>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_in_auxvec>:
mov    (%rdi),%rcx
test   %rcx,%rcx
je     1122 <find_in_auxvec+0x22>
add    $0x10,%rdi
xor    %eax,%eax
xchg   %ax,%ax
cmp    %rsi,%rcx
je     1125 <find_in_auxvec+0x25>
mov    (%rdi),%rcx
add    $0x10,%rdi
test   %rcx,%rcx
jne    1110 <find_in_auxvec+0x10>
ret
xor    %eax,%eax
ret
mov    -0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @find_in_auxvec(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %13
%6 = phi i64 [ %15, %13 ], [ %3, %2 ]
%7 = phi i64* [ %14, %13 ], [ %0, %2 ]
%8 = icmp eq i64 %6, %1
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %7, i64 1
%11 = load i64, i64* %10
%12 = inttoptr i64 %11 to i8*
br label %17
13: ; preds = %5
%14 = getelementptr inbounds i64, i64* %7, i64 2
%15 = load i64, i64* %14
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %13, %2, %9
%18 = phi i8* [ %12, %9 ], [ null, %2 ], [ null, %13 ]
ret i8* %18
}