xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arr[12] = {1, 3, 5, 4, 7, 2, 99, 16, 45, 67, 89, 45};
  int counter;
  int sum = 0;
  for (counter = 0; counter < 12; counter++) {
    sum += arr[counter];
  }
  printf("Total is %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0xc,-0x44(%rbp)
jge    1178 <main+0x58>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1152 <main+0x32>
mov    -0x48(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [12 x i32] [i32 1, i32 3, i32 5, i32 4, i32 7, i32 2, i32 99, i32 16, i32 45, i32 67, i32 89, i32 45]
@.str = [13 x i8] c"Total is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [12 x i32]* %2 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 12
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Total is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 383)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_qsort_local(void *, size_t const, int /*<<< orphan*/,
                                       size_t const,
                                       int (*)(void const *, void const *),
                                       size_t);
void pthread_qsort(void *base, const size_t nel, const size_t width,
                   int (*compare)(const void *, const void *),
                   const size_t num_threads) {
  int switch_size;
  switch_size = nel / num_threads;
  pthread_qsort_local(base, width, 0, (nel - 1), compare, (size_t)switch_size);
  return;
}


x86 assembly (clang, -O0):
<pthread_qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x28(%rbp)
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
mov    -0x20(%rbp),%r8
movslq -0x2c(%rbp),%r9
xor    %edx,%edx
call   1030 <pthread_qsort_local@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_qsort>:
mov    %rcx,%r10
mov    %rdx,%r11
mov    %rsi,%rcx
mov    %rsi,%rax
or     %r8,%rax
shr    $0x20,%rax
je     112f <pthread_qsort+0x1f>
mov    %rcx,%rax
xor    %edx,%edx
div    %r8
jmp    1136 <pthread_qsort+0x26>
mov    %ecx,%eax
xor    %edx,%edx
div    %r8d
add    $0xffffffffffffffff,%rcx
movslq %eax,%r9
mov    %r11,%rsi
xor    %edx,%edx
mov    %r10,%r8
jmp    1030 <pthread_qsort_local@plt>

LLVM IR (-O0):
define void @pthread_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32 (i8*, i8*)*
%10 = alloca i64
%11 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %9
store i64 %4, i64* %10
%12 = load i64, i64* %7
%13 = load i64, i64* %10
%14 = udiv i64 %12, %13
%15 = trunc i64 %14 to i32
store i32 %15, i32* %11
%16 = load i8*, i8** %6
%17 = load i64, i64* %8
%18 = load i64, i64* %7
%19 = sub i64 %18, 1
%20 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %9
%21 = load i32, i32* %11
%22 = sext i32 %21 to i64
%23 = call i32 @pthread_qsort_local(i8* %16, i64 %17, i32 0, i64 %19, i32 (i8*, i8*)* %20, i64 %22)
ret void
}

LLVM IR (-O2):
define void @pthread_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3, i64 %4) {
%6 = udiv i64 %1, %4
%7 = add i64 %1, -1
%8 = shl i64 %6, 32
%9 = ashr exact i64 %8, 32
%10 = tail call i32 @pthread_qsort_local(i8* %0, i64 %2, i32 0, i64 %7, i32 (i8*, i8*)* %3, i64 %9)
ret void
}
void sample(void) {
  typedef short sht;
  typedef short td_z;
}


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

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

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

LLVM IR (-O2):
define void @sample() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
unsigned int _p11_hash_ulongptr_hash(const void *to_ulong) {
  assert(to_ulong);
  return (unsigned int)*((unsigned long *)to_ulong);
}


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

