xunge/DecIR huggingface dataset:
const char *f4(void) { return "eralde"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"eralde\00"
define i8* @f4() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void test_two(int x, int y) {
#pragma omp distribute parallel for simd
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getchar();
int /*<<< orphan*/ stderr;
int continue_prompt(int num_warnings) {
  int c;
  fprintf(stderr,
          "%d encoder configuration warning(s). Continue? (y to continue) ",
          num_warnings);
  c = getchar();
  return c == 'y';
}


x86 assembly (clang, -O0):
<continue_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x79,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<continue_prompt>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %ecx,%ecx
cmp    $0x79,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"%d encoder configuration warning(s). Continue? (y to continue) \00"
define i32 @continue_prompt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @stderr
%5 = load i32, i32* %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 121
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"%d encoder configuration warning(s). Continue? (y to continue) \00"
define i32 @continue_prompt(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @getchar()
%5 = icmp eq i32 %4, 121
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ register_watch(char *);
void parse_and_register_watches(char **watches) {
  while (*++watches) {
    register_watch(*watches);
  }
}


x86 assembly (clang, -O0):
<parse_and_register_watches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,0x8(%rax)
je     1147 <parse_and_register_watches+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <register_watch@plt>
jmp    111c <parse_and_register_watches+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_and_register_watches>:
push   %rbx
mov    %rdi,%rbx
mov    0x8(%rdi),%rdi
test   %rdi,%rdi
je     1141 <parse_and_register_watches+0x31>
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <register_watch@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <parse_and_register_watches+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @parse_and_register_watches(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %8, %1
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i32 1
store i8** %5, i8*** %2
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = call i32 @register_watch(i8* %10)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @parse_and_register_watches(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %10, %5 ], [ %3, %1 ]
%7 = phi i8** [ %9, %5 ], [ %2, %1 ]
%8 = tail call i32 @register_watch(i8* %6)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_test_conclusion(char const *);
void pass(const char *func) { check_test_conclusion(func); }


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

x86 assembly (clang, -O2):
<pass>:
jmp    1030 <check_test_conclusion@plt>

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

LLVM IR (-O2):
define void @pass(i8* %0) {
%2 = tail call i32 @check_test_conclusion(i8* %0)
ret void
}
int test_imm_6Eint32_mem(int *val) {
  return ((*val) & (0x6E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Eint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 110
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int mymain() {
  asm("mymain_label: .globl mymain_label");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @mymain() {
tail call void asm sideeffect "mymain_label: .globl mymain_label", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
double randomperc();
double rndreal(double low, double high) {
  return (low + (high - low) * randomperc());
}


x86 assembly (clang, -O0):
<rndreal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <randomperc@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndreal>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <randomperc@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @rndreal(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @randomperc()
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x;
  for (x = 1; x <= 10; ++x) {
    if (x == 5) {
      break;
    }
    printf("%d \t", x);
  }
  printf("\nBrokeoutofloopatx == %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     115c <main+0x4c>
cmpl   $0x5,-0x8(%rbp)
jne    113f <main+0x2f>
jmp    115c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \09\00"
@.str.1 = [26 x i8] c"\0ABrokeoutofloopatx == %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
double abs(int);
double fabs(double);
double modf(double, double *);
double pow(double, double);
double sqrt(double);
void test_sqrt(double a1) {
#pragma omp target
  {
    double l1 = sqrt(a1);
    double l2 = pow(a1, a1);
    double l3 = modf(a1 + 3.5, &a1);
    double l4 = fabs(a1);
    double l5 = abs((int)a1);
  }
}


x86 assembly (clang, -O0):
<test_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe98(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xe69(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <abs@plt>
movsd  %xmm0,-0x30(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sqrt>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
ja     118a <test_sqrt+0x4a>
movapd %xmm0,%xmm1
call   1050 <pow@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe8f(%rip),%xmm0
lea    0x10(%rsp),%rdi
call   1040 <modf@plt>
cvttsd2si 0x10(%rsp),%edi
add    $0x18,%rsp
jmp    1030 <abs@plt>
ucomisd %xmm1,%xmm0
jae    115a <test_sqrt+0x1a>
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm0
jmp    115a <test_sqrt+0x1a>

LLVM IR (-O0):
define void @test_sqrt(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = call double @sqrt(double %8)
store double %9, double* %3
%10 = load double, double* %2
%11 = load double, double* %2
%12 = call double @pow(double %10, double %11)
store double %12, double* %4
%13 = load double, double* %2
%14 = fadd double %13, 3.500000e+00
%15 = call double @modf(double %14, double* %2)
store double %15, double* %5
%16 = load double, double* %2
%17 = call double @llvm.fabs.f64(double %16)
store double %17, double* %6
%18 = load double, double* %2
%19 = fptosi double %18 to i32
%20 = call double @abs(i32 %19)
store double %20, double* %7
ret void
}

LLVM IR (-O2):
define void @test_sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = fcmp olt double %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call double @sqrt(double %0)
br label %6
6: ; preds = %1, %4
%7 = tail call double @pow(double %0, double %0)
%8 = fadd double %0, 3.500000e+00
%9 = call double @modf(double %8, double* %2)
%10 = load double, double* %2
%11 = fptosi double %10 to i32
%12 = tail call double @abs(i32 %11)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", getchar() != EOF);
  printf("EOF: %d", EOF);
  return 0;
}


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    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
xor    %esi,%esi
cmp    (%rbx),%eax
setne  %sil
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
@.str.1 = [8 x i8] c"EOF: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EOF
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
@.str.1 = [8 x i8] c"EOF: %d\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp ne i32 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @EOF
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
char *minigettext_noop(char *msgid) { return msgid; }


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

x86 assembly (clang, -O2):
<minigettext_noop>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @minigettext_noop(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
double log10(int);
unsigned FormatDataLengthInRadix(unsigned wordCount, int radix) {
  return (10.0 * wordCount) / log10(radix);
}


x86 assembly (clang, -O0):
<FormatDataLengthInRadix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FormatDataLengthInRadix>:
push   %rax
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xee0(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %esi,%edi
call   1030 <log10@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @FormatDataLengthInRadix(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 = uitofp i32 %5 to double
%7 = fmul double 1.000000e+01, %6
%8 = load i32, i32* %4
%9 = call double @log10(i32 %8)
%10 = fdiv double %7, %9
%11 = fptoui double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @FormatDataLengthInRadix(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to double
%4 = fmul double %3, 1.000000e+01
%5 = tail call double @log10(i32 %1)
%6 = fdiv double %4, %5
%7 = fptoui double %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_ICMP;
int /*<<< orphan*/ SOCK_RAW;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int icmp_socket(void) { return socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); }


x86 assembly (clang, -O0):
<icmp_socket>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp_socket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_ICMP = global i32 0
define i32 @icmp_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_RAW
%3 = load i32, i32* @IPPROTO_ICMP
%4 = call i32 @socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_ICMP = global i32 0
define i32 @icmp_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_RAW
%3 = load i32, i32* @IPPROTO_ICMP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ isOperator(char);
scalar_t__ isWS(char);
int isOperandEnd(char c) {
  if (isOperator(c) || isWS(c))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isOperandEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isOperator@plt>
cmp    $0x0,%rax
jne    1154 <isOperandEnd+0x34>
movsbl -0x5(%rbp),%edi
call   1040 <isWS@plt>
cmp    $0x0,%rax
je     1160 <isOperandEnd+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1167 <isOperandEnd+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isOperandEnd(i8 signext %0) {
%2 = tail call i64 @isOperator(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isWS(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int plugFindUsage(char *, int, int);
int plugFindHourUsage(char *mac, int now) {
  return (plugFindUsage(mac, now, 60));
}


x86 assembly (clang, -O0):
<plugFindHourUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x3c,%edx
call   1030 <plugFindUsage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugFindHourUsage>:
mov    $0x3c,%edx
jmp    1030 <plugFindUsage@plt>

LLVM IR (-O0):
define i32 @plugFindHourUsage(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 = call i32 @plugFindUsage(i8* %5, i32 %6, i32 60)
ret i32 %7
}

LLVM IR (-O2):
define i32 @plugFindHourUsage(i8* %0, i32 %1) {
%3 = tail call i32 @plugFindUsage(i8* %0, i32 %1, i32 60)
ret i32 %3
}
/* Variables and functions */
int mkostemps(char *, int, int);
void resourceLeak_mkostemps(char *template, int suffixlen, int flags) {
  int fp = mkostemps(template, suffixlen, flags);
}


x86 assembly (clang, -O0):
<resourceLeak_mkostemps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <mkostemps@plt>
mov    %eax,-0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resourceLeak_mkostemps>:
jmp    1030 <mkostemps@plt>

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

LLVM IR (-O2):
define void @resourceLeak_mkostemps(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @mkostemps(i8* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ readFile(char *);
int /*<<< orphan*/ writeFile(char *, char *);
int main() {
  char *filename = "melvin.txt";
  readFile(filename);
  writeFile("output.txt", "DLSU");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <readFile@plt>
lea    0xec1(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1030 <writeFile@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <readFile@plt>
lea    0xed7(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <writeFile@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"melvin.txt\00"
@.str.1 = [11 x i8] c"output.txt\00"
@.str.2 = [5 x i8] c"DLSU\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @readFile(i8* %3)
%5 = call i32 @writeFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"melvin.txt\00"
@.str.1 = [11 x i8] c"output.txt\00"
@.str.2 = [5 x i8] c"DLSU\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @readFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @writeFile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int test4(int g, int h) { return (g ^ 6) != 4; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x6,%eax
cmp    $0x4,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
xor    %eax,%eax
cmp    $0x2,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test4(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 = xor i32 %5, 6
%7 = icmp ne i32 %6, 4
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test4(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_B0int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xB0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B0int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 755914244096
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print_time(int hour, int minute) { printf("%d:%d\n", hour, minute); }


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

x86 assembly (clang, -O2):
<print_time>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d:%d\0A\00"
define void @print_time(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 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d:%d\0A\00"
define void @print_time(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
char *memmem(char *, int, char *, int);
char *mymemmem(char *a, int sizea, char *b, int sizeb) {
  return memmem(a, sizea, b, sizeb);
}


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

x86 assembly (clang, -O2):
<mymemmem>:
jmp    1030 <memmem@plt>

LLVM IR (-O0):
define i8* @mymemmem(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i8* @memmem(i8* %9, i32 %10, i8* %11, i32 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @mymemmem(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @memmem(i8* %0, i32 %1, i8* %2, i32 %3)
ret i8* %5
}
void __attribute__((no, noclone)) fn12(int i) {
  volatile int a[5] = {};
  int k = i ? a[i] : i;
}


x86 assembly (clang, -O0):
<fn12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movaps %xmm0,(%rax)
movl   $0x0,0x10(%rax)
cmpl   $0x0,-0x4(%rbp)
je     1132 <fn12+0x32>
movslq -0x4(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x28(%rbp)
jmp    1138 <fn12+0x38>
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn12>:
xorps  %xmm0,%xmm0
movaps %xmm0,-0x18(%rsp)
movl   $0x0,-0x8(%rsp)
test   %edi,%edi
je     111b <fn12+0x1b>
movslq %edi,%rax
mov    -0x18(%rsp,%rax,4),%eax
ret

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

LLVM IR (-O2):
define void @fn12(i32 %0) {
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %2 to i8*
%4 = icmp eq i32 %0, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %6
%8 = load volatile i32, i32* %7
br label %9
9: ; preds = %1, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ NS_GET16(int /*<<< orphan*/, int /*<<< orphan*/ const *);
u_int _getshort(const u_char *src) {
  u_int dst;
  NS_GET16(dst, src);
  return dst;
}


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

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

LLVM IR (-O0):
define i32 @_getshort(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = call i32 @NS_GET16(i32 %4, i32* %5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @_getshort(i32* %0) {
%2 = tail call i32 @NS_GET16(i32 undef, i32* %0)
ret i32 undef
}
/* Variables and functions */
short print(unsigned char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(unsigned char const *);
short print_str(const unsigned char *strPtr) {
  return print(strPtr, strlen(strPtr));
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <print@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <print@plt>

LLVM IR (-O0):
define signext i16 @print_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call signext i16 @print(i8* %3, i32 %5)
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @print_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call signext i16 @print(i8* %0, i32 %2)
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  (void)puts("PROBLEMS? :-)");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"PROBLEMS? :-)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int const, unsigned long const);
void out_print_cancell(const unsigned *lengshort,
                       const unsigned long *charmax) {
  printf("\n Completato: Parole cancellate "
         "\x1b[32m"
         "%u"
         "\x1b[0m"
         ", su "
         "\x1b[32m"
         "%lu"
         "\x1b[0m"
         " parole.\n",
         *lengshort, *charmax);
}


x86 assembly (clang, -O0):
<out_print_cancell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_print_cancell>:
mov    (%rdi),%eax
mov    (%rsi),%rdx
lea    0xee4(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"\0A Completato: Parole cancellate \1B[32m%u\1B[0m, su \1B[32m%lu\1B[0m parole.\0A\00"
define void @out_print_cancell(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"\0A Completato: Parole cancellate \1B[32m%u\1B[0m, su \1B[32m%lu\1B[0m parole.\0A\00"
define void @out_print_cancell(i32* nocapture %0, i64* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i64, i64* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %3, i64 %4)
ret void
}
/* Variables and functions */
int unpack(char *, char *);
int main(int argc, char *argv[]) {
  if (argc > 0)
    return unpack(argv[0], argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <unpack@plt>
mov    %eax,-0x4(%rbp)
jmp    1153 <main+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
jle    1120 <main+0x10>
mov    (%rsi),%rdi
mov    0x8(%rsi),%rsi
jmp    1030 <unpack@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @unpack(i8* %5, i8* %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ memcmp(void const *, void const *, size_t);
bool memequals(const void *s1, const void *s2, size_t n) {
  if (n == 0) {
    return true;
  }
  return memcmp(s1, s2, n) == 0;
}


x86 assembly (clang, -O0):
<memequals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113b <memequals+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115b <memequals+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memequals>:
test   %rdx,%rdx
je     112b <memequals+0x1b>
push   %rax
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @memequals(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %2)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %8, %5 ], [ 1, %3 ]
ret i32 %10
}
void exec_queue_envp_free(char **envp) {
  int i;
  for (i = 0; envp[i]; i++) {
    free(envp[i]);
  }
  free(envp);
}


x86 assembly (clang, -O0):
<exec_queue_envp_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <exec_queue_envp_free+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <exec_queue_envp_free+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_queue_envp_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <exec_queue_envp_free+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <exec_queue_envp_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @exec_queue_envp_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sys_ConsoleInputShutdown();
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int);
void Sys_Exit(int ex) {
  Sys_ConsoleInputShutdown();
  assert(ex == 0);
  exit(ex);
}


x86 assembly (clang, -O0):
<Sys_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Sys_ConsoleInputShutdown@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Sys_Exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Sys_ConsoleInputShutdown@plt>
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
call   1040 <assert@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @Sys_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Sys_ConsoleInputShutdown()
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
define void @Sys_Exit(i32 %0) {
%2 = tail call i32 (...) @Sys_ConsoleInputShutdown()
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @exit(i32 %0)
unreachable
}
int test_imm_F1int16_mem(short *val) {
  return ((*val) & (0xF1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 241
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_flag(int);
void test_flag_1(void) { __builtin_arc_flag(0x10); }


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

x86 assembly (clang, -O2):
<test_flag_1>:
mov    $0x10,%edi
jmp    1030 <__builtin_arc_flag@plt>

LLVM IR (-O0):
define void @test_flag_1() {
%1 = call i32 @__builtin_arc_flag(i32 16)
ret void
}

LLVM IR (-O2):
define void @test_flag_1() {
%1 = tail call i32 @__builtin_arc_flag(i32 16)
ret void
}
int AnalyseLink(LinkId)
int LinkId;
{ return (ResetLink(LinkId)); }


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

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

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

LLVM IR (-O2):
define i32 @AnalyseLink(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @ResetLink to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct tm *, char, int);
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ strptime(char const *, char *, struct tm *);
time_t mysql2time(const char *_str) {
  struct tm time;
  memset(&time, '\0', sizeof(struct tm));
  strptime(_str, "%Y-%m-%d %H:%M:%S", &time);
  time.tm_isdst = -1;
  return mktime(&time);
}


x86 assembly (clang, -O0):
<mysql2time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <strptime@plt>
movl   $0xffffffff,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysql2time>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <strptime@plt>
movl   $0xffffffff,(%rsp)
mov    %r14,%rdi
call   1040 <mktime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @mysql2time(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm
store i8* %0, i8** %2
%4 = call i32 @memset(%struct.tm* %3, i8 signext 0, i32 4)
%5 = load i8*, i8** %2
%6 = call i32 @strptime(i8* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i32 -1, i32* %7
%8 = call i32 @mktime(%struct.tm* %3)
ret i32 %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @mysql2time(i8* %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = call i32 @memset(%struct.tm* %2, i8 signext 0, i32 4)
%5 = call i32 @strptime(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%6 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
store i32 -1, i32* %6
%7 = call i32 @mktime(%struct.tm* %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ checkFile(int /*<<< orphan*/);
int /*<<< orphan*/ getFileLocation(int /*<<< orphan*/);
int initStory() { checkFile(getFileLocation(0)); }


x86 assembly (clang, -O0):
<initStory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <getFileLocation@plt>
mov    %eax,%edi
call   1030 <checkFile@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initStory>:
push   %rax
xor    %edi,%edi
call   1040 <getFileLocation@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <checkFile@plt>

LLVM IR (-O0):
define i32 @initStory() {
%1 = alloca i32
%2 = call i32 @getFileLocation(i32 0)
%3 = call i32 @checkFile(i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @initStory() {
%1 = tail call i32 @getFileLocation(i32 0)
%2 = tail call i32 @checkFile(i32 %1)
ret i32 undef
}