xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fib(long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int scanf(char *, long *);
int main() {
  long num;
  puts("number...?");
  return (scanf("%ld", &num), printf("Fib is %ld...\n", fib(num)), 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <fib@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
call   1060 <fib@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"number...?\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [15 x i8] c"Fib is %ld...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
%6 = call i32 @fib(i64 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"number...?\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [15 x i8] c"Fib is %ld...\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @fib(i64 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int read_quaddobl_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(243, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<read_quaddobl_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xf3,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_quaddobl_start_system>:
mov    $0xf3,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_quaddobl_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 243, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_quaddobl_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 243, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void sudF(unsigned int *x) { int *y = x; }


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

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

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

LLVM IR (-O2):
define void @sudF(i32* nocapture %0) {
ret void
}
int test2(int x) { return x / 10 == 0; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
add    $0x9,%edi
xor    %eax,%eax
cmp    $0x13,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ unimplemented();
void ldfi_ind(void) { unimplemented(); }


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

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

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

LLVM IR (-O2):
define void @ldfi_ind() {
%1 = tail call i32 (...) @unimplemented()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() {
  while (1) {
    system("ping 162.105.31.0 -b -i 3 >/dev/null 2>/dev/null");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <system@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [49 x i8] c"ping 162.105.31.0 -b -i 3 >/dev/null 2>/dev/null\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@.str = [49 x i8] c"ping 162.105.31.0 -b -i 3 >/dev/null 2>/dev/null\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @system(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %1
}
int arrayParams(short short_array[5], char char_array[]) { return 0; }


x86 assembly (clang, -O0):
<arrayParams>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @arrayParams(i16* %0, i8* %1) {
%3 = alloca i16*
%4 = alloca i8*
store i16* %0, i16** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @arrayParams(i16* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_filters_set_filter(char const *);
void filters_set_filter(const char *keyval) { do_filters_set_filter(keyval); }


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

x86 assembly (clang, -O2):
<filters_set_filter>:
jmp    1030 <do_filters_set_filter@plt>

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

LLVM IR (-O2):
define void @filters_set_filter(i8* %0) {
%2 = tail call i32 @do_filters_set_filter(i8* %0)
ret void
}
/* Variables and functions */
long long strtoll(char *, char **, int /*<<< orphan*/);
long long get_int(char *s) {
  char *ep;
  return strtoll(s, &ep, 0);
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
push   %rax
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtoll(i8* %4, i8** %3, i32 0)
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_int(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtoll(i8* %0, i8** %2, i32 0)
ret i64 %4
}
int contains(char *str, char what) {
  int i = 0, contyn = 0;
  while (str[i] != '\0') {
    if (str[i] == what) {
      contyn = 1;
      break;
    }
    i++;
  }
  return (contyn);
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1163 <contains+0x63>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <contains+0x55>
movl   $0x1,-0x14(%rbp)
jmp    1163 <contains+0x63>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <contains+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <contains+0x20>
add    $0x1,%rdi
nopl   0x0(%rax)
cmp    %sil,%cl
je     1121 <contains+0x21>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <contains+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @contains(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %1
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %5, %9, %2
%15 = phi i32 [ 0, %2 ], [ 1, %9 ], [ 0, %5 ]
ret i32 %15
}
int reuse_mov(int i) {
  int arr[1025];
  return arr[i];
}


x86 assembly (clang, -O0):
<reuse_mov>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf90,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x1010(%rbp,%rax,4),%eax
add    $0xf90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reuse_mov(i32 %0) {
%2 = alloca i32
%3 = alloca [1025 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [1025 x i32], [1025 x i32]* %3, i64 0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @reuse_mov(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ reset_device();
void test_reset_device(void) { reset_device(); }


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

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

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

LLVM IR (-O2):
define void @test_reset_device() {
%1 = tail call i32 (...) @reset_device()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo(int);
int main() {
  int x = 5;
  int result = fibo(x);
  if (result != 5) {
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
je     1152 <main+0x32>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <fibo@plt>
cmp    $0x5,%eax
je     1137 <main+0x17>
xor    %eax,%eax
call   1030 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fibo(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 5
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @__VERIFIER_error()
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo(i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f26(long j) {
  if ((j & ((1UL << (26)) - 1)) >= ((1UL << ((26) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3ffffff,%rax
cmp    $0x2000002,%rax
jb     1139 <f26+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f26>:
and    $0x3fffffe,%edi
cmp    $0x2000002,%edi
jae    111f <f26+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f26(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 67108863
%5 = icmp uge i64 %4, 33554434
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f26(i64 %0) {
%2 = and i64 %0, 67108862
%3 = icmp ugt i64 %2, 33554433
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
void quadd_task_sched_in(struct task_struct *prev, struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @quadd_task_sched_in(%struct.task_struct* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Variables and functions */
char tolower(char);
void ConvertLcase(char *pnt, int len) {
  int i = 0;
  while (i < len) {
    pnt[i] = tolower(pnt[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<ConvertLcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <ConvertLcase+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ConvertLcase+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertLcase>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <ConvertLcase+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <ConvertLcase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ConvertLcase(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int cipher_self_test(int verbose) {
  ((void)verbose);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @cipher_self_test(i32 %0) {
ret i32 0
}
unsigned int _subc(unsigned int src1, unsigned int src2) {
  if (src1 >= src2)
    return ((src1 - src2) << 1) + 1;
  else
    return src1 << 1;
}


x86 assembly (clang, -O0):
<_subc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     112a <_subc+0x2a>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <_subc+0x33>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_subc>:
lea    (%rdi,%rdi,1),%ecx
sub    %esi,%edi
lea    0x1(%rdi,%rdi,1),%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_subc(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = sub i32 %0, %1
%5 = shl i32 %4, 1
%6 = or i32 %5, 1
%7 = shl i32 %0, 1
%8 = select i1 %3, i32 %7, i32 %6
ret i32 %8
}
void g_utf8_strrchr() {}


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

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

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

LLVM IR (-O2):
define void @g_utf8_strrchr() {
ret void
}
/* Variables and functions */
int split(int *, int, int);
void quicksort(int a[], int lower, int upper) {
  int i;
  if (upper > lower) {
    i = split(a, lower, upper);
    quicksort(a, lower, i - 1);
    quicksort(a, i + 1, upper);
  }
}


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

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1166 <quicksort+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   1040 <split@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quicksort(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* %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @split(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @split(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(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
}
/* Type definitions */
struct wl_touch_listener {
  int dummy;
};
struct wl_touch {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_touch_add_listener(struct wl_touch *wl_touch,
                          const struct wl_touch_listener *listener,
                          void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_touch,
                               (void (**)(void))listener, data);
}


x86 assembly (clang, -O0):
<wl_touch_add_listener>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wl_proxy_add_listener@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_touch_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.wl_touch = type { i32 }
%struct.wl_touch_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_touch_add_listener(%struct.wl_touch* %0, %struct.wl_touch_listener* %1, i8* %2) {
%4 = alloca %struct.wl_touch*
%5 = alloca %struct.wl_touch_listener*
%6 = alloca i8*
store %struct.wl_touch* %0, %struct.wl_touch** %4
store %struct.wl_touch_listener* %1, %struct.wl_touch_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_touch*, %struct.wl_touch** %4
%8 = bitcast %struct.wl_touch* %7 to %struct.wl_proxy*
%9 = load %struct.wl_touch_listener*, %struct.wl_touch_listener** %5
%10 = bitcast %struct.wl_touch_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_touch = type { i32 }
%struct.wl_touch_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_touch_add_listener(%struct.wl_touch* %0, %struct.wl_touch_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_touch* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_touch_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
unsigned short intel_cpu_family() {
  unsigned long eax, unused;
  unsigned short family;
  __asm__("cpuid"
          : "=a"(eax), "=b"(unused), "=c"(unused), "=d"(unused)
          : "a"(1));
  ;
  family = (eax >> 8) & 0xf;
  return family;
}


x86 assembly (clang, -O0):
<intel_cpu_family>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x1,%eax
cpuid
mov    %rax,-0x10(%rbp)
mov    %rbx,-0x18(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
and    $0xf,%rax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_cpu_family>:
push   %rbx
mov    $0x1,%eax
cpuid
shr    $0x8,%eax
and    $0xf,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @intel_cpu_family() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i16
%4 = call { i64, i64, i64, i64 } asm "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
%5 = extractvalue { i64, i64, i64, i64 } %4, 0
%6 = extractvalue { i64, i64, i64, i64 } %4, 1
%7 = extractvalue { i64, i64, i64, i64 } %4, 2
%8 = extractvalue { i64, i64, i64, i64 } %4, 3
store i64 %5, i64* %1
store i64 %6, i64* %2
store i64 %7, i64* %2
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = lshr i64 %9, 8
%11 = and i64 %10, 15
%12 = trunc i64 %11 to i16
store i16 %12, i16* %3
%13 = load i16, i16* %3
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @intel_cpu_family() {
%1 = tail call { i64, i64, i64, i64 } asm "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = extractvalue { i64, i64, i64, i64 } %1, 0
%3 = trunc i64 %2 to i16
%4 = lshr i16 %3, 8
%5 = and i16 %4, 15
ret i16 %5
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1;
  a -= 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = sub nsw i32 %2, 2
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void say() {}


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

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

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

LLVM IR (-O2):
define void @say() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_buf(char *buf, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%2c\n", buf[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<print_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_buf+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_buf+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%2c\0A\00"
define void @print_buf(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
long lrintf(float);
long int iRound(float f) { return lrintf(f); }


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

x86 assembly (clang, -O2):
<iRound>:
jmp    1030 <lrintf@plt>

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

LLVM IR (-O2):
define i64 @iRound(float %0) {
%2 = tail call i64 @lrintf(float %0)
ret i64 %2
}
double reconstructDouble(int sides[2]) {
  double reconstructed = sides[0];
  reconstructed += (sides[1] / 1000000.0);
  return reconstructed;
}


x86 assembly (clang, -O0):
<reconstructDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reconstructDouble>:
cvtsi2sdl (%rdi),%xmm1
cvtsi2sdl 0x4(%rdi),%xmm0
divsd  0xeef(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @reconstructDouble(i32* %0) {
%2 = alloca i32*
%3 = alloca double
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
store double %7, double* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+06
%13 = load double, double* %3
%14 = fadd double %13, %12
store double %14, double* %3
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @reconstructDouble(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sitofp i32 %2 to double
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %7, %3
ret double %8
}
/* Variables and functions */
scalar_t__ file_exists(char const *);
int mkdir(char const *, int);
int ensure_directory(const char *dir) {
  if (file_exists(dir) == 0) {
    return mkdir(dir, 0700);
  }
  return 0;
}


x86 assembly (clang, -O0):
<ensure_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <file_exists@plt>
cmp    $0x0,%rax
jne    1155 <ensure_directory+0x35>
mov    -0x10(%rbp),%rdi
mov    $0x1c0,%esi
call   1040 <mkdir@plt>
mov    %eax,-0x4(%rbp)
jmp    115c <ensure_directory+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_directory>:
push   %rbx
mov    %rdi,%rbx
call   1030 <file_exists@plt>
test   %rax,%rax
je     1132 <ensure_directory+0x12>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1c0,%esi
pop    %rbx
jmp    1040 <mkdir@plt>

LLVM IR (-O0):
define i32 @ensure_directory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @file_exists(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @mkdir(i8* %8, i32 448)
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ensure_directory(i8* %0) {
%2 = tail call i64 @file_exists(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @mkdir(i8* %0, i32 448)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_byte(unsigned char);
void console_tx_string(const char *str) {
  unsigned char ch;
  while ((ch = *str++) != '\0') {
    console_tx_byte(ch);
  }
}


x86 assembly (clang, -O0):
<console_tx_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     114a <console_tx_string+0x3a>
movzbl -0x9(%rbp),%edi
call   1030 <console_tx_byte@plt>
jmp    111c <console_tx_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_tx_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <console_tx_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <console_tx_byte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <console_tx_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @console_tx_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @console_tx_byte(i8 zeroext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sigHandler(int signo) { printf("caught signal: %d\n", signo); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"caught signal: %d\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"caught signal: %d\0A\00"
define void @sigHandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
__attribute__((no)) int bar2() {
  int a = -1;
  volatile unsigned b = 1U;
  int c = 1;
  c = (a + 972195716) % (b ? 1 : 2);
  if (c == 972195715)
    ;
  else
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<bar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x39f28784,%eax
mov    -0x8(%rbp),%esi
mov    $0x2,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x39f28783,-0xc(%rbp)
jne    1160 <bar2+0x50>
jmp    1165 <bar2+0x55>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar2>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x4(%rsp),%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @bar2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -1, i32* %1
store volatile i32 1, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 972195716
%6 = load volatile i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 2
%10 = srem i32 %5, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 972195715
br i1 %12, label %13, label %14
13: ; preds = %0
br label %15
14: ; preds = %0
unreachable
15: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @bar2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i32, i32* %1
tail call void @abort()
unreachable
}
/* Variables and functions */
long double tan(double);
long double tanl(long double x) { return tan((double)x); }


x86 assembly (clang, -O0):
<tanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <tan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <tan@plt>

LLVM IR (-O0):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @tan(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @tanl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @tan(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ add_virtual_host(char *, char *);
void c_add_vhost(char *v1, char *v2, void *t) { add_virtual_host(v1, v2); }


x86 assembly (clang, -O0):
<c_add_vhost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <add_virtual_host@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_add_vhost>:
jmp    1030 <add_virtual_host@plt>

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

LLVM IR (-O2):
define void @c_add_vhost(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @add_virtual_host(i8* %0, i8* %1)
ret void
}
void skipspace(p) char **p;
{
  while (((int)**p == ' ') || ((int)**p == 9))
    *p = *p + 1;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1133 <skipspace+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <skipspace+0x43>
jmp    115a <skipspace+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1108 <skipspace+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
mov    (%rdi),%rax
jmp    1113 <skipspace+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x20,%cl
je     1110 <skipspace+0x10>
cmp    $0x9,%cl
je     1110 <skipspace+0x10>
ret

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

LLVM IR (-O2):
define void @skipspace(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
void *memcpy(void *, void const *, size_t);
void *psf_memdup(const void *src, size_t n) {
  void *mem = calloc(1, n & 3 ? n + 4 - (n & 3) : n);
  return memcpy(mem, src, n);
}


x86 assembly (clang, -O0):
<psf_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
je     115e <psf_memdup+0x3e>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    -0x10(%rbp),%rcx
and    $0x3,%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1166 <psf_memdup+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psf_memdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x4,%rsi
and    $0xfffffffffffffffc,%rsi
test   $0x3,%bl
cmove  %rbx,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @psf_memdup(i8* nocapture %0, i64 %1) {
%3 = and i64 %1, 3
%4 = icmp eq i64 %3, 0
%5 = add i64 %1, 4
%6 = and i64 %5, -4
%7 = select i1 %4, i64 %1, i64 %6
%8 = tail call i8* @calloc(i32 1, i64 %7)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %8, i8* align 1 %0, i64 %1, i1 false)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cx_Int_print(int *const value) { printf("%d", *value); }


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

x86 assembly (clang, -O2):
<cx_Int_print>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @cx_Int_print(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void X509_EXTENSION_get_data(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_EXTENSION_get_data() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int ex_put_partial_coord(int, int /*<<< orphan*/, int /*<<< orphan*/,
                         void const *, void const *, void const *);
int ex_put_n_coord(int exoid, int64_t start_node_num, int64_t num_nodes,
                   const void *x_coor, const void *y_coor, const void *z_coor) {
  return ex_put_partial_coord(exoid, start_node_num, num_nodes, x_coor, y_coor,
                              z_coor);
}


x86 assembly (clang, -O0):
<ex_put_n_coord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <ex_put_partial_coord@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_put_n_coord>:
jmp    1030 <ex_put_partial_coord@plt>

LLVM IR (-O0):
define i32 @ex_put_n_coord(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i32 @ex_put_partial_coord(i32 %13, i32 %14, i32 %15, i8* %16, i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @ex_put_n_coord(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @ex_put_partial_coord(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5)
ret i32 %7
}
void BUG_comm_size(void) {}


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

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

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

LLVM IR (-O2):
define void @BUG_comm_size() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ttsDeleteSession(int /*<<< orphan*/ *);
void cleanup(void) { ttsDeleteSession(NULL); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ttsDeleteSession@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
xor    %edi,%edi
jmp    1030 <ttsDeleteSession@plt>

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 @ttsDeleteSession(i32* null)
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 @ttsDeleteSession(i32* null)
ret void
}
void freeMem(double **A) {
  free(*A);
  free(A);
}


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

x86 assembly (clang, -O2):
<freeMem>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeMem(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = load double*, double** %3
%5 = bitcast double* %4 to i8*
%6 = load double**, double*** %2
%7 = bitcast double** %6 to i8*
ret void
}

LLVM IR (-O2):
define void @freeMem(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}