xunge/DecIR huggingface dataset:
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *input, int start, int end) {
  if (start >= end) {
    return;
  }
  int pivot = partition(input, start, end);
  quick_sort(input, start, pivot - 1);
  quick_sort(input, pivot + 1, end);
}


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
jl     1143 <quick_sort+0x23>
jmp    1179 <quick_sort+0x59>
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 sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
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 */
void *val(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @val() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @val() {
ret i8* null
}
void print_ptr_char(char *c) { printf("%s: %x\n", __func__, *c); }


x86 assembly (clang, -O0):
<print_ptr_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
lea    0xed6(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ptr_char>:
movsbl (%rdi),%edx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %x\0A\00"
@__func__.print_ptr_char = [15 x i8] c"print_ptr_char\00"
define void @print_ptr_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.print_ptr_char, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %x\0A\00"
@__func__.print_ptr_char = [15 x i8] c"print_ptr_char\00"
define void @print_ptr_char(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.print_ptr_char, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int INT64_MIN;
void mult_minimum_Good() {
  int64_t x = 1;
  int64_t y = x * INT64_MIN;
}


x86 assembly (clang, -O0):
<mult_minimum_Good>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
imul   (%rcx),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@INT64_MIN = global i32 0
define void @mult_minimum_Good() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @INT64_MIN
%5 = mul nsw i32 %3, %4
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
@INT64_MIN = global i32 0
define void @mult_minimum_Good() {
ret void
}
void TestDirectCall(void) {
  extern void DirectCallTarget(void);
  DirectCallTarget();
}


x86 assembly (clang, -O0):
<TestDirectCall>:
push   %rbp
mov    %rsp,%rbp
call   1030 <DirectCallTarget@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestDirectCall>:
jmp    1030 <DirectCallTarget@plt>

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

LLVM IR (-O2):
define void @TestDirectCall() {
tail call void @DirectCallTarget()
ret void
}
void f167(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
  a:
    goto a;
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f167>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    1127 <f167+0x27>

x86 assembly (clang, -O2):
<f167>:
jmp    1100 <f167>

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

LLVM IR (-O2):
define void @f167() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char line[80];
  scanf("%79[^\n]", line);
  printf("Your quote was: %s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%79[^\0A]\00"
@.str.1 = [19 x i8] c"Your quote was: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%79[^\0A]\00"
@.str.1 = [19 x i8] c"Your quote was: %s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void modele_coriolis(const double q[7], const double qdot[7], double N[7 * 7]) {
  int il, ic;
  for (ic = 0; ic < 7; ic++)
    for (il = 0; il < 7; il++)
      N[7 * ic + il] = 0.0;
}


x86 assembly (clang, -O0):
<modele_coriolis>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jge    1169 <modele_coriolis+0x69>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x7,-0x1c(%rbp)
jge    1156 <modele_coriolis+0x56>
mov    -0x18(%rbp),%rax
imul   $0x7,-0x20(%rbp),%ecx
add    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1128 <modele_coriolis+0x28>
jmp    115b <modele_coriolis+0x5b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1117 <modele_coriolis+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<modele_coriolis>:
push   %rax
mov    %rdx,%rdi
mov    $0x188,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @modele_coriolis(double* nocapture readnone %0, double* nocapture readnone %1, double* nocapture writeonly %2) {
%4 = bitcast double* %2 to i8*
ret void
}
int execute_mlock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mlock() {
ret i32 0
}
/* Variables and functions */
size_t const SIZE_MAX;
int size_add_check(const size_t x, const size_t y) {
  return (x <= SIZE_MAX - y);
}


x86 assembly (clang, -O0):
<size_add_check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%rcx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_add_check>:
neg    %rsi
xor    %eax,%eax
cmp    %rdi,%rsi
setae  %al
ret

LLVM IR (-O0):
@SIZE_MAX = constant i64 0
define i32 @size_add_check(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* @SIZE_MAX
%7 = load i64, i64* %4
%8 = sub i64 %6, %7
%9 = icmp ule i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@SIZE_MAX = constant i64 0
define i32 @size_add_check(i64 %0, i64 %1) {
%3 = sub i64 0, %1
%4 = icmp uge i64 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ init();
int /*<<< orphan*/ interface();
int main(void) {
  unsigned int i;
  for (i = 0; i < 356; i++) {
    init();
    interface();
    FH_DU();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x164,-0x8(%rbp)
jae    1176 <main+0x46>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1050 <FH_DU@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x164,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1050 <FH_DU@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 356
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = call i32 (...) @init()
%8 = call i32 (...) @interface()
%9 = call i32 (...) @FH_DU()
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @interface()
%5 = tail call i32 (...) @FH_DU()
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 356
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void handleSignal(int signal) { exit(1); }


x86 assembly (clang, -O0):
<handleSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handleSignal>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handleSignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @handleSignal(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_A6int8_mem(signed char *val) {
  return ((*val) & (0xA6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A6int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 166
%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_A6int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -90
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ powi_lookup_cost(unsigned long, unsigned char *);
powi_cost(long n) {
  unsigned char cache[256];
  unsigned long digit;
  unsigned long val;
  int result;
  while (val >= 256) {
    if (val & 1) {
      result += powi_lookup_cost(digit, cache) + 3 + 1;
    } else {
      val >>= 1;
    }
  }
}


x86 assembly (clang, -O0):
<powi_cost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x100,-0x120(%rbp)
jb     118f <powi_cost+0x7f>
mov    -0x120(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1178 <powi_cost+0x68>
mov    -0x118(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <powi_lookup_cost@plt>
mov    %rax,%rcx
add    $0x3,%rcx
add    $0x1,%rcx
movslq -0x124(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x124(%rbp)
jmp    118a <powi_cost+0x7a>
mov    -0x120(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x120(%rbp)
jmp    111f <powi_cost+0xf>
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @powi_cost(i64 %0) {
ret i32 undef
}
int ft_isdigit(int c) {
  if (c >= (unsigned char)'0' && c <= (unsigned char)'9')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isdigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void openMorseMail(FILE *out) {
  fputs("<MorseMail>", out);
  fputs("cwtext-0.96", out);
  fputs("\n", out);
}


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

x86 assembly (clang, -O2):
<openMorseMail>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xec8(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"<MorseMail>\00"
@.str.1 = [12 x i8] c"cwtext-0.96\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @openMorseMail(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"<MorseMail>\00"
@.str.1 = [12 x i8] c"cwtext-0.96\00"
define void @openMorseMail(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 11, i64 1, i32* %0)
%4 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TIPC_CMD_SET_LINK_WINDOW;
int /*<<< orphan*/ set_linkset_value(char *, char *, int /*<<< orphan*/);
void set_linkset_window(char *args) {
  set_linkset_value(args, "window", TIPC_CMD_SET_LINK_WINDOW);
}


x86 assembly (clang, -O0):
<set_linkset_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
lea    0xed0(%rip),%rsi
call   1030 <set_linkset_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_linkset_window>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edx
lea    0xee0(%rip),%rsi
jmp    1030 <set_linkset_value@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"window\00"
@TIPC_CMD_SET_LINK_WINDOW = global i32 0
define void @set_linkset_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @TIPC_CMD_SET_LINK_WINDOW
%5 = call i32 @set_linkset_value(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"window\00"
@TIPC_CMD_SET_LINK_WINDOW = global i32 0
define void @set_linkset_window(i8* %0) {
%2 = load i32, i32* @TIPC_CMD_SET_LINK_WINDOW
%3 = tail call i32 @set_linkset_value(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int is_word_boundry(int c) {
  return ((unsigned char)c < 0x80) &&
         !(('0' <= c && c <= '9') || ('a' <= c && c <= 'z') ||
           ('A' <= c && c <= 'Z') || c == '_');
}


x86 assembly (clang, -O0):
<is_word_boundry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    $0x80,%ecx
mov    %al,-0x5(%rbp)
jge    1187 <is_word_boundry+0x87>
mov    $0x30,%eax
cmp    -0x4(%rbp),%eax
jg     113b <is_word_boundry+0x3b>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jle    117f <is_word_boundry+0x7f>
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1158 <is_word_boundry+0x58>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jle    117f <is_word_boundry+0x7f>
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1175 <is_word_boundry+0x75>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jle    117f <is_word_boundry+0x7f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_word_boundry>:
xor    %eax,%eax
test   $0x80,%dil
jne    112c <is_word_boundry+0x2c>
lea    -0x3a(%rdi),%eax
cmp    $0xfffffff6,%eax
setb   %al
mov    %edi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffa5,%ecx
cmp    $0xffffffe6,%ecx
setb   %cl
cmp    $0x5f,%edi
setne  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_word_boundry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %31
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sle i32 48, %8
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 57
br i1 %12, label %28, label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
%15 = icmp sle i32 97, %14
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %2
%18 = icmp sle i32 %17, 122
br i1 %18, label %28, label %19
19: ; preds = %16, %13
%20 = load i32, i32* %2
%21 = icmp sle i32 65, %20
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %2
%24 = icmp sle i32 %23, 90
br i1 %24, label %28, label %25
25: ; preds = %22, %19
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 95
br label %28
28: ; preds = %25, %22, %16, %10
%29 = phi i1 [ true, %22 ], [ true, %16 ], [ true, %10 ], [ %27, %25 ]
%30 = xor i1 %29, true
br label %31
31: ; preds = %28, %1
%32 = phi i1 [ false, %1 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @is_word_boundry(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = add i32 %0, -58
%6 = icmp ult i32 %5, -10
%7 = and i32 %0, -33
%8 = add i32 %7, -91
%9 = icmp ult i32 %8, -26
%10 = icmp ne i32 %0, 95
%11 = and i1 %6, %9
%12 = and i1 %10, %11
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %13, %4 ]
ret i32 %15
}
/* Variables and functions */
int EINVAL;
int __os_dir_create_rec(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strchr(char const *, char);
int os_dir_create_recursive(const char *path) {
  if (path == NULL)
    return -EINVAL;
  return __os_dir_create_rec(path, strchr(path, *"/"));
}


x86 assembly (clang, -O0):
<os_dir_create_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <os_dir_create_recursive+0x2a>
xor    %eax,%eax
mov    0x2ea0(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <os_dir_create_recursive+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
movsbl 0xea3(%rip),%esi
call   1030 <strchr@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <__os_dir_create_rec@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_dir_create_recursive>:
push   %rbx
test   %rdi,%rdi
je     113e <os_dir_create_recursive+0x1e>
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <__os_dir_create_rec@plt>
mov    0x2e9b(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@.str = [2 x i8] c"/\00"
define i32 @os_dir_create_recursive(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %15
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = load i8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%13 = call i32 @strchr(i8* %11, i8 signext %12)
%14 = call i32 @__os_dir_create_rec(i8* %10, i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %9, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @os_dir_create_recursive(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
br label %9
6: ; preds = %1
%7 = tail call i32 @strchr(i8* %0, i8 signext 47)
%8 = tail call i32 @__os_dir_create_rec(i8* %0, i32 %7)
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %5, %3 ], [ %8, %6 ]
ret i32 %10
}
long long unsigned int mul8(long long unsigned int value) { return value << 3; }


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

x86 assembly (clang, -O2):
<mul8>:
lea    0x0(,%rdi,8),%rax
ret

LLVM IR (-O0):
define i64 @mul8(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 3
ret i64 %4
}

LLVM IR (-O2):
define i64 @mul8(i64 %0) {
%2 = shl i64 %0, 3
ret i64 %2
}
/* Variables and functions */
int __builtin_mips_cabs_lt_d(double, double);
int test12(double a, double b) { return __builtin_mips_cabs_lt_d(a, b); }


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

x86 assembly (clang, -O2):
<test12>:
jmp    1030 <__builtin_mips_cabs_lt_d@plt>

LLVM IR (-O0):
define i32 @test12(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 = call i32 @__builtin_mips_cabs_lt_d(double %5, double %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test12(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_lt_d(double %0, double %1)
ret i32 %3
}
int fa_clip_int(int a, int amin, int amax) {
  if (a < amin)
    return amin;
  else if (a > amax)
    return amax;
  else
    return a;
}


x86 assembly (clang, -O0):
<fa_clip_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <fa_clip_int+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <fa_clip_int+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <fa_clip_int+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <fa_clip_int+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_clip_int>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @fa_clip_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
void set_all(unsigned long *x) {
  int i;
  for (i = 0; i < 8; i++)
    x[i] = 0xffffffffUL;
}


x86 assembly (clang, -O0):
<set_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1138 <set_all+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    $0xffffffff,%edx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <set_all+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_all>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @set_all(i64* nocapture writeonly %0) {
%2 = bitcast i64* %0 to <2 x i64>*
store <2 x i64> <i64 4294967295, i64 4294967295>, <2 x i64>* %2
%3 = getelementptr inbounds i64, i64* %0, i64 2
%4 = bitcast i64* %3 to <2 x i64>*
store <2 x i64> <i64 4294967295, i64 4294967295>, <2 x i64>* %4
%5 = getelementptr inbounds i64, i64* %0, i64 4
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> <i64 4294967295, i64 4294967295>, <2 x i64>* %6
%7 = getelementptr inbounds i64, i64* %0, i64 6
%8 = bitcast i64* %7 to <2 x i64>*
store <2 x i64> <i64 4294967295, i64 4294967295>, <2 x i64>* %8
ret void
}
int abs(int x) {
  if (0 <= x) {
    return x;
  } else {
    return 0 - x;
  }
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     111d <abs+0x1d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <abs+0x25>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: date2epoch [-q] YYYY-MM-DD [HH[:MM[:SS]]]\n");
  exit(EX_USAGE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: date2epoch [-q] YYYY-MM-DD [HH[:MM[:SS]]]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: date2epoch [-q] YYYY-MM-DD [HH[:MM[:SS]]]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
double centsToDollar(int);
int sprintf(char *, char *, double);
int printReportMealExpenses(char *text, int mealExpenses) {
  return sprintf(text, "\nMeal expenses $%.02f", centsToDollar(mealExpenses));
}


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

x86 assembly (clang, -O2):
<printReportMealExpenses>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <centsToDollar@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0AMeal expenses $%.02f\00"
define i32 @printReportMealExpenses(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 double @centsToDollar(i32 %6)
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AMeal expenses $%.02f\00"
define i32 @printReportMealExpenses(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call double @centsToDollar(i32 %1)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 %4
}
void subsieve(int *mask, int n, int i, int j) {
  if (j > n)
    return;
  mask[j] = 1;
  subsieve(mask, n, i, i + j);
}


x86 assembly (clang, -O0):
<subsieve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1136 <subsieve+0x26>
jmp    115a <subsieve+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
call   1030 <subsieve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subsieve>:
cmp    %esi,%ecx
jg     111f <subsieve+0x1f>
movslq %ecx,%rax
movslq %edx,%rcx
movslq %esi,%rdx
nopl   (%rax)
movl   $0x1,(%rdi,%rax,4)
add    %rcx,%rax
cmp    %rdx,%rax
jle    1110 <subsieve+0x10>
ret

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

LLVM IR (-O2):
define void @subsieve(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, %1
br i1 %5, label %15, label %6
6: ; preds = %4
%7 = sext i32 %3 to i64
%8 = sext i32 %2 to i64
%9 = sext i32 %1 to i64
br label %10
10: ; preds = %6, %10
%11 = phi i64 [ %7, %6 ], [ %13, %10 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 1, i32* %12
%13 = add i64 %11, %8
%14 = icmp sgt i64 %13, %9
br i1 %14, label %15, label %10
15: ; preds = %10, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_once_t;

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) {
  _unsupported();
  return -1;
}


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

x86 assembly (clang, -O2):
<pthread_once>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pthread_once(i32* %0, void ()* %1) {
%3 = alloca i32*
%4 = alloca void ()*
store i32* %0, i32** %3
store void ()* %1, void ()** %4
%5 = call i32 (...) @_unsupported()
ret i32 -1
}

LLVM IR (-O2):
define i32 @pthread_once(i32* nocapture readnone %0, void ()* nocapture readnone %1) {
%3 = tail call i32 (...) @_unsupported()
ret i32 -1
}
int RoundLog2(int iValue) {
  int iRet = 0;
  int iValue_square = iValue * iValue;
  while ((1 << (iRet + 1)) <= iValue_square)
    iRet++;
  iRet = (iRet + 1) >> 1;
  return iRet;
}


x86 assembly (clang, -O0):
<RoundLog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0xc(%rbp),%eax
jg     113c <RoundLog2+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <RoundLog2+0x18>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoundLog2>:
imul   %edi,%edi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ecx
lea    0x1(%rcx),%eax
mov    $0x2,%edx
shl    %cl,%edx
cmp    %edi,%edx
jle    1110 <RoundLog2+0x10>
shr    %eax
ret

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

LLVM IR (-O2):
define i32 @RoundLog2(i32 %0) {
%2 = mul nsw i32 %0, %0
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = shl i32 2, %4
%7 = icmp sgt i32 %6, %2
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = lshr i32 %5, 1
ret i32 %9
}
/* Variables and functions */
int lprint_mask_delim(unsigned char *, char);
int lprint_mask(unsigned char *mask) { return lprint_mask_delim(mask, '+'); }


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

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

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

LLVM IR (-O2):
define i32 @lprint_mask(i8* %0) {
%2 = tail call i32 @lprint_mask_delim(i8* %0, i8 signext 43)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscspn(scalar_t__ const *, scalar_t__ const *);
wchar_t *(wcspbrk)(const wchar_t *string, const wchar_t *stopset) {
  string += wcscspn(string, stopset);
  return *string ? string : NULL;
}


x86 assembly (clang, -O0):
<wcspbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wcscspn@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     115c <wcspbrk+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1167 <wcspbrk+0x57>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1167 <wcspbrk+0x57>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcspbrk>:
push   %rbx
mov    %rdi,%rbx
call   1030 <wcscspn@plt>
movslq %eax,%rcx
lea    (%rbx,%rcx,8),%rax
mov    (%rbx,%rcx,8),%rcx
test   %rcx,%rcx
cmove  %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64* @wcspbrk(i64* %0, i64* %1) {
%3 = tail call i32 @wcscspn(i64* %0, i64* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i64* null, i64* %5
ret i64* %8
}
int (*get_op_func(char *s))(int, int) {
  char key[] = {'+', '-', '*', '/', '%'};
  int i = 0;
  int (*f[5])(int, int);
  while (i < 5) {
    return (0);
  }
  return (0);
}


x86 assembly (clang, -O0):
<get_op_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    0xef2(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xeed(%rip),%al
mov    %al,-0x11(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    1138 <get_op_func+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1140 <get_op_func+0x40>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.get_op_func.key = [5 x i8] c"+-*/%"
define i32 (i32, i32)* @get_op_func(i8* %0) {
%2 = alloca i32 (i32, i32)*
%3 = alloca i8*
%4 = alloca [5 x i8]
%5 = alloca i32
%6 = alloca [5 x i32 (i32, i32)*]
store i8* %0, i8** %3
%7 = bitcast [5 x i8]* %4 to i8*
store i32 0, i32* %5
br label %8
8: ; preds = %1
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 (i32, i32)* null, i32 (i32, i32)** %2
br label %13
12: ; preds = %8
store i32 (i32, i32)* null, i32 (i32, i32)** %2
br label %13
13: ; preds = %12, %11
%14 = load i32 (i32, i32)*, i32 (i32, i32)** %2
ret i32 (i32, i32)* %14
}

LLVM IR (-O2):
define noalias i32 (i32, i32)* @get_op_func(i8* nocapture readnone %0) {
ret i32 (i32, i32)* null
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void readonly(int fd) {
  char html[128];
  int letten;
  while ((letten = read(fd, html, 128)) > 0) {
    write(1, html, letten);
  }
}


x86 assembly (clang, -O0):
<readonly>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1040 <read@plt>
mov    %eax,-0x94(%rbp)
cmp    $0x0,%eax
jle    116d <readonly+0x4d>
lea    -0x90(%rbp),%rsi
mov    -0x94(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    112e <readonly+0xe>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readonly>:
push   %rbp
push   %rbx
sub    $0x88,%rsp
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x80,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1162 <readonly+0x42>
mov    %rsp,%rbx
nop
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x80,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1140 <readonly+0x20>
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @readonly(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %2
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @read(i32 %6, i8* %7, i32 128)
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @write(i32 1, i8* %11, i32 %12)
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @readonly(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 128)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %4, %1 ]
%8 = call i32 @write(i32 1, i8* %3, i32 %7)
%9 = call i32 @read(i32 %0, i8* %3, i32 128)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}