xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ addToTree(char *);
int /*<<< orphan*/ dequeueList();
int /*<<< orphan*/ peekList();
int /*<<< orphan*/ reportError(char);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int lPare() {
  if (strcmp(peekList(), "(") != 0) {
    reportError('(');
    return 0;
  }
  dequeueList();
  addToTree("(");
  return 1;
}


x86 assembly (clang, -O0):
<lPare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <peekList@plt>
mov    %eax,%edi
lea    0xe98(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     118d <lPare+0x3d>
mov    $0x28,%edi
call   1030 <reportError@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <lPare+0x57>
mov    $0x0,%al
call   1070 <dequeueList@plt>
lea    0xe65(%rip),%rdi
call   1050 <addToTree@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lPare>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <peekList@plt>
lea    0xe9f(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1179 <lPare+0x29>
mov    $0x28,%edi
call   1030 <reportError@plt>
jmp    1191 <lPare+0x41>
xor    %eax,%eax
call   1070 <dequeueList@plt>
lea    0xe79(%rip),%rdi
call   1050 <addToTree@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
define i32 @lPare() {
%1 = alloca i32
%2 = call i32 (...) @peekList()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @reportError(i8 signext 40)
store i32 0, i32* %1
br label %10
7: ; preds = %0
%8 = call i32 (...) @dequeueList()
%9 = call i32 @addToTree(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
define i32 @lPare() {
%1 = tail call i32 (...) @peekList()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @reportError(i8 signext 40)
br label %9
6: ; preds = %0
%7 = tail call i32 (...) @dequeueList()
%8 = tail call i32 @addToTree(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %10
}
/* Variables and functions */
void *__wrap_malloc(size_t);
int /*<<< orphan*/ bzero(void *, size_t);
void *__wrap_calloc(size_t nmemb, size_t size) {
  size_t t = nmemb * size;
  void *p = __wrap_malloc(t);
  if (p)
    bzero(p, t);
  return p;
}


x86 assembly (clang, -O0):
<__wrap_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <__wrap_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1162 <__wrap_calloc+0x42>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <bzero@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <__wrap_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1146 <__wrap_calloc+0x26>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <bzero@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @__wrap_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @__wrap_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @bzero(i8* %4, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ __crow_f6(int, int);
int expect(int, int /*<<< orphan*/);
int test_f6() { return expect(9, __crow_f6(4, 6)); }


x86 assembly (clang, -O0):
<test_f6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x6,%esi
call   1030 <__crow_f6@plt>
mov    %eax,%esi
mov    $0x9,%edi
call   1040 <expect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_f6>:
push   %rax
mov    $0x4,%edi
mov    $0x6,%esi
call   1030 <__crow_f6@plt>
mov    $0x9,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <expect@plt>

LLVM IR (-O0):
define i32 @test_f6() {
%1 = call i32 @__crow_f6(i32 4, i32 6)
%2 = call i32 @expect(i32 9, i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_f6() {
%1 = tail call i32 @__crow_f6(i32 4, i32 6)
%2 = tail call i32 @expect(i32 9, i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpd_ps(int /*<<< orphan*/);
__m128 test_mm_cvtpd_ps(__m128d A) { return _mm_cvtpd_ps(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtpd_ps>:
jmp    1030 <_mm_cvtpd_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtpd_ps(i32 %0) {
%2 = tail call i32 @_mm_cvtpd_ps(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ draw_pixel(int, int, short);
void clear_screen(short color) {
  for (int x = 0; x < 320; x++) {
    for (int y = 0; y < 240; y++) {
      draw_pixel(x, y, color);
    }
  }
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x140,-0x8(%rbp)
jge    1177 <clear_screen+0x67>
movl   $0x0,-0xc(%rbp)
cmpl   $0xf0,-0xc(%rbp)
jge    1164 <clear_screen+0x54>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
movswl -0x2(%rbp),%edx
call   1030 <draw_pixel@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <clear_screen+0x2a>
jmp    1169 <clear_screen+0x59>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <clear_screen+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
movswl %di,%r14d
nopw   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <draw_pixel@plt>
add    $0x1,%ebp
cmp    $0xf0,%ebp
jne    1130 <clear_screen+0x20>
add    $0x1,%ebx
cmp    $0x140,%ebx
jne    1120 <clear_screen+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @clear_screen(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
store i16 %0, i16* %2
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 320
br i1 %7, label %8, label %24
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %17, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 240
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i16, i16* %2
%16 = call i32 @draw_pixel(i32 %13, i32 %14, i16 signext %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %9
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @clear_screen(i16 signext %0) {
br label %2
2: ; preds = %1, %5
%3 = phi i32 [ 0, %1 ], [ %6, %5 ]
br label %8
4: ; preds = %5
ret void
5: ; preds = %8
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 320
br i1 %7, label %4, label %2
8: ; preds = %2, %8
%9 = phi i32 [ 0, %2 ], [ %11, %8 ]
%10 = tail call i32 @draw_pixel(i32 %3, i32 %9, i16 signext %0)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, 240
br i1 %12, label %5, label %8
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
ssize_t increment(ssize_t value, ssize_t direction, ssize_t max) {
  value += direction;
  if (value >= max)
    value = 0;
  else if (value < 0)
    value = max - 1;
  return value;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1137 <increment+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1153 <increment+0x53>
cmpq   $0x0,-0x8(%rbp)
jge    114e <increment+0x4e>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <increment+0x53>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
add    %rsi,%rdi
lea    -0x1(%rdx),%rcx
test   %rdi,%rdi
cmovns %rdi,%rcx
xor    %eax,%eax
cmp    %rdx,%rdi
cmovl  %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @increment(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %1, %0
%5 = icmp slt i64 %4, %2
%6 = icmp slt i64 %4, 0
%7 = add nsw i64 %2, -1
%8 = select i1 %6, i64 %7, i64 %4
%9 = select i1 %5, i64 %8, i64 0
ret i64 %9
}
int add15(int arg3) { return 5 + arg3 + 10; }


x86 assembly (clang, -O0):
<add15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add15>:
lea    0xf(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @add15(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 5, %3
%5 = add nsw i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @add15(i32 %0) {
%2 = add nsw i32 %0, 15
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void caml_ml_array_bound_error(void) {
  fprintf(stderr, "Fatal error: out-of-bound access in array or string\n");
  exit(2);
}


x86 assembly (clang, -O0):
<caml_ml_array_bound_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<caml_ml_array_bound_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Fatal error: out-of-bound access in array or string\0A\00"
define void @caml_ml_array_bound_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Fatal error: out-of-bound access in array or string\0A\00"
define void @caml_ml_array_bound_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
unsigned align_size(const unsigned num_bytes, const unsigned align) {
  if (num_bytes % align != 0)
    return num_bytes + (align - (num_bytes % align));
  else
    return num_bytes;
}


x86 assembly (clang, -O0):
<align_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
je     113b <align_size+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <align_size+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_size>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%esi
test   %edx,%edx
cmove  %edx,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @align_size(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = sub i32 %1, %3
%6 = select i1 %4, i32 0, i32 %5
%7 = add i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int bestEstimateOfStDev(float *, int);
double StandardErrorOfStDev(float *data, int n) {
  return (double)(bestEstimateOfStDev(data, n) / ((2 * n) * (2 * n)));
}


x86 assembly (clang, -O0):
<StandardErrorOfStDev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bestEstimateOfStDev@plt>
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
imul   %edx,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StandardErrorOfStDev>:
push   %rbx
mov    %esi,%ebx
call   1030 <bestEstimateOfStDev@plt>
add    %ebx,%ebx
imul   %ebx,%ebx
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StandardErrorOfStDev(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 = call i32 @bestEstimateOfStDev(float* %5, i32 %6)
%8 = load i32, i32* %4
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 2, %10
%12 = mul nsw i32 %9, %11
%13 = sdiv i32 %7, %12
%14 = sitofp i32 %13 to double
ret double %14
}

LLVM IR (-O2):
define double @StandardErrorOfStDev(float* %0, i32 %1) {
%3 = tail call i32 @bestEstimateOfStDev(float* %0, i32 %1)
%4 = shl nsw i32 %1, 1
%5 = mul nsw i32 %4, %4
%6 = sdiv i32 %3, %5
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
char **readTreesRange(char const *, int *, int /*<<< orphan*/,
                      int /*<<< orphan*/);
char **readTrees(const char *infile, int *trees_count) {
  return readTreesRange(infile, trees_count, 0, INT_MAX);
}


x86 assembly (clang, -O0):
<readTrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
call   1030 <readTreesRange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readTrees>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
jmp    1030 <readTreesRange@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i8** @readTrees(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* @INT_MAX
%8 = call i8** @readTreesRange(i8* %5, i32* %6, i32 0, i32 %7)
ret i8** %8
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i8** @readTrees(i8* %0, i32* %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i8** @readTreesRange(i8* %0, i32* %1, i32 0, i32 %3)
ret i8** %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  char a[7] = {'0', '1', '3', '4', '6', '9'};
  printf(a);
  int min, mid, max;
  min = 0;
  max = 7;
  mid = (min + max) / 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x7,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x393634,0x3(%rsp)
movl   $0x34333130,(%rsp)
mov    %rsp,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [7 x i8] c"013469\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [7 x i8]* %2 to i8*
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* %7)
store i32 0, i32* %3
store i32 7, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = sdiv i32 %11, 2
store i32 %12, i32* %4
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i8] c"013469\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* %2)
ret i32 0
}
int isupper(int c) { return (c >= 0x41 && c <= 0x5A) ? 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 */
scalar_t__ isspace(char);
char *nonsp(char *p) {
  while (*p && isspace(*p))
    p++;
  return p;
}


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

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

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

LLVM IR (-O2):
define i8* @nonsp(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fprintf(stderr, "%s: file\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"%s: file\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 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"%s: file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ unaligned_write_be32(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
void unaligned_write_be64(void *_u, uint64_t a) {
  uint8_t *u = _u;
  unaligned_write_be32(u, (uint32_t)(a >> 32));
  unaligned_write_be32(u + 4, (uint32_t)a);
}


x86 assembly (clang, -O0):
<unaligned_write_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <unaligned_write_be32@plt>
mov    -0x18(%rbp),%rdi
add    $0x10,%rdi
mov    -0xc(%rbp),%esi
call   1030 <unaligned_write_be32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaligned_write_be64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <unaligned_write_be32@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <unaligned_write_be32@plt>

LLVM IR (-O0):
define void @unaligned_write_be64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = ashr i32 %9, 32
%11 = call i32 @unaligned_write_be32(i32* %8, i32 %10)
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %4
%15 = call i32 @unaligned_write_be32(i32* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @unaligned_write_be64(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @unaligned_write_be32(i32* %3, i32 poison)
%5 = getelementptr inbounds i8, i8* %0, i64 16
%6 = bitcast i8* %5 to i32*
%7 = tail call i32 @unaligned_write_be32(i32* %6, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strncpyy(char *, char *, int);
int main(void) {
  char s1[] = "This is a string";
  char s2[1000];
  int n = 10;
  strncpyy(s2, s1, n);
  printf("%s\n", s2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x10(%rbp)
movl   $0xa,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    -0x414(%rbp),%edx
call   1040 <strncpyy@plt>
lea    -0x410(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <strncpyy@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [17 x i8] c"This is a string\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [1000 x i8]
%3 = alloca i32
%4 = bitcast [17 x i8]* %1 to i8*
store i32 10, i32* %3
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @strncpyy(i8* %5, i8* %6, i32 %7)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [17 x i8] c"This is a string\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @strncpyy(i8* %4, i8* %3, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage(void) {
  printf("\n");
  printf("Usage:\n");
  printf("script.exe script file path para file path\n\n");
}


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

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [45 x i8] c"script.exe script file path para file path\0A\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.3 = [44 x i8] c"script.exe script file path para file path\0A\00"
define void @Usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ SIGABRT;
scalar_t__ WIFSIGNALED(int);
scalar_t__ WTERMSIG(int);
int failed(int s) { return WIFSIGNALED(s) && (WTERMSIG(s) == SIGABRT); }


x86 assembly (clang, -O0):
<failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <WIFSIGNALED@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     115d <failed+0x3d>
mov    -0x4(%rbp),%edi
call   1040 <WTERMSIG@plt>
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<failed>:
push   %rbx
mov    %edi,%ebx
call   1030 <WIFSIGNALED@plt>
test   %rax,%rax
je     1148 <failed+0x28>
mov    %ebx,%edi
call   1040 <WTERMSIG@plt>
mov    %rax,%rcx
mov    0x2ea2(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SIGABRT = global i64 0
define i32 @failed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @WIFSIGNALED(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @WTERMSIG(i32 %7)
%9 = load i64, i64* @SIGABRT
%10 = icmp eq i64 %8, %9
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@SIGABRT = global i64 0
define i32 @failed(i32 %0) {
%2 = tail call i64 @WIFSIGNALED(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @WTERMSIG(i32 %0)
%6 = load i64, i64* @SIGABRT
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int OSDEP_GetTicks();
scalar_t__ clock();
signed int get_ticks(void) {
  return OSDEP_GetTicks();
  return (unsigned int)clock();
}


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

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

LLVM IR (-O0):
define i32 @get_ticks() {
%1 = call i32 (...) @OSDEP_GetTicks()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_ticks() {
%1 = tail call i32 (...) @OSDEP_GetTicks()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ xml_read();
void hiketech_read(void) { xml_read(); }


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

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

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

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

/* Variables and functions */
uint32_t get_lo(const uint64_t x) { return (uint32_t)x; }


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

x86 assembly (clang, -O2):
<get_lo>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_lo(i32 returned %0) {
ret i32 %0
}
f(signed long long int x) { return x > 0xFFFFFFFFLL || x < -0x80000000LL; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
mov    $0xffffffff,%ecx
cmp    %rcx,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jg     112a <f+0x2a>
cmpq   $0xffffffff80000000,-0x8(%rbp)
80
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movabs $0xffffffff00000000,%rcx
ff ff ff
add    %rdi,%rcx
movabs $0xfffffffe80000000,%rdx
ff ff ff
xor    %eax,%eax
cmp    %rdx,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 4294967295
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp slt i64 %6, -2147483648
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = add i64 %0, -4294967296
%3 = icmp ult i64 %2, -6442450944
%4 = zext i1 %3 to i32
ret i32 %4
}
int soru_6(int dizi[], int N, int aranan) { return -1; }


x86 assembly (clang, -O0):
<soru_6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @soru_6(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @soru_6(i32* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ test();
int main() {
  test();
  system("pause");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test@plt>
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_it;
X509_NAME *X509_NAME_new(void) {
  return (X509_NAME *)ASN1_item_new(&X509_NAME_it);
}


x86 assembly (clang, -O0):
<X509_NAME_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_NAME_new>:
mov    0x2ed1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@X509_NAME_it = global i32 0
define i32* @X509_NAME_new() {
%1 = call i64 @ASN1_item_new(i32* @X509_NAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@X509_NAME_it = global i32 0
define i32* @X509_NAME_new() {
%1 = tail call i64 @ASN1_item_new(i32* @X509_NAME_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int RAND_MAX;
int rand();
int randint(int a, int b) {
  return a + rand() / (RAND_MAX / ((b - a) + 1) + 1);
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %eax,%esi
add    $0x1,%esi
mov    %ecx,%eax
cltd
idiv   %esi
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @randint(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 = call i32 (...) @rand()
%7 = load i32, i32* @RAND_MAX
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sdiv i32 %7, %11
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %6, %13
%15 = add nsw i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = sdiv i32 %4, %6
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %3, %8
%10 = add nsw i32 %9, %0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *xmalloc(size_t);
char *xstrdup(const char *s) {
  size_t len = strlen(s);
  char *a = xmalloc(len + 1);
  strcpy(a, s);
  return a;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @xmalloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, char const *);
void error(int code, const char *message) {
  printf("Status: %1$d %2$s\r\n"
         "Content-Type: text/javascript\r\n"
         "\r\n",
         code, message);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Status: %1$d %2$s\0D\0AContent-Type: text/javascript\0D\0A\0D\0A\00"
@EXIT_SUCCESS = global i32 0
define void @error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"Status: %1$d %2$s\0D\0AContent-Type: text/javascript\0D\0A\0D\0A\00"
@EXIT_SUCCESS = global i32 0
define void @error(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int test_imm_09int64_midword_reg(long long val) {
  return ((val >> 16) & (0x09 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_09int64_midword_reg>:
test   $0x90000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09int64_midword_reg(i64 %0) {
%2 = and i64 %0, 589824
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void wx11rl() {}


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

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

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

LLVM IR (-O2):
define void @wx11rl() {
ret void
}
/* Variables and functions */
int strlen(char *);
void removeNewLine(char *s) {
  if (strlen(s) > 0 && s[strlen(s) - 1] == '\n') {
    s[strlen(s) - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<removeNewLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jle    1179 <removeNewLine+0x69>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1179 <removeNewLine+0x69>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeNewLine>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    113d <removeNewLine+0x2d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    113d <removeNewLine+0x2d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @removeNewLine(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = tail call i32 @strlen(i8* %0)
%13 = add nsw i32 %12, -1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %11, %4, %1
ret void
}
int get_bonus(int stat) { return (stat - 10) / 2; }


x86 assembly (clang, -O0):
<get_bonus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bonus>:
mov    %edi,%eax
add    $0xfffffff6,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xfffffff6,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @get_bonus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 10
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_bonus(i32 %0) {
%2 = add nsw i32 %0, -10
%3 = sdiv i32 %2, 2
ret i32 %3
}
void bdecode_8(b, p) void *b;
void *p;
{ bcopy(b, p, 8); }


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

x86 assembly (clang, -O2):
<bdecode_8>:
mov    $0x8,%edx
xor    %eax,%eax
jmp    1030 <bcopy@plt>

LLVM IR (-O0):
define void @bdecode_8(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 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @bdecode_8(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @bcopy to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 8)
ret void
}
void irssi_set_dirty(void) {}


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

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

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

LLVM IR (-O2):
define void @irssi_set_dirty() {
ret void
}
/* Variables and functions */
int ascii_to_integer(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char string[100];
  printf("Boy...Please enter a string and make sure the length \n of the "
         "string no more longer than 100 char\n\n");
  gets(string);
  printf("\n\nThe number in the string : %d\n", ascii_to_integer(string));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <ascii_to_integer@plt>
mov    %eax,%esi
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1050 <ascii_to_integer@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [100 x i8] c"Boy...Please enter a string and make sure the length \0A of the string no more longer than 100 char\0A\0A\00"
@.str.1 = [33 x i8] c"\0A\0AThe number in the string : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @ascii_to_integer(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"\0A\0AThe number in the string : %d\0A\00"
@str = [99 x i8] c"Boy...Please enter a string and make sure the length \0A of the string no more longer than 100 char\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @ascii_to_integer(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}