xunge/DecIR huggingface dataset:
/* Variables and functions */
void *get_section_by_name(char *, char *, size_t *);
int /*<<< orphan*/ hexdump(int, void *, size_t);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  size_t size;
  void *result = get_section_by_name("./a.out", ".text", &size);
  printf("Result from get_section_by_name (%u bytes):\n", size);
  hexdump(1, result, size);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec2(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <get_section_by_name@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
call   1040 <hexdump@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xeb5(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1060 <get_section_by_name@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%rsi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rdx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1050 <hexdump@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"./a.out\00"
@.str.1 = [6 x i8] c".text\00"
@.str.2 = [45 x i8] c"Result from get_section_by_name (%u bytes):\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i8*
%3 = call i8* @get_section_by_name(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64* %1)
store i8* %3, i8** %2
%4 = load i64, i64* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i64 %4)
%6 = load i8*, i8** %2
%7 = load i64, i64* %1
%8 = call i32 @hexdump(i32 1, i8* %6, i64 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"./a.out\00"
@.str.1 = [6 x i8] c".text\00"
@.str.2 = [45 x i8] c"Result from get_section_by_name (%u bytes):\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i8* @get_section_by_name(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i64 %4)
%6 = load i64, i64* %1
%7 = call i32 @hexdump(i32 1, i8* %3, i64 %6)
%8 = call i32 @putchar(i32 10)
ret i32 0
}
const char *nextchar(const char *string, char tok) {
  while (*string != 0 && *string != tok)
    string++;
  return string;
}


x86 assembly (clang, -O0):
<nextchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1136 <nextchar+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1146 <nextchar+0x46>
jmp    1157 <nextchar+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <nextchar+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextchar>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <nextchar+0x21>
cmp    %sil,%cl
jne    1110 <nextchar+0x10>
ret

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

LLVM IR (-O2):
define i8* @nextchar(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %4
}
_Complex int getComplex(_Complex int val) {
  static int count;
  if (count++)
    abort();
  return val;
}


x86 assembly (clang, -O0):
<getComplex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
je     113b <getComplex+0x2b>
call   1030 <abort@plt>
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getComplex>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jne    1129 <getComplex+0x19>
mov    %rdi,%rax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@getComplex.count = internal global i32 0
define i64 @getComplex(i64 %0) {
%2 = alloca { i32, i32 }
%3 = alloca { i32, i32 }
%4 = bitcast { i32, i32 }* %3 to i64*
store i64 %0, i64* %4
%5 = load i32, i32* @getComplex.count
%6 = add nsw i32 %5, 1
store i32 %6, i32* @getComplex.count
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %9
8: ; preds = %1
unreachable
9: ; preds = %1
%10 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %3, i32 0, i32 1
%13 = load i32, i32* %12
%14 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %2, i32 0, i32 0
%15 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %2, i32 0, i32 1
store i32 %11, i32* %14
store i32 %13, i32* %15
%16 = bitcast { i32, i32 }* %2 to i64*
%17 = load i64, i64* %16
ret i64 %17
}

LLVM IR (-O2):
@getComplex.count = internal unnamed_addr global i32 0
define i64 @getComplex(i64 returned %0) {
%2 = load i32, i32* @getComplex.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @getComplex.count
%4 = icmp eq i32 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %1
tail call void @abort()
unreachable
6: ; preds = %1
ret i64 %0
}
int lib5() { return 42; }


x86 assembly (clang, -O0):
<lib5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lib5() {
ret i32 42
}

LLVM IR (-O2):
define i32 @lib5() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(int err) {
  fprintf(stderr, "USAGE: range [options] start end\n");
  exit(err);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"USAGE: range [options] start end\0A\00"
define void @help(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"USAGE: range [options] start end\0A\00"
define void @help(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
int fibSumEven() {
  long fib3 = 2;
  long fib6 = 0;
  long result = 2;
  long summed = 0;
  while (result < 4000000) {
    summed += result;
    result = 4 * fib3 + fib6;
    fib6 = fib3;
    fib3 = result;
  }
  return summed;
}


x86 assembly (clang, -O0):
<fibSumEven>:
push   %rbp
mov    %rsp,%rbp
movq   $0x2,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3d0900,-0x18(%rbp)
jge    1163 <fibSumEven+0x63>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <fibSumEven+0x24>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibSumEven>:
mov    $0x2,%ecx
xor    %eax,%eax
xor    %edx,%edx
nopl   0x0(%rax)
mov    %rcx,%rsi
add    %rcx,%rax
lea    (%rdx,%rcx,4),%rcx
mov    %rsi,%rdx
cmp    $0x3d0900,%rcx
jl     1110 <fibSumEven+0x10>
ret

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

LLVM IR (-O2):
define i32 @fibSumEven() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %5, %1 ]
%3 = phi i64 [ 2, %0 ], [ %7, %1 ]
%4 = phi i64 [ 0, %0 ], [ %3, %1 ]
%5 = add nsw i64 %2, %3
%6 = shl nsw i64 %3, 2
%7 = add nsw i64 %6, %4
%8 = icmp slt i64 %7, 4000000
br i1 %8, label %1, label %9
9: ; preds = %1
%10 = trunc i64 %5 to i32
ret i32 %10
}
long power(int x, int y) {
  int i;
  long result = 1;
  for (i = 0; i < y; i++) {
    result *= x;
  }
  return result;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1140 <power+0x40>
movslq -0x4(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <power+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
jle    111b <power+0x1b>
movslq %edi,%rcx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1121 <power+0x21>
mov    $0x1,%eax
jmp    1155 <power+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <power+0x30>
test   %edx,%edx
je     1169 <power+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <power+0x60>
ret

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

LLVM IR (-O2):
define i64 @power(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int *searchRange(int *, int, int, int *);
int main(void) {
  int arr[] = {
      5, 7, 7, 8, 8, 10,
  };
  int *a, n;
  a = searchRange(arr, sizeof(arr) / sizeof(arr[0]), 8, &n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x8,%edx
lea    -0x2c(%rbp),%rcx
call   1030 <searchRange@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
mov    $0x6,%esi
mov    $0x8,%edx
call   1030 <searchRange@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32* @searchRange(i32* %6, i32 6, i32 8, i32* %4)
store i32* %7, i32** %3
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32* @searchRange(i32* %5, i32 6, i32 8, i32* %2)
ret i32 0
}
void sysfs_remove_link(struct kobject *x, char const *name) { return; }


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
define void @sysfs_remove_link(%struct.kobject* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
zge() { callrts("ccge"); }


x86 assembly (clang, -O0):
<zge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zge>:
lea    0xee9(%rip),%rdi
jmp    1030 <callrts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ccge\00"
define i32 @zge() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccge\00"
define i32 @zge() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
char test9(void) { return '\e'; }


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
mov    $0x1b,%al
ret

LLVM IR (-O0):
define signext i8 @test9() {
ret i8 27
}

LLVM IR (-O2):
define signext i8 @test9() {
ret i8 27
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ recoverableError(char *);
int /*<<< orphan*/ stderr;
void sourceMaxLinesError() {
  recoverableError(
      "Maximun number of Asm lines reached. Your source code is too big");
  fprintf(stderr, "     The maximun number of lines accepted are %d\n", 30000);
  exit(1);
}


x86 assembly (clang, -O0):
<sourceMaxLinesError>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <recoverableError@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xef1(%rip),%rsi
mov    $0x7530,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sourceMaxLinesError>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <recoverableError@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xef4(%rip),%rsi
mov    $0x7530,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Maximun number of Asm lines reached. Your source code is too big\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c" The maximun number of lines accepted are %d\0A\00"
define void @sourceMaxLinesError() {
%1 = call i32 @recoverableError(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 30000)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [65 x i8] c"Maximun number of Asm lines reached. Your source code is too big\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c" The maximun number of lines accepted are %d\0A\00"
define void @sourceMaxLinesError() {
%1 = tail call i32 @recoverableError(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 30000)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void coreinit(short *p1, short *p2) {}


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

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

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

LLVM IR (-O2):
define void @coreinit(i16* nocapture %0, i16* nocapture %1) {
ret void
}
int _lseek(int file, int ptr, int dir) {
  (void)file;
  (void)ptr;
  (void)dir;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int fn_arg_float_ptr(double *f) {
  printf("passed value is %lf\n", *f);
  *f = 100.97;
  return 0;
}


x86 assembly (clang, -O0):
<fn_arg_float_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_arg_float_ptr>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movabs $0x40593e147ae147ae,%rax
3e 59 40
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"passed value is %lf\0A\00"
define i32 @fn_arg_float_ptr(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %4)
%6 = load double*, double** %2
store double 1.009700e+02, double* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"passed value is %lf\0A\00"
define i32 @fn_arg_float_ptr(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %2)
store double 1.009700e+02, double* %0
ret i32 0
}
/* Type definitions */
struct stopwatch {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stopwatch_init_usecs_expire(struct stopwatch *, int);
void stopwatch_init_msecs_expire(struct stopwatch *sw, long ms) {
  stopwatch_init_usecs_expire(sw, (1000000 / 1000) * ms);
}


x86 assembly (clang, -O0):
<stopwatch_init_msecs_expire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0x3e8,-0x10(%rbp),%rax
mov    %eax,%esi
call   1030 <stopwatch_init_usecs_expire@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopwatch_init_msecs_expire>:
imul   $0x3e8,%esi,%esi
jmp    1030 <stopwatch_init_usecs_expire@plt>

LLVM IR (-O0):
%struct.stopwatch = type { i32 }
define void @stopwatch_init_msecs_expire(%struct.stopwatch* %0, i64 %1) {
%3 = alloca %struct.stopwatch*
%4 = alloca i64
store %struct.stopwatch* %0, %struct.stopwatch** %3
store i64 %1, i64* %4
%5 = load %struct.stopwatch*, %struct.stopwatch** %3
%6 = load i64, i64* %4
%7 = mul nsw i64 1000, %6
%8 = trunc i64 %7 to i32
%9 = call i32 @stopwatch_init_usecs_expire(%struct.stopwatch* %5, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.stopwatch = type { i32 }
define void @stopwatch_init_msecs_expire(%struct.stopwatch* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = mul i32 %3, 1000
%5 = tail call i32 @stopwatch_init_usecs_expire(%struct.stopwatch* %0, i32 %4)
ret void
}
int aplusb(int a, int b) {
  if (a >= 0 && b >= 0) {
    return a | b;
  }
}


x86 assembly (clang, -O0):
<aplusb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <aplusb+0x27>
cmpl   $0x0,-0xc(%rbp)
jl     1127 <aplusb+0x27>
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @aplusb(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 = icmp sge i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = or i32 %12, %13
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %8, %2
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @aplusb(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
off_t mus_oclamp(off_t lo, off_t val, off_t hi) {
  if (val > hi)
    return (hi);
  else if (val < lo)
    return (lo);
  else
    return (val);
}


x86 assembly (clang, -O0):
<mus_oclamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    112b <mus_oclamp+0x2b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <mus_oclamp+0x4e>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1146 <mus_oclamp+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <mus_oclamp+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_oclamp>:
mov    %rdi,%rax
cmp    %rdi,%rsi
cmovge %rsi,%rax
cmp    %rdx,%rsi
cmovg  %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @mus_oclamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %1, %2
%5 = icmp slt i64 %1, %0
%6 = select i1 %5, i64 %0, i64 %1
%7 = select i1 %4, i64 %2, i64 %6
ret i64 %7
}
int test_imm_81uint16_mem(unsigned short *val) {
  return ((*val) & (0x81 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_81uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 129
%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_81uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 129
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _RPyGilRelease();
extern __attribute__((visibility("hidden"))) void RPyGilRelease(void) {
  _RPyGilRelease();
}


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

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

LLVM IR (-O0):
define hidden void @RPyGilRelease() {
%1 = call i32 (...) @_RPyGilRelease()
ret void
}

LLVM IR (-O2):
define hidden void @RPyGilRelease() {
%1 = tail call i32 (...) @_RPyGilRelease()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t __bmsgsize(uint8_t *ptr) {
  return (*ptr << 24) + (*(ptr + 1) << 16) + (*(ptr + 2) << 8) + *(ptr + 3);
}


x86 assembly (clang, -O0):
<__bmsgsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bmsgsize>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
add    %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
add    %ecx,%eax
add    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @__bmsgsize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = shl i32 %4, 24
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = add nsw i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = add nsw i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = add nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @__bmsgsize(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = add nsw i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = add nsw i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1892;
  int b = 648;
  while (b != 0) {
    a %= b;
    do {
      int _t = (a);
      (a) = (b);
      (b) = _t;
    } while (0);
  }
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x764,-0x8(%rbp)
movl   $0x288,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115a <main+0x4a>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x288,%edx
mov    $0x764,%eax
nopw   0x0(%rax,%rax,1)
mov    %edx,%esi
cltd
idiv   %esi
mov    %esi,%eax
test   %edx,%edx
jne    1120 <main+0x10>
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1892, %0 ], [ %3, %1 ]
%3 = phi i32 [ 648, %0 ], [ %4, %1 ]
%4 = srem i32 %2, %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p521_carry_mul(uintptr_t, uintptr_t,
                                                uintptr_t);
void fiat_p521_carry_mul(uint64_t out1[9], const uint64_t arg1[9],
                         const uint64_t arg2[9]) {
  internal_fiat_p521_carry_mul((uintptr_t)out1, (uintptr_t)arg1,
                               (uintptr_t)arg2);
}


x86 assembly (clang, -O0):
<fiat_p521_carry_mul>:
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 <internal_fiat_p521_carry_mul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p521_carry_mul>:
jmp    1030 <internal_fiat_p521_carry_mul@plt>

LLVM IR (-O0):
define void @fiat_p521_carry_mul(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p521_carry_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p521_carry_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p521_carry_mul(i64 %4, i64 %5, i64 %6)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_back_real(struct list *, int /*<<< orphan*/);
int /*<<< orphan*/ new_item_by_param(void *, int);
void list_add_back(struct list *list, void *data, int len) {
  list_add_back_real(list, new_item_by_param(data, len));
}


x86 assembly (clang, -O0):
<list_add_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <new_item_by_param@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1030 <list_add_back_real@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_add_back>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
call   1040 <new_item_by_param@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <list_add_back_real@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_add_back(%struct.list* %0, i8* %1, i32 %2) {
%4 = alloca %struct.list*
%5 = alloca i8*
%6 = alloca i32
store %struct.list* %0, %struct.list** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.list*, %struct.list** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @new_item_by_param(i8* %8, i32 %9)
%11 = call i32 @list_add_back_real(%struct.list* %7, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_add_back(%struct.list* %0, i8* %1, i32 %2) {
%4 = tail call i32 @new_item_by_param(i8* %1, i32 %2)
%5 = tail call i32 @list_add_back_real(%struct.list* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, int);
void pushpointer4_(char *ppp) { pushNarray(ppp, 4); }


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

x86 assembly (clang, -O2):
<pushpointer4_>:
mov    $0x4,%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushpointer4_(i8* %0) {
%2 = tail call i32 @pushNarray(i8* %0, i32 4)
ret void
}
/* Variables and functions */
int isalpha(char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isalpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <isalpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <isalpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isalpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned long __cmpxchg_local_generic(volatile void *ptr, unsigned long old,
                                      unsigned long new, int size) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @__cmpxchg_local_generic(i8* %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret i64 0
}

LLVM IR (-O2):
define i64 @__cmpxchg_local_generic(i8* nocapture readnone %0, i64 %1, i64 %2, i32 %3) {
ret i64 0
}
/* Variables and functions */
int char_hexvalue(char);
int char2_hexvalue(char *hn_2_p) {
  return (16 * char_hexvalue(hn_2_p[0]) + char_hexvalue(hn_2_p[1]));
}


x86 assembly (clang, -O0):
<char2_hexvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <char_hexvalue@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <char_hexvalue@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2_hexvalue>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <char_hexvalue@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <char_hexvalue@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @char2_hexvalue(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @char_hexvalue(i8 signext %5)
%7 = mul nsw i32 16, %6
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i32 @char_hexvalue(i8 signext %10)
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @char2_hexvalue(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @char_hexvalue(i8 signext %2)
%4 = shl nsw i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @char_hexvalue(i8 signext %6)
%8 = add nsw i32 %7, %4
ret i32 %8
}
void onPair(void *opaque, const char *key, int nkey, const char *value,
            int nvalue) {
  printf("onPair - key: <%.*s> value: <%.*s>\n", nkey, key, nvalue, value);
}


x86 assembly (clang, -O0):
<onPair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onPair>:
mov    %rcx,%rax
mov    %rsi,%rcx
lea    0xee3(%rip),%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %rax,%r8
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"onPair - key: <%.*s> value: <%.*s>\0A\00"
define void @onPair(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %8
%12 = load i8*, i8** %7
%13 = load i32, i32* %10
%14 = load i8*, i8** %9
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i32 %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"onPair - key: <%.*s> value: <%.*s>\0A\00"
define void @onPair(i8* nocapture readnone %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1, i32 %4, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char);
int main() {
  int a, *ap;
  char *bp;
  a = 305419854;
  ap = &a;
  bp = (char *)ap;
  printf("%d\t 0x%x\t%c\n", a, *ap, *bp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1234564e,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
lea    0xeb6(%rip),%rdi
movsbl (%rax),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1234564e,%esi
mov    $0x1234564e,%edx
mov    $0x4e,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d\09 0x%x\09%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8*
store i32 0, i32* %1
store i32 305419854, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
%6 = bitcast i32* %5 to i8*
store i8* %6, i8** %4
%7 = load i32, i32* %2
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i8 signext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d\09 0x%x\09%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 305419854, i32 305419854, i8 signext 78)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(char const *str) {
  fprintf(stderr, "%s\n", str);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

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

/* Variables and functions */
int is_subwin(int /*<<< orphan*/ const *);
bool ncurses_is_subwin(const WINDOW *win) { return is_subwin(win); }


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

x86 assembly (clang, -O2):
<ncurses_is_subwin>:
jmp    1030 <is_subwin@plt>

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

LLVM IR (-O2):
define i32 @ncurses_is_subwin(i32* %0) {
%2 = tail call i32 @is_subwin(i32* %0)
ret i32 %2
}
follow(c1, r1, r2) {
  register int c;
  if ((c = Getc()) == c1)
    return r1;
  else {
    Ungetc(c);
    return r2;
  }
}


x86 assembly (clang, -O0):
<follow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Getc@plt>
mov    %eax,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jne    114f <follow+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <follow+0x3f>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1040 <Ungetc@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<follow>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Getc@plt>
cmp    %ebx,%eax
je     1142 <follow+0x22>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <Ungetc@plt>
mov    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @follow(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%9 = call i32 (...) @Getc()
store i32 %9, i32* %8
%10 = load i32, i32* %5
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %6
store i32 %13, i32* %4
br label %18
14: ; preds = %3
%15 = load i32, i32* %8
%16 = call i32 (i32, ...) bitcast (i32 (...)* @Ungetc to i32 (i32, ...)*)(i32 %15)
%17 = load i32, i32* %7
store i32 %17, i32* %4
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @follow(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @Getc()
%5 = icmp eq i32 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @Ungetc to i32 (i32, ...)*)(i32 %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %2, %6 ], [ %1, %3 ]
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(3, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_start_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x3,%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):
<copy_start_system_to_container>:
mov    $0x3,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_start_system_to_container() {
%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 3, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 3, i32* undef, i32* undef, double* undef)
ret i32 %1
}