xunge/DecIR huggingface dataset:
double h_g2s(int n) {
  double sum = 0;
  int k = 0;
  for (k = n; k >= 1; k--) {
    sum += 1.0 / k;
  }
  return sum;
}


x86 assembly (clang, -O0):
<h_g2s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     114f <h_g2s+0x4f>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <h_g2s+0x1c>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_g2s>:
test   %edi,%edi
jle    1117 <h_g2s+0x17>
test   $0x1,%dil
jne    111b <h_g2s+0x1b>
xorpd  %xmm0,%xmm0
mov    %edi,%eax
cmp    $0x1,%edi
jne    113b <h_g2s+0x3b>
jmp    1181 <h_g2s+0x81>
xorps  %xmm0,%xmm0
ret
cvtsi2sd %edi,%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
lea    -0x1(%rdi),%eax
cmp    $0x1,%edi
je     1181 <h_g2s+0x81>
movsd  0xebd(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
movapd %xmm1,%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
lea    -0x1(%rax),%ecx
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
movapd %xmm1,%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
add    $0xfffffffe,%eax
cmp    $0x1,%ecx
ja     1150 <h_g2s+0x50>
ret

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

LLVM IR (-O2):
define double @h_g2s(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %28
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = sitofp i32 %0 to double
%8 = fdiv double 1.000000e+00, %7
%9 = fadd double %8, 0.000000e+00
%10 = add nsw i32 %0, -1
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ %0, %3 ], [ %10, %6 ]
%13 = phi double [ 0.000000e+00, %3 ], [ %9, %6 ]
%14 = phi double [ undef, %3 ], [ %9, %6 ]
%15 = icmp eq i32 %0, 1
br i1 %15, label %28, label %16
16: ; preds = %11, %16
%17 = phi i32 [ %26, %16 ], [ %12, %11 ]
%18 = phi double [ %25, %16 ], [ %13, %11 ]
%19 = sitofp i32 %17 to double
%20 = fdiv double 1.000000e+00, %19
%21 = fadd double %18, %20
%22 = add nsw i32 %17, -1
%23 = sitofp i32 %22 to double
%24 = fdiv double 1.000000e+00, %23
%25 = fadd double %21, %24
%26 = add nsw i32 %17, -2
%27 = icmp ugt i32 %22, 1
br i1 %27, label %16, label %28
28: ; preds = %11, %16, %1
%29 = phi double [ 0.000000e+00, %1 ], [ %14, %11 ], [ %25, %16 ]
ret double %29
}
/* Variables and functions */
int /*<<< orphan*/ DisplayUsage();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void DisplayInvalidParameter(char *param) {
  fprintf(stderr, "lle2cre: Parameter %s is invalid.\n", param);
  DisplayUsage();
}


x86 assembly (clang, -O0):
<DisplayInvalidParameter>:
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    $0x0,%al
call   1040 <DisplayUsage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayInvalidParameter>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DisplayUsage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"lle2cre: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(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 ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @DisplayUsage()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"lle2cre: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @DisplayUsage()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void cleanup_fclose(FILE **ptr) { fclose(*ptr); }


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

