xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Andrei Glingeanu\n");
  printf("201\n");
  printf("06.09.1995\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Andrei Glingeanu\0A\00"
@.str.1 = [5 x i8] c"201\0A\00"
@.str.2 = [12 x i8] c"06.09.1995\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Andrei Glingeanu\00"
@str.3 = [4 x i8] c"201\00"
@str.4 = [11 x i8] c"06.09.1995\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ boot_func1();
int app_func1(int i1, int i2) {
  boot_func1();
  return (i1 + i2);
}


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

x86 assembly (clang, -O2):
<app_func1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <boot_func1@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @app_func1(i32 %0, i32 %1) {
%3 = tail call i32 (...) @boot_func1()
%4 = add nsw i32 %1, %0
ret i32 %4
}
double eval_A(int i, int j) { return 12.0 / ((double)(i * j)); }


x86 assembly (clang, -O0):
<eval_A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xee3(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_A>:
imul   %esi,%edi
cvtsi2sd %edi,%xmm1
movsd  0xef1(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @eval_A(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 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double 1.200000e+01, %8
ret double %9
}

LLVM IR (-O2):
define double @eval_A(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fdiv double 1.200000e+01, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void page_free(void *ptr, size_t _) { free(ptr); }


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

x86 assembly (clang, -O2):
<page_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @page_free(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @page_free(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int cmp(const void *a, const void *b) {
  return (int)*(uint8_t *)a - (int)*(uint8_t *)b;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = bitcast i8* %1 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getPresentTemperature(unsigned char id) {
  return dxl_read_byte(id, (43));
}


x86 assembly (clang, -O0):
<getPresentTemperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2b,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPresentTemperature>:
mov    $0x2b,%esi
jmp    1030 <dxl_read_byte@plt>

LLVM IR (-O0):
define zeroext i8 @getPresentTemperature(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @dxl_read_byte(i8 zeroext %3, i32 43)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @getPresentTemperature(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 43)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_dec(FILE *stream) {
  fprintf(stream, "DEC   A                         ");
}


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

x86 assembly (clang, -O2):
<fprint_dec>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [33 x i8] c"DEC A \00"
define void @fprint_dec(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
size_t znload_int(void *, size_t, int /*<<< orphan*/ *, int);
size_t znload_i8(void *__restrict dst, size_t sz, int8_t x) {
  return znload_int(dst, sz, &x, sizeof(x));
}


x86 assembly (clang, -O0):
<znload_i8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <znload_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<znload_i8>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <znload_int@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @znload_i8(i8* noalias %0, i64 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i64 @znload_int(i8* %0, i64 %1, i32* %4, i32 4)
ret i64 %5
}
int cindex(char c, const char *str) {
  int i = 0, found = 0;
  while (*str != '\0') {
    if (*str == c) {
      found = 1;
      break;
    }
    str++;
    i++;
  }
  return (found > 0) ? i : -1;
}


x86 assembly (clang, -O0):
<cindex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <cindex+0x65>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    114b <cindex+0x4b>
movl   $0x1,-0x18(%rbp)
jmp    1165 <cindex+0x65>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <cindex+0x1c>
cmpl   $0x0,-0x18(%rbp)
jle    117a <cindex+0x7a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1187 <cindex+0x87>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1187 <cindex+0x87>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cindex>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <cindex+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,%dl
je     1123 <cindex+0x23>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <cindex+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cindex(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %13, %10 ], [ %3, %2 ]
%7 = phi i32 [ %12, %10 ], [ 0, %2 ]
%8 = phi i8* [ %11, %10 ], [ %1, %2 ]
%9 = icmp eq i8 %6, %0
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add nuw nsw i32 %7, 1
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %10, %5, %2
%16 = phi i32 [ -1, %2 ], [ %7, %5 ], [ -1, %10 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_printout();
int /*<<< orphan*/ mc_print_all_pages();
int /*<<< orphan*/ setup_printout(char const *, int, char *);
int /*<<< orphan*/ test_printout();
int tst_print_all_pages(const char *the_title) {
  setup_printout(the_title, (1), "contents of all pages");
  test_printout();
  mc_print_all_pages();
  cleanup_printout();
  return 1;
}


x86 assembly (clang, -O0):
<tst_print_all_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    0xea4(%rip),%rdx
call   1030 <setup_printout@plt>
mov    $0x0,%al
call   1050 <test_printout@plt>
mov    $0x0,%al
call   1060 <mc_print_all_pages@plt>
mov    $0x0,%al
call   1040 <cleanup_printout@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_print_all_pages>:
push   %rax
lea    0xeb8(%rip),%rdx
mov    $0x1,%esi
call   1030 <setup_printout@plt>
xor    %eax,%eax
call   1050 <test_printout@plt>
xor    %eax,%eax
call   1060 <mc_print_all_pages@plt>
xor    %eax,%eax
call   1040 <cleanup_printout@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"contents of all pages\00"
define i32 @tst_print_all_pages(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @setup_printout(i8* %3, i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @test_printout()
%6 = call i32 (...) @mc_print_all_pages()
%7 = call i32 (...) @cleanup_printout()
ret i32 1
}

LLVM IR (-O2):
@.str = [22 x i8] c"contents of all pages\00"
define i32 @tst_print_all_pages(i8* %0) {
%2 = tail call i32 @setup_printout(i8* %0, i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @test_printout()
%4 = tail call i32 (...) @mc_print_all_pages()
%5 = tail call i32 (...) @cleanup_printout()
ret i32 1
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ assert(int);
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t os_now(void) {
  struct timespec ts;
  int rc = clock_gettime(CLOCK_MONOTONIC, &ts);
  assert(rc == 0);
  return ((int64_t)ts.tv_sec) * 1000 + (((int64_t)ts.tv_nsec) / 1000000);
}


x86 assembly (clang, -O0):
<os_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_now>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @os_now() {
%1 = alloca %struct.timespec
%2 = alloca i32
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = mul nsw i32 %11, 1000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = sdiv i32 %15, 1000000
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @os_now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, 1000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = sdiv i32 %14, 1000000
%16 = add nsw i32 %15, %11
ret i32 %16
}
int dotest(int x) {
  do {
    if (x < 10)
      break;
    x--;
  } while (x >= 10);
  return x;
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1116 <dotest+0x16>
jmp    1129 <dotest+0x29>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1107 <dotest+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
cmp    $0x9,%edi
mov    $0x9,%eax
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @dotest(i32 %0) {
%2 = icmp slt i32 %0, 9
%3 = select i1 %2, i32 %0, i32 9
ret i32 %3
}
void ff_hevc_put_hevc_epel_h4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn11(int);
void fn12(void) {
  fn11(1);
  fn11(1);
  fn11(1);
}


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

x86 assembly (clang, -O2):
<fn12>:
push   %rax
mov    $0x1,%edi
call   1030 <fn11@plt>
mov    $0x1,%edi
call   1030 <fn11@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <fn11@plt>

LLVM IR (-O0):
define void @fn12() {
%1 = call i32 @fn11(i32 1)
%2 = call i32 @fn11(i32 1)
%3 = call i32 @fn11(i32 1)
ret void
}

LLVM IR (-O2):
define void @fn12() {
%1 = tail call i32 @fn11(i32 1)
%2 = tail call i32 @fn11(i32 1)
%3 = tail call i32 @fn11(i32 1)
ret void
}
int main() {
  int x, *p;
  if (sizeof(0) < 2)
    return 1;
  if (sizeof 0 < 2)
    return 1;
  if (sizeof(char) < 1)
    return 1;
  if (sizeof(int) - 2 < 0)
    return 1;
  if (sizeof(&x) != sizeof p)
    return 1;
  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):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *build_total_path(char *infix, char *path) {
  char *final_path = malloc(strlen(infix) + strlen(path) + 2);
  strcpy(final_path, infix);
  strcat(final_path, "/");
  strcat(final_path, path);
  return final_path;
}


x86 assembly (clang, -O0):
<build_total_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_total_path>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
lea    0xe80(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @build_total_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 2
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %5
%19 = load i8*, i8** %4
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @build_total_path(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rdx;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int cpuid_width_fixed_perf_counters() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 10;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  return (((uint64_t)(rdx) &
           ((((uint64_t)1 << (((12)) - ((5)) + 1)) - 1) << ((5)))) >>
          (5));
}


x86 assembly (clang, -O0):
<cpuid_width_fixed_perf_counters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x10(%rbp),%eax
and    $0x1fe0,%eax
sar    $0x5,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_width_fixed_perf_counters>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0xa,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x5,%eax
movzbl %al,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_width_fixed_perf_counters() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @cpuid(i32 %6, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %4
%9 = and i32 %8, 8160
%10 = ashr i32 %9, 5
ret i32 %10
}

LLVM IR (-O2):
define i32 @cpuid_width_fixed_perf_counters() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 10, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %4
%11 = lshr i32 %10, 5
%12 = and i32 %11, 255
ret i32 %12
}
int isupper(const int c) { return (c >= (int)'A' && c <= (int)'Z') ? 1 : 0; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float fabs(float);
float absf(float x) { return fabs(x); }


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

x86 assembly (clang, -O2):
<absf>:
andps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @absf(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
int rmstr(char *str, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (str[i] == '\0')
      break;
    str[i] = str[i + 1];
  }
}


x86 assembly (clang, -O0):
<rmstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1161 <rmstr+0x61>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1138 <rmstr+0x38>
jmp    1161 <rmstr+0x61>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <rmstr+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmstr>:
test   %esi,%esi
jle    1128 <rmstr+0x28>
mov    %esi,%eax
mov    (%rdi),%dl
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
test   %dl,%dl
je     1128 <rmstr+0x28>
movzbl 0x1(%rdi,%rcx,1),%edx
mov    %dl,(%rdi,%rcx,1)
lea    0x1(%rcx),%rsi
mov    %rsi,%rcx
cmp    %rsi,%rax
jne    1110 <rmstr+0x10>
ret

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

LLVM IR (-O2):
define i32 @rmstr(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i8, i8* %0
br label %7
7: ; preds = %4, %11
%8 = phi i8 [ %6, %4 ], [ %15, %11 ]
%9 = phi i64 [ 0, %4 ], [ %13, %11 ]
%10 = icmp eq i8 %8, 0
br i1 %10, label %17, label %11
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = add nuw nsw i64 %9, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
store i8 %15, i8* %12
%16 = icmp eq i64 %13, %5
br i1 %16, label %17, label %7
17: ; preds = %11, %7, %2
ret i32 undef
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double distorter_rand() { return ((double)rand() / (double)RAND_MAX); }


x86 assembly (clang, -O0):
<distorter_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distorter_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @distorter_rand() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @distorter_rand() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
void report_Socket_Close_Req(void) {}


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

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

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

LLVM IR (-O2):
define void @report_Socket_Close_Req() {
ret void
}
int sum2numbers(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<sum2numbers>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @sum2numbers(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
putstk(typeobj) char typeobj;
{
  mnem_pop();
  if (typeobj == 1)
    ol("MOV  [BX],AL");
  else
    ol("MOV  [BX],AX");
}


x86 assembly (clang, -O0):
<putstk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1030 <mnem_pop@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x1,%eax
jne    1155 <putstk+0x35>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
jmp    1163 <putstk+0x43>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstk>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <mnem_pop@plt>
cmp    $0x1,%bl
lea    0xecc(%rip),%rax
lea    0xed2(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <ol@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"MOV [BX],AL\00"
@.str.1 = [13 x i8] c"MOV [BX],AX\00"
define i32 @putstk(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 (...) @mnem_pop()
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"MOV [BX],AL\00"
@.str.1 = [13 x i8] c"MOV [BX],AX\00"
define i32 @putstk(i32 %0) {
%2 = tail call i32 (...) @mnem_pop()
%3 = and i32 %0, 255
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %5)
ret i32 undef
}
/* Variables and functions */
scalar_t__ alpha(char);
scalar_t__ numeric(char);
int alphanumeric(char c) { return ((alpha(c)) || (numeric(c))); }


x86 assembly (clang, -O0):
<alphanumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <alphanumeric+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <numeric@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphanumeric>:
push   %rbx
mov    %edi,%ebx
call   1040 <alpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <alphanumeric+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <numeric@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alphanumeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @alpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @numeric(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @alphanumeric(i8 signext %0) {
%2 = tail call i64 @alpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @numeric(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void f() {
  int a;
  int test15 = sizeof(struct { char qq[(_Bool)&a]; });
  ;
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
unsigned int leading_zeros(unsigned int code) {
  unsigned int count = 0;
  int done = 0;
  if (code) {
    while (!done) {
      code >>= 1;
      if (!code)
        done = 1;
      else
        count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<leading_zeros>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116c <leading_zeros+0x6c>
jmp    1124 <leading_zeros+0x24>
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <leading_zeros+0x3a>
jmp    1167 <leading_zeros+0x67>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1159 <leading_zeros+0x59>
movl   $0x1,-0xc(%rbp)
jmp    1162 <leading_zeros+0x62>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <leading_zeros+0x24>
jmp    116c <leading_zeros+0x6c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leading_zeros>:
test   %edi,%edi
je     112c <leading_zeros+0x2c>
mov    $0xffffffff,%ecx
nopl   0x0(%rax)
mov    %edi,%eax
shr    %edi
add    $0x1,%ecx
cmp    $0x1,%eax
ja     1110 <leading_zeros+0x10>
cmp    $0x2,%eax
mov    $0x1,%al
adc    $0x0,%al
movzbl %al,%eax
and    $0x1,%eax
add    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @leading_zeros(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = icmp ult i32 %5, 2
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = add i32 %4, %9
br i1 %7, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %12
}
int test_imm_D8uint32_mem(unsigned int *val) {
  return ((*val) & (0xD8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D8uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 216
%6 = icmp ne i32 %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_D8uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 216
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, unsigned long, char *,
                          unsigned long);
void _print_type_size(const char *name, size_t size) {
  printf(" * sizeof(%11s) = %2lu %s (%3lu bits)\n", name, (unsigned long)size,
         (size == 1) ? "byte " : "bytes", (unsigned long)size * 8);
}


x86 assembly (clang, -O0):
<_print_type_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rdi
lea    0xefa(%rip),%rcx
lea    0xeed(%rip),%rax
cmp    $0x1,%rdi
cmove  %rax,%rcx
mov    -0x10(%rbp),%r8
shl    $0x3,%r8
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_type_size>:
mov    %rsi,%rdx
mov    %rdi,%rsi
cmp    $0x1,%rdx
lea    0xf06(%rip),%rax
lea    0xf05(%rip),%rcx
cmove  %rax,%rcx
lea    0x0(,%rdx,8),%r8
lea    0xec5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c" * sizeof(%11s) = %2lu %s (%3lu bits)\0A\00"
@.str.1 = [6 x i8] c"byte \00"
@.str.2 = [6 x i8] c"bytes\00"
define void @_print_type_size(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 = load i64, i64* %4
%8 = icmp eq i64 %7, 1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%11 = load i64, i64* %4
%12 = mul i64 %11, 8
%13 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %6, i8* %10, i64 %12)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c" * sizeof(%11s) = %2lu %s (%3lu bits)\0A\00"
@.str.1 = [6 x i8] c"byte \00"
@.str.2 = [6 x i8] c"bytes\00"
define void @_print_type_size(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 1
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%5 = shl i64 %1, 3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1, i8* %4, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displaySumSmallest(int);
int /*<<< orphan*/ exampleHeader(int);
int main() {
  exampleHeader(5);
  displaySumSmallest(5);
  displaySumSmallest(3);
  displaySumSmallest(8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <exampleHeader@plt>
mov    $0x5,%edi
call   1030 <displaySumSmallest@plt>
mov    $0x3,%edi
call   1030 <displaySumSmallest@plt>
mov    $0x8,%edi
call   1030 <displaySumSmallest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <exampleHeader@plt>
mov    $0x5,%edi
call   1030 <displaySumSmallest@plt>
mov    $0x3,%edi
call   1030 <displaySumSmallest@plt>
mov    $0x8,%edi
call   1030 <displaySumSmallest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exampleHeader(i32 5)
%3 = call i32 @displaySumSmallest(i32 5)
%4 = call i32 @displaySumSmallest(i32 3)
%5 = call i32 @displaySumSmallest(i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exampleHeader(i32 5)
%2 = tail call i32 @displaySumSmallest(i32 5)
%3 = tail call i32 @displaySumSmallest(i32 3)
%4 = tail call i32 @displaySumSmallest(i32 8)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ lcdhal_deselect();
int /*<<< orphan*/ lcdhal_select();
int /*<<< orphan*/ lcdhal_write(int /*<<< orphan*/, int);
void lcd_setInvert(uint8_t c) {
  lcdhal_select();
  lcdhal_write(0, (c & 1) + 0xa6);
  lcdhal_deselect();
}


x86 assembly (clang, -O0):
<lcd_setInvert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <lcdhal_select@plt>
mov    -0x4(%rbp),%esi
and    $0x1,%esi
add    $0xa6,%esi
xor    %edi,%edi
call   1030 <lcdhal_write@plt>
mov    $0x0,%al
call   1040 <lcdhal_deselect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_setInvert>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <lcdhal_select@plt>
and    $0x1,%ebx
or     $0xa6,%ebx
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <lcdhal_write@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <lcdhal_deselect@plt>

LLVM IR (-O0):
define void @lcd_setInvert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @lcdhal_select()
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = add nsw i32 %5, 166
%7 = call i32 @lcdhal_write(i32 0, i32 %6)
%8 = call i32 (...) @lcdhal_deselect()
ret void
}

LLVM IR (-O2):
define void @lcd_setInvert(i32 %0) {
%2 = tail call i32 (...) @lcdhal_select()
%3 = and i32 %0, 1
%4 = or i32 %3, 166
%5 = tail call i32 @lcdhal_write(i32 0, i32 %4)
%6 = tail call i32 (...) @lcdhal_deselect()
ret void
}
void swap(int *elem1, int *elem2) {
  int temp;
  temp = *elem1;
  *elem1 = *elem2;
  *elem2 = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
double bino_d(int a, int b) {
  if (b == 0)
    return 1;
  return (bino_d(a, b - 1) * (a - b + 1)) / b;
}


x86 assembly (clang, -O0):
<bino_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113a <bino_d+0x2a>
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <bino_d+0x57>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1030 <bino_d@plt>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bino_d>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     1144 <bino_d+0x34>
mov    %esi,%ebx
mov    %edi,%ebp
lea    -0x1(%rbx),%esi
call   1030 <bino_d@plt>
movapd %xmm0,%xmm1
sub    %ebx,%ebp
add    $0x1,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
jmp    114c <bino_d+0x3c>
movsd  0xeb4(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @bino_d(i32 %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %23
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = call double @bino_d(i32 %10, i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = sub nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = sitofp i32 %17 to double
%19 = fmul double %13, %18
%20 = load i32, i32* %5
%21 = sitofp i32 %20 to double
%22 = fdiv double %19, %21
store double %22, double* %3
br label %23
23: ; preds = %9, %8
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @bino_d(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi double [ %14, %6 ], [ 1.000000e+00, %2 ]
ret double %5
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = tail call double @bino_d(i32 %0, i32 %7)
%9 = add i32 %0, 1
%10 = sub i32 %9, %1
%11 = sitofp i32 %10 to double
%12 = fmul double %8, %11
%13 = sitofp i32 %1 to double
%14 = fdiv double %12, %13
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int run_tests();
int main() {
  int result;
  printf("Running Example tests .. \n");
  result = run_tests();
  if (result == (0))
    printf("tests passed.\n");
  else
    printf("tests failed.\n");
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <run_tests@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1160 <main+0x40>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <main+0x4c>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <run_tests@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xee9(%rip),%rax
lea    0xed4(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Running Example tests .. \0A\00"
@.str.1 = [15 x i8] c"tests passed.\0A\00"
@.str.2 = [15 x i8] c"tests failed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @run_tests()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@str = [26 x i8] c"Running Example tests .. \00"
@str.3 = [14 x i8] c"tests failed.\00"
@str.4 = [14 x i8] c"tests passed.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @run_tests()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 %2
}