x86 assembly (clang, -O2):
<_p11_hash_ulongptr_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_p11_hash_ulongptr_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_p11_hash_ulongptr_hash(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
int test_imm_CFint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xCF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CFint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13565952
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int is_alpha(char c) {
  int result = 0;
  int i = (int)c;
  if ((i >= 65 && i <= 90) || (i >= 97 && i <= 122)) {
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41,-0xc(%rbp)
jl     112c <is_alpha+0x2c>
cmpl   $0x5a,-0xc(%rbp)
jle    1140 <is_alpha+0x40>
cmpl   $0x61,-0xc(%rbp)
jl     1149 <is_alpha+0x49>
cmpl   $0x7a,-0xc(%rbp)
jg     1149 <is_alpha+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 90
br i1 %11, label %18, label %12
12: ; preds = %9, %1
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp sle i32 %16, 122
br i1 %17, label %18, label %21
18: ; preds = %15, %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %15, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
long int beef_maximum(long int x, long int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<beef_maximum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <beef_maximum+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <beef_maximum+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<beef_maximum>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @beef_maximum(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
float *malloc(int);
float *six(const int *x) {
  float *tmp = malloc(sizeof(float));
  *tmp = (float)*x;
  float *p = tmp;
  return p;
}


x86 assembly (clang, -O0):
<six>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<six>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
cvtsi2ssl (%rbx),%xmm0
movss  %xmm0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define float* @six(i32* %0) {
%2 = alloca i32*
%3 = alloca float*
%4 = alloca float*
store i32* %0, i32** %2
%5 = call float* @malloc(i32 4)
store float* %5, float** %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to float
%9 = load float*, float** %3
store float %8, float* %9
%10 = load float*, float** %3
store float* %10, float** %4
%11 = load float*, float** %4
ret float* %11
}

LLVM IR (-O2):
define noalias float* @six(i32* nocapture %0) {
%2 = tail call float* @malloc(i32 4)
%3 = load i32, i32* %0
%4 = sitofp i32 %3 to float
store float %4, float* %2
ret float* %2
}
/* Type definitions */
typedef char square;

/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_square(int square) {
  putchar(('a' + (((square) >> 3))));
  putchar(('1' + (((square)&7))));
}


x86 assembly (clang, -O0):
<print_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
add    $0x61,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
and    $0x7,%eax
add    $0x31,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_square>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x3,%eax
add    $0x61,%al
movsbl %al,%edi
call   1030 <putchar@plt>
and    $0x7,%bl
add    $0x31,%bl
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @print_square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = add nsw i32 97, %4
%6 = trunc i32 %5 to i8
%7 = call i32 @putchar(i8 signext %6)
%8 = load i32, i32* %2
%9 = and i32 %8, 7
%10 = add nsw i32 49, %9
%11 = trunc i32 %10 to i8
%12 = call i32 @putchar(i8 signext %11)
ret void
}

LLVM IR (-O2):
define void @print_square(i32 %0) {
%2 = lshr i32 %0, 3
%3 = trunc i32 %2 to i8
%4 = add i8 %3, 97
%5 = tail call i32 @putchar(i8 signext %4)
%6 = trunc i32 %0 to i8
%7 = and i8 %6, 7
%8 = add nuw nsw i8 %7, 49
%9 = tail call i32 @putchar(i8 signext %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          size_t);
void mangle_Overwrite(uint8_t *dst, const uint8_t *src, size_t dstSz,
                      size_t off, size_t sz) {
  size_t maxToCopy = dstSz - off;
  if (sz > maxToCopy) {
    sz = maxToCopy;
  }
  memcpy(&dst[off], src, sz);
}


x86 assembly (clang, -O0):
<mangle_Overwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jbe    114e <mangle_Overwrite+0x3e>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mangle_Overwrite>:
sub    %rcx,%rdx
cmp    %r8,%rdx
cmovae %r8,%rdx
lea    (%rdi,%rcx,4),%rdi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @mangle_Overwrite(i32* %0, i32* %1, i64 %2, i64 %3, i64 %4) {
%6 = sub i64 %2, %3
%7 = icmp ult i64 %6, %4
%8 = select i1 %7, i64 %6, i64 %4
%9 = getelementptr inbounds i32, i32* %0, i64 %3
%10 = tail call i32 @memcpy(i32* %9, i32* %1, i64 %8)
ret void
}
const char *func_str() {
  return "x"
         " "
         "*"
         " "
         "x";
}


x86 assembly (clang, -O0):
<func_str>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"x * x\00"
define i8* @func_str() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"x * x\00"
define i8* @func_str() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
const char *WavpackGetLibraryVersionString(void) { return "4.70.0"; }


x86 assembly (clang, -O0):
<WavpackGetLibraryVersionString>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WavpackGetLibraryVersionString>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"4.70.0\00"
define i8* @WavpackGetLibraryVersionString() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"4.70.0\00"
define i8* @WavpackGetLibraryVersionString() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_random_system(int n, int m, int d, int c) {
  int b[3], fail;
  double *tmp;
  b[0] = m;
  b[1] = d;
  b[2] = c;
  fail = _ada_use_c2phc(109, &n, b, tmp);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_random_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x6d,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_random_system>:
sub    $0x18,%rsp
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0x14(%rsp)
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x6d,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_random_system(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [3 x i32]
%10 = alloca i32
%11 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %6
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %7
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %8
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%19 = load double*, double** %11
%20 = call i32 @_ada_use_c2phc(i32 109, i32* %5, i32* %18, double* %19)
store i32 %20, i32* %10
%21 = load i32, i32* %10
ret i32 %21
}

LLVM IR (-O2):
define i32 @syscon_random_system(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca [3 x i32]
store i32 %0, i32* %5
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %2, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %3, i32* %10
%11 = call i32 @_ada_use_c2phc(i32 109, i32* %5, i32* %8, double* undef)
ret i32 %11
}
/* Variables and functions */
char *floatToBinary(float);
int /*<<< orphan*/ floatToChar1(char *);
int main() {
  float test = .5;
  char *bits = floatToBinary(test);
  floatToChar1(bits);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <floatToBinary@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <floatToChar1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1030 <floatToBinary@plt>
mov    %rax,%rdi
call   1040 <floatToChar1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i8*
store i32 0, i32* %1
store float 5.000000e-01, float* %2
%4 = load float, float* %2
%5 = call i8* @floatToBinary(float %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @floatToChar1(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @floatToBinary(float 5.000000e-01)
%2 = tail call i32 @floatToChar1(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_chr(char);
void print_hex(unsigned int val, int digits) {
  for (int i = (4 * digits) - 4; i >= 0; i -= 4)
    print_chr("0123456789ABCDEF"[(val >> i) % 16]);
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1161 <print_hex+0x51>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xeb6(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <print_chr@plt>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <print_hex+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114c <print_hex+0x3c>
mov    %edi,%ebp
lea    0x4(,%rsi,4),%ebx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
lea    -0x8(%rbx),%ecx
mov    %ebp,%eax
shr    %cl,%eax
and    $0xf,%eax
movsbl (%rax,%r14,1),%edi
call   1030 <print_chr@plt>
add    $0xfffffffc,%ebx
cmp    $0x7,%ebx
jg     1130 <print_hex+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define void @print_hex(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* %4
%7 = mul nsw i32 4, %6
%8 = sub nsw i32 %7, 4
store i32 %8, i32* %5
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = lshr i32 %13, %14
%16 = urem i32 %15, 16
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = call i32 @print_chr(i8 signext %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 4
store i32 %23, i32* %5
br label %9
24: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define void @print_hex(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = shl nsw i32 %1, 2
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %9, %7 ], [ %5, %4 ]
%9 = add nsw i32 %8, -4
%10 = lshr i32 %0, %9
%11 = and i32 %10, 15
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = tail call i32 @print_chr(i8 signext %14)
%16 = icmp sgt i32 %8, 7
br i1 %16, label %7, label %6
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int isdelim(char c) {
  if (strchr(" !;,+-<>'/*%^=()", c) || c == 9 || c == '\r' || c == '\n' ||
      c == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    116c <isdelim+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     116c <isdelim+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     116c <isdelim+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     116c <isdelim+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1178 <isdelim+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <isdelim+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdelim>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1130 <isdelim+0x20>
pop    %rbx
ret
cmp    $0xd,%bl
ja     1143 <isdelim+0x33>
movzbl %bl,%ecx
mov    $0x2601,%edx
bt     %rcx,%rdx
jb     112e <isdelim+0x1e>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c" !;,+-<>'/*%^=()\00"
define i32 @isdelim(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 13
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 10
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@.str = [17 x i8] c" !;,+-<>'/*%^=()\00"
define i32 @isdelim(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
switch i8 %0, label %6 [
i8 13, label %7
i8 10, label %7
i8 9, label %7
i8 0, label %7
]
6: ; preds = %5
br label %7
7: ; preds = %1, %5, %5, %5, %5, %6
%8 = phi i32 [ 0, %6 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %1 ]
ret i32 %8
}
int d_bgt_rc2(double a1) { return !(__builtin_isgreater(a1, 100)); }


x86 assembly (clang, -O0):
<d_bgt_rc2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bgt_rc2>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_bgt_rc2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_bgt_rc2(double %0) {
%2 = fcmp ule double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void PrintVec(int size, int *vec) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", vec[i]);
}


x86 assembly (clang, -O0):
<PrintVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1157 <PrintVec+0x47>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <PrintVec+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintVec>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <PrintVec+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <PrintVec+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @PrintVec(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
char *test_sprintf(char *name, int messageCount) {
  char *x = malloc(100);
  sprintf(x, "Hello %s, you have %d messages", name, messageCount);
  return x;
}


x86 assembly (clang, -O0):
<test_sprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeb1(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sprintf>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,%rbp
lea    0xec2(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1040 <sprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Hello %s, you have %d messages\00"
define i8* @test_sprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* @malloc(i32 100)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
@.str = [31 x i8] c"Hello %s, you have %d messages\00"
define noalias i8* @test_sprintf(i8* %0, i32 %1) {
%3 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i8* %3
}
float getLength(float inches, int feets) { return inches + (float)feets * 12; }


x86 assembly (clang, -O0):
<getLength>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xee2(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLength>:
cvtsi2ss %edi,%xmm1
mulss  0xef4(%rip),%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @getLength(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = call float @llvm.fmuladd.f32(float %7, float 1.200000e+01, float %5)
ret float %8
}

LLVM IR (-O2):
define float @getLength(float %0, i32 %1) {
%3 = sitofp i32 %1 to float
%4 = tail call float @llvm.fmuladd.f32(float %3, float 1.200000e+01, float %0)
ret float %4
}
unsigned parse_boolean(const char *value) {
  switch (value[0]) {
  case '1':
  case 'y':
  case 'Y':
  case 'e':
  case 'E':
  case 't':
  case 'T':
    return 1;
  case 'o':
  case 'O':
    if (value[1] == 'n' || value[1] == 'N')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_boolean>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x48,%eax
ja     1174 <parse_boolean+0x74>
mov    -0x18(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    117b <parse_boolean+0x7b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6e,%eax
je     1163 <parse_boolean+0x63>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x4e,%eax
jne    116f <parse_boolean+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    117b <parse_boolean+0x7b>
jmp    1174 <parse_boolean+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_boolean>:
movsbl (%rdi),%ecx
add    $0xffffffcf,%ecx
cmp    $0x48,%ecx
ja     1130 <parse_boolean+0x30>
mov    $0x1,%eax
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
mov    0x1(%rdi),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x4e,%cl
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @parse_boolean(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %23 [
i32 49, label %8
i32 121, label %8
i32 89, label %8
i32 101, label %8
i32 69, label %8
i32 116, label %8
i32 84, label %8
i32 111, label %9
i32 79, label %9
]
8: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %24
9: ; preds = %1, %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 110
br i1 %14, label %21, label %15
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 78
br i1 %20, label %21, label %22
21: ; preds = %15, %9
store i32 1, i32* %2
br label %24
22: ; preds = %15
br label %23
23: ; preds = %22, %1
store i32 0, i32* %2
br label %24
24: ; preds = %23, %21, %8
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @parse_boolean(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %10 [
i32 49, label %11
i32 121, label %11
i32 89, label %11
i32 101, label %11
i32 69, label %11
i32 116, label %11
i32 84, label %11
i32 111, label %4
i32 79, label %4
]
4: ; preds = %1, %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = and i8 %6, -33
%8 = icmp eq i8 %7, 78
%9 = zext i1 %8 to i32
br label %11
10: ; preds = %1
br label %11
11: ; preds = %4, %1, %1, %1, %1, %1, %1, %1, %10
%12 = phi i32 [ 0, %10 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ %9, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double flerp(double v0, double v1, double t) {
  printf("Call function "
         "flerp"
         ": ");
  return (1 - t) * v0 + t * v1;
}


x86 assembly (clang, -O0):
<flerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec5(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flerp>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec7(%rip),%xmm0
movsd  (%rsp),%xmm2
subsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm2,%xmm1
mulsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Call function flerp: \00"
define double @flerp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = load double, double* %6
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %4
%11 = load double, double* %6
%12 = load double, double* %5
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
ret double %14
}

LLVM IR (-O2):
@.str = [22 x i8] c"Call function flerp: \00"
define double @flerp(double %0, double %1, double %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = fsub double 1.000000e+00, %2
%6 = fmul double %1, %2
%7 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT6_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT6_IRQHandler(void) {
  GPIO1_INT6_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO1_INT6_IRQHandler() {
%1 = call i32 (...) @GPIO1_INT6_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO1_INT6_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT6_DriverIRQHandler()
ret void
}
int is_adjacent_mob() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @is_adjacent_mob() {
ret i32 1
}
__attribute__((always_)) int brotli_max_int(int a, int b) {
  return a > b ? a : b;
}


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

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

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

LLVM IR (-O2):
define i32 @brotli_max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sm_port_config();
void sm_init() { sm_port_config(); }


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

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

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

LLVM IR (-O2):
define void @sm_init() {
%1 = tail call i32 (...) @sm_port_config()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void uint16Copy(uint16_t *dst, const uint16_t *src) {
  assert(dst != NULL);
  assert(src != NULL);
  *dst = *src;
}


x86 assembly (clang, -O0):
<uint16Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16Copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @uint16Copy(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 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @uint16Copy(i32* writeonly %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %0
ret void
}
int main() {
  int x;
  if (x > 1 && x < 10) {
    x = 1;
  } else {
    x = 3;
  }
  int y;
  if (y > 1) {
    if (y < 10) {
      y = 1;
    } else {
      y = 3;
    }
  } else {
    y = 3;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    112b <main+0x2b>
cmpl   $0xa,-0x8(%rbp)
jge    112b <main+0x2b>
movl   $0x1,-0x8(%rbp)
jmp    1132 <main+0x32>
movl   $0x3,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    115e <main+0x5e>
cmpl   $0xa,-0xc(%rbp)
jge    1152 <main+0x52>
movl   $0x1,-0xc(%rbp)
jmp    1159 <main+0x59>
movl   $0x3,-0xc(%rbp)
jmp    1165 <main+0x65>
movl   $0x3,-0xc(%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
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %0
store i32 3, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %3
br label %19
18: ; preds = %14
store i32 3, i32* %3
br label %19
19: ; preds = %18, %17
br label %21
20: ; preds = %11
store i32 3, i32* %3
br label %21
21: ; preds = %20, %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int);
long strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  long d1 = 0;
  d1 = strtol("-012", NULL, 10);
  if (errno == 0) {
    printf("d1=%ld\n", d1);
  } else {
    printf("errno=%d\n", errno);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xebb(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e82(%rip),%rax
cmpl   $0x0,(%rax)
jne    117e <main+0x5e>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    1193 <main+0x73>
mov    0x2e5b(%rip),%rax
mov    (%rax),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
test   %esi,%esi
je     1127 <main+0x17>
lea    0xee3(%rip),%rdi
jmp    1133 <main+0x23>
lea    0xed2(%rip),%rdi
mov    $0xfffffff4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"-012\00"
@errno = global i32 0
@.str.1 = [8 x i8] c"d1=%ld\0A\00"
@.str.2 = [10 x i8] c"errno=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%7 = call i64 @strtol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* null, i32 10)
store i64 %7, i64* %6
%8 = load i32, i32* @errno
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %17
14: ; preds = %2
%15 = load i32, i32* @errno
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
@.str.1 = [8 x i8] c"d1=%ld\0A\00"
@.str.2 = [10 x i8] c"errno=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @errno
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 -12)
br label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %3)
br label %9
9: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *toolname) {
  fprintf(stderr, "usage: %s", toolname);
  fprintf(stderr, " --file=<rom_file>"
                  " [--devid=<device_id>]"
                  " [--panel-type=<panel_type>]"
                  " [--all-panels]"
                  " [--hexdump]"
                  " [--block=<block_no>]"
                  " [--help]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed6(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"usage: %s\00"
@.str.1 = [127 x i8] c" --file=<rom_file> [--devid=<device_id>] [--panel-type=<panel_type>] [--all-panels] [--hexdump] [--block=<block_no>] [--help]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"usage: %s\00"
@.str.1 = [127 x i8] c" --file=<rom_file> [--devid=<device_id>] [--panel-type=<panel_type>] [--all-panels] [--hexdump] [--block=<block_no>] [--help]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str.1, i64 0, i64 0))
ret void
}