x86 assembly (clang, -O2):
<cleanup_fclose>:
mov    (%rdi),%rdi
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @cleanup_fclose(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @fclose(i32* %2)
ret void
}
int is_english(unsigned char c) {
  if ((c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_english>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1124 <is_english+0x24>
movzbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    113e <is_english+0x3e>
movzbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     114a <is_english+0x4a>
movzbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     114a <is_english+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_english+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_english(i8 zeroext %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
}
/* Variables and functions */
int /*<<< orphan*/ __gpio_set_value(unsigned int, int);
int /*<<< orphan*/ might_sleep();
void gpio_set_value_cansleep(unsigned gpio, int value) {
  might_sleep();
  __gpio_set_value(gpio, value);
}


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

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

LLVM IR (-O0):
define void @gpio_set_value_cansleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @might_sleep()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @__gpio_set_value(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @gpio_set_value_cansleep(i32 %0, i32 %1) {
%3 = tail call i32 (...) @might_sleep()
%4 = tail call i32 @__gpio_set_value(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  printf("%d", a + b + c + a % b % c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
cltd
idivl  -0x10(%rbp)
add    %edx,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
lea    (%rcx,%rax,1),%esi
mov    0xc(%rsp),%edi
add    %edi,%esi
cltd
idiv   %ecx
mov    %edx,%eax
cltd
idiv   %edi
add    %edx,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = srem i32 %8, %9
%14 = srem i32 %13, %11
%15 = add nsw i32 %12, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ glutTimerFunc(int, void (*)(int), int /*<<< orphan*/);
void Timer(int value) {
  glutTimerFunc(20, Timer, 0);
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<Timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14,%edi
mov    0x2ec1(%rip),%rsi
xor    %edx,%edx
call   1030 <glutTimerFunc@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer>:
push   %rax
mov    0x2ed0(%rip),%rsi
mov    $0x14,%edi
xor    %edx,%edx
call   1030 <glutTimerFunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @Timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @glutTimerFunc(i32 20, void (i32)* @Timer, i32 0)
%4 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @Timer(i32 %0) {
%2 = tail call i32 @glutTimerFunc(i32 20, void (i32)* @Timer, i32 0)
%3 = tail call i32 (...) @glutPostRedisplay()
ret void
}
int eventfd_signal(struct file *file, int n) { return 0; }


x86 assembly (clang, -O0):
<eventfd_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.file = type opaque
define i32 @eventfd_signal(%struct.file* %0, i32 %1) {
%3 = alloca %struct.file*
%4 = alloca i32
store %struct.file* %0, %struct.file** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.file = type opaque
define i32 @eventfd_signal(%struct.file* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int);
void print_uint24(FILE *fp, uint32_t v) {
  fprintf(fp, "%c%c%c", (v >> 16) & 0xff, (v >> 8) & 0xff, v & 0xff);
}


x86 assembly (clang, -O0):
<print_uint24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sar    $0x10,%edx
and    $0xff,%edx
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0xc(%rbp),%r8d
and    $0xff,%r8d
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint24>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%r8d
shr    $0x10,%eax
movzbl %al,%edx
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c%c%c\00"
define void @print_uint24(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 = ashr i32 %6, 16
%8 = and i32 %7, 255
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32, i32* %4
%13 = and i32 %12, 255
%14 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%c%c\00"
define void @print_uint24(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = and i32 %1, 255
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %7)
ret void
}
int linear_search_rec_helper(int *arr, int index, int n, int value) {
  if (index == n) {
    return -1;
  } else {
    if (arr[index] == value) {
      return index;
    } else {
      return linear_search_rec_helper(arr, index + 1, n, value);
    }
  }
}


x86 assembly (clang, -O0):
<linear_search_rec_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    113d <linear_search_rec_helper+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <linear_search_rec_helper+0x64>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jne    115c <linear_search_rec_helper+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <linear_search_rec_helper+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <linear_search_rec_helper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_search_rec_helper>:
mov    $0xffffffff,%eax
cmp    %edx,%esi
je     111f <linear_search_rec_helper+0x1f>
movslq %esi,%r8
lea    (%rdi,%r8,4),%rdi
cmp    %ecx,(%rdi)
je     1120 <linear_search_rec_helper+0x20>
add    $0x1,%esi
add    $0x4,%rdi
cmp    %esi,%edx
jne    1110 <linear_search_rec_helper+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @linear_search_rec_helper(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %1, %2
br i1 %5, label %19, label %6
6: ; preds = %4
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %13
%9 = phi i64 [ %7, %6 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %3
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = add nsw i64 %9, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %15, %2
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %13, %17, %4
%20 = phi i32 [ -1, %4 ], [ %18, %17 ], [ -1, %13 ]
ret i32 %20
}
void ff_hevc_put_hevc_bi_qpel_v48_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v48_8_avx2() {
ret void
}
/* Variables and functions */
int pm8901_mpp_config(unsigned int, int, unsigned int, unsigned int);
int pm8901_mpp_config_dtest_output(unsigned mpp, unsigned level,
                                   unsigned control) {
  return pm8901_mpp_config(mpp, 7, level, control);
}


x86 assembly (clang, -O0):
<pm8901_mpp_config_dtest_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x7,%esi
call   1030 <pm8901_mpp_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8901_mpp_config_dtest_output>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x7,%esi
jmp    1030 <pm8901_mpp_config@plt>

LLVM IR (-O0):
define i32 @pm8901_mpp_config_dtest_output(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @pm8901_mpp_config(i32 %7, i32 7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pm8901_mpp_config_dtest_output(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pm8901_mpp_config(i32 %0, i32 7, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
void *memset_override_0_impl(void *, int, size_t);
void *memset(void *s, int c, size_t n) {
  return memset_override_0_impl(s, c, n);
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset_override_0_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
jmp    1030 <memset_override_0_impl@plt>

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

LLVM IR (-O2):
define i8* @memset(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @memset_override_0_impl(i8* %0, i32 %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
double floor(double);
double invmodDymola(double x, double y) {
  double quot = x / y;
  return (floor(quot));
}


x86 assembly (clang, -O0):
<invmodDymola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invmodDymola>:
divsd  %xmm1,%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @invmodDymola(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = call double @llvm.floor.f64(double %9)
ret double %10
}

LLVM IR (-O2):
define double @invmodDymola(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ auto_generated_function();
int f();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int unused;
  printf("0x%X\n", f());
  auto_generated_function();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <auto_generated_function@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%X\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @auto_generated_function()
ret i32 0
}
void g_completion_free() {}


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

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

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

LLVM IR (-O2):
define void @g_completion_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void exibeMenuAnt(int op) {
  if (op == 0) {
    printf("ANTERIOR: RAIZ\n", op);
  } else {
    printf("ANTERIOR: %d\n", op);
  }
}


x86 assembly (clang, -O0):
<exibeMenuAnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1139 <exibeMenuAnt+0x29>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1148 <exibeMenuAnt+0x38>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exibeMenuAnt>:
test   %edi,%edi
je     1122 <exibeMenuAnt+0x12>
mov    %edi,%esi
lea    0xef3(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xed7(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"ANTERIOR: RAIZ\0A\00"
@.str.1 = [14 x i8] c"ANTERIOR: %d\0A\00"
define void @exibeMenuAnt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
br label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
int test_imm_09uint32_reg(unsigned int val) {
  return ((val) & (0x09 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_09uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_09uint32_reg>:
test   $0x9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09uint32_reg(i32 %0) {
%2 = and i32 %0, 9
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct input_ctx {
  int dummy;
};

/* Variables and functions */
void terminal_setup_getch(struct input_ctx *ictx) {}


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

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

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

LLVM IR (-O2):
%struct.input_ctx = type { i32 }
define void @terminal_setup_getch(%struct.input_ctx* nocapture %0) {
ret void
}
/* Variables and functions */
int create_socket();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ test_request(int, char *, char *);
int main() {
  int sock = create_socket();
  test_request(sock, "../../fuzzing/parse_header/input/",
               "INVALID_MULTI_HEADER");
  sleep(1000);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <create_socket@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xe9d(%rip),%rsi
lea    0xeb8(%rip),%rdx
call   1050 <test_request@plt>
mov    $0x3e8,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <create_socket@plt>
lea    0xeb1(%rip),%rsi
lea    0xecc(%rip),%rdx
mov    %eax,%edi
call   1050 <test_request@plt>
mov    $0x3e8,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"../../fuzzing/parse_header/input/\00"
@.str.1 = [21 x i8] c"INVALID_MULTI_HEADER\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @create_socket()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @test_request(i32 %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @sleep(i32 1000)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"../../fuzzing/parse_header/input/\00"
@.str.1 = [21 x i8] c"INVALID_MULTI_HEADER\00"
define i32 @main() {
%1 = tail call i32 (...) @create_socket()
%2 = tail call i32 @test_request(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1000)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int funcOverArray(int *arr, int count, int func(int, int)) {
  int i, final;
  final = 0;
  for (i = 0; i < count; i++) {
    final = func(final, arr[i]);
  }
  return final;
}


x86 assembly (clang, -O0):
<funcOverArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1152 <funcOverArray+0x52>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,4),%esi
call   *%rax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1121 <funcOverArray+0x21>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcOverArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <funcOverArray+0x34>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
xor    %eax,%eax
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%esi
mov    %eax,%edi
call   *%r14
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <funcOverArray+0x20>
jmp    1136 <funcOverArray+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @funcOverArray(i32* nocapture %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = phi i32 [ 0, %5 ], [ %12, %7 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %8
%11 = load i32, i32* %10
%12 = tail call i32 %2(i32 %9, i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = phi i32 [ 0, %3 ], [ %12, %7 ]
ret i32 %16
}
void RTAvloGCPtrDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloGCPtrDestroy() {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  for (;;) {
    if ((c = getchar()) == EOF)
      break;
    putchar(c);
    if (getchar() == EOF)
      break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
jne    114d <main+0x2d>
jmp    1175 <main+0x55>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
jne    1170 <main+0x50>
jmp    1175 <main+0x55>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     114d <main+0x2d>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = tail call i32 @putchar(i32 %2)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %1
10: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *A, int p, int r) {
  int q;
  if (p < r) {
    q = partition(A, p, r);
    quick_sort(A, p, q - 1);
    quick_sort(A, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_assign();
int /*<<< orphan*/ check_intof();
int /*<<< orphan*/ check_minmax();
int /*<<< orphan*/ check_rangeptrbuf();
int /*<<< orphan*/ puts(char *);
int main() {
  check_minmax();
  check_assign();
  check_intof();
  check_rangeptrbuf();
  puts("all tests ok");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <check_minmax@plt>
mov    $0x0,%al
call   1030 <check_assign@plt>
mov    $0x0,%al
call   1040 <check_intof@plt>
mov    $0x0,%al
call   1070 <check_rangeptrbuf@plt>
lea    0xe7e(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <check_minmax@plt>
xor    %eax,%eax
call   1030 <check_assign@plt>
xor    %eax,%eax
call   1040 <check_intof@plt>
xor    %eax,%eax
call   1070 <check_rangeptrbuf@plt>
lea    0xe8c(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"all tests ok\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_minmax()
%3 = call i32 (...) @check_assign()
%4 = call i32 (...) @check_intof()
%5 = call i32 (...) @check_rangeptrbuf()
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"all tests ok\00"
define i32 @main() {
%1 = tail call i32 (...) @check_minmax()
%2 = tail call i32 (...) @check_assign()
%3 = tail call i32 (...) @check_intof()
%4 = tail call i32 (...) @check_rangeptrbuf()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *in2pos(char *);
char *revexpr(char *);
char *in2pre(char *s) {
  char *ret;
  revexpr(s);
  ret = revexpr(in2pos(s));
  revexpr(s);
  return ret;
}


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

x86 assembly (clang, -O2):
<in2pre>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <revexpr@plt>
mov    %rbx,%rdi
call   1030 <in2pos@plt>
mov    %rax,%rdi
call   1040 <revexpr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <revexpr@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @in2pre(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @revexpr(i8* %4)
%6 = load i8*, i8** %2
%7 = call i8* @in2pos(i8* %6)
%8 = call i8* @revexpr(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @revexpr(i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @in2pre(i8* %0) {
%2 = tail call i8* @revexpr(i8* %0)
%3 = tail call i8* @in2pos(i8* %0)
%4 = tail call i8* @revexpr(i8* %3)
%5 = tail call i8* @revexpr(i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char testopen(char *);
char testopenfext(char *filename, char *ext) {
  char fn[80];
  sprintf(fn, "%s.%s", filename, ext);
  return testopen(fn);
}


x86 assembly (clang, -O0):
<testopenfext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <testopen@plt>
movsbl %al,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testopenfext>:
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <testopen@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s.%s\00"
define signext i8 @testopenfext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [80 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%11 = call signext i8 @testopen(i8* %10)
ret i8 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s.%s\00"
define signext i8 @testopenfext(i8* %0, i8* %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call signext i8 @testopen(i8* %4)
ret i8 %6
}
/* Variables and functions */
void *memcpy(void *dstptr, const void *srcptr, size_t n) {
  unsigned char *dst = (unsigned char *)dstptr;
  const unsigned char *src = (const unsigned char *)srcptr;
  for (unsigned int i = 0; i < n; i++)
    dst[i] = src[i];
  return dstptr;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1156 <memcpy+0x56>
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1127 <memcpy+0x27>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111f <memcpy+0x1f>
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rdi,1),%ecx
mov    %cl,(%rax,%rdi,1)
add    $0x1,%edi
cmp    %rdx,%rdi
jb     1110 <memcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret i8* %0
6: ; preds = %3, %6
%7 = phi i64 [ %12, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = and i64 %11, 4294967295
%13 = icmp ult i64 %12, %2
br i1 %13, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_ADD(int r, int v) { C67_asm("ADD.L", v, r, v); }


x86 assembly (clang, -O0):
<C67_ADD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed2(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_ADD>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    %esi,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ADD.L\00"
define void @C67_ADD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ADD.L\00"
define void @C67_ADD(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SETVAL;
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int init_semaphore(int id, int val) { return semctl(id, 0, SETVAL, val); }


x86 assembly (clang, -O0):
<init_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
call   1030 <semctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_semaphore>:
mov    %esi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@SETVAL = global i32 0
define i32 @init_semaphore(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* @SETVAL
%7 = load i32, i32* %4
%8 = call i32 @semctl(i32 %5, i32 0, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SETVAL = global i32 0
define i32 @init_semaphore(i32 %0, i32 %1) {
%3 = load i32, i32* @SETVAL
%4 = tail call i32 @semctl(i32 %0, i32 0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int login_error(char *msg) {
  printf("<html><head><title>login error</title><meta 		"
         "http-equiv='Content-Type' content='text/html;	        "
         "charset=utf-8'/>");
  printf("<body><div width=900px><div align=center><p><p><p>		"
         "<h1>You Haven't Login!!<br><p>wrong name or passworld<br><p><p>");
  printf("<a href='%s'>Login</a> <br></div></body></html>\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<login_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xfa6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<login_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf4c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfb2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [117 x i8] c"<html><head><title>login error</title><meta \09\09http-equiv='Content-Type' content='text/html;\09 charset=utf-8'/>\00"
@.str.1 = [116 x i8] c"<body><div width=900px><div align=center><p><p><p>\09\09<h1>You Haven't Login!!<br><p>wrong name or passworld<br><p><p>\00"
@.str.2 = [49 x i8] c"<a href='%s'>Login</a> <br></div></body></html>\0A\00"
define i32 @login_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [117 x i8] c"<html><head><title>login error</title><meta \09\09http-equiv='Content-Type' content='text/html;\09 charset=utf-8'/>\00"
@.str.1 = [116 x i8] c"<body><div width=900px><div align=center><p><p><p>\09\09<h1>You Haven't Login!!<br><p>wrong name or passworld<br><p><p>\00"
@.str.2 = [49 x i8] c"<a href='%s'>Login</a> <br></div></body></html>\0A\00"
define i32 @login_error(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([116 x i8], [116 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret i32 0
}