xunge/DecIR huggingface dataset:
/* Variables and functions */
int mySqrt1(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  int res = mySqrt1(101);
  printf("开平方根的结果:%d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x65,%edi
call   1030 <mySqrt1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x65,%edi
call   1040 <mySqrt1@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@.str.1 = [26 x i8] c"\E5\BC\80\E5\B9\B3\E6\96\B9\E6\A0\B9\E7\9A\84\E7\BB\93\E6\9E\9C:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @mySqrt1(i32 101)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"\E5\BC\80\E5\B9\B3\E6\96\B9\E6\A0\B9\E7\9A\84\E7\BB\93\E6\9E\9C:%d\0A\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @mySqrt1(i32 101)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_standard_size_limit(int k, int *szl) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(600, &k, szl, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_standard_size_limit>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x258,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_standard_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 600, i32* %3, i32* %1, double* undef)
ret i32 %4
}
int gcd(int a, int b) {
  int r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  TYPE_2__ *(*sub_image)(TYPE_2__ *, int, int, unsigned int, unsigned int);
};
struct TYPE_4__ {
  TYPE_1__ f;
};
typedef TYPE_2__ XImage;

/* Variables and functions */
void set_XImage_f_sub_image(void *_p, void *_v) {
  ((XImage *)_p)->f.sub_image =
      (XImage * (*)(XImage *, int, int, unsigned, unsigned)) _v;
}


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

x86 assembly (clang, -O2):
<set_XImage_f_sub_image>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { {}* }
define void @set_XImage_f_sub_image(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.TYPE_4__* (%struct.TYPE_4__*, i32, i32, i32, i32)*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%11 = bitcast {}** %10 to %struct.TYPE_4__* (%struct.TYPE_4__*, i32, i32, i32, i32)**
store %struct.TYPE_4__* (%struct.TYPE_4__*, i32, i32, i32, i32)* %6, %struct.TYPE_4__* (%struct.TYPE_4__*, i32, i32, i32, i32)** %11
ret void
}

LLVM IR (-O2):
define void @set_XImage_f_sub_image(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
long _test_and_set(int *, int);
extern __attribute__((always_)) long int testandset(int *spinlock) {
  return _test_and_set(spinlock, 1);
}


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

x86 assembly (clang, -O2):
<testandset>:
mov    $0x1,%esi
jmp    1030 <_test_and_set@plt>

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

LLVM IR (-O2):
define i64 @testandset(i32* %0) {
%2 = tail call i64 @_test_and_set(i32* %0, i32 1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int number = 21;
  foo(&number);
  printf("Number is %d\n", number);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x15,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <foo@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 21, i32* %1
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char *);
int main(int argc, char **argv) { return !strcmp("hello", strdup("hello")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <strdup@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strdup@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char key();
void paren() {
  while (key() != ')')
    ;
}


x86 assembly (clang, -O0):
<paren>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <paren+0x9>
mov    $0x0,%al
call   1030 <key@plt>
movsbl %al,%eax
cmp    $0x29,%eax
je     1131 <paren+0x21>
jmp    1119 <paren+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<paren>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <key@plt>
cmp    $0x29,%al
jne    1120 <paren+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @paren() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @key()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 41
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @paren() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @key()
%3 = icmp eq i8 %2, 41
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ver(int, int, char *);
int main(int argc, char **argv) {
  char buff[] = {'1', '2'};
  ver(1, 2, buff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x12(%rbp),%rdx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <ver@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x3231,0x6(%rsp)
lea    0x6(%rsp),%rdx
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <ver@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
store i16 12849, i16* %3
%5 = call i32 @ver(i32 1, i32 2, i8* %4)
ret i32 0
}
/* Type definitions */
typedef unsigned long u_int16_t;

/* Variables and functions */
void unset_bit_u16(int nr, u_int16_t *addr) {
  addr[nr >> 4] &= ~(1UL << (nr & 15));
}


x86 assembly (clang, -O0):
<unset_bit_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unset_bit_u16>:
mov    %edi,%ecx
and    $0xf,%cl
mov    $0xfffffffffffffffe,%rax
rol    %cl,%rax
sar    $0x4,%edi
movslq %edi,%rcx
and    %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @unset_bit_u16(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 15
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = xor i64 %8, -1
%10 = load i64*, i64** %4
%11 = load i32, i32* %3
%12 = ashr i32 %11, 4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %10, i64 %13
%15 = load i64, i64* %14
%16 = and i64 %15, %9
store i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @unset_bit_u16(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 15
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = xor i64 %5, -1
%7 = ashr i32 %0, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %1, i64 %8
%10 = load i64, i64* %9
%11 = and i64 %10, %6
store i64 %11, i64* %9
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn21() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn21");
  return result;
}


x86 assembly (clang, -O0):
<fn21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn21>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn21\00"
define i8* @fn21() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn21\00"
define i8* @fn21() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
int access(char *, int /*<<< orphan*/);
int Ftest(char *filename) { return (access(filename, R_OK)); }


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

x86 assembly (clang, -O2):
<Ftest>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <access@plt>

LLVM IR (-O0):
@R_OK = global i32 0
define i32 @Ftest(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @R_OK
%5 = call i32 @access(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@R_OK = global i32 0
define i32 @Ftest(i8* nocapture %0) {
%2 = load i32, i32* @R_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_cvolume_divide() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_cvolume_divide"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_sw_cvolume_divide\0A\00"
define i32 @pa_sw_cvolume_divide() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_sw_cvolume_divide\00"
define i32 @pa_sw_cvolume_divide() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ int_mul_add();
int main() {
  int_mul_add();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <int_mul_add@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <int_mul_add@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @int_mul_add()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int foo(_Bool b) { return b | 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
or     $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
%7 = or i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i1 zeroext %0) {
ret i32 1
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime(int *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, int);
void to_date_time(int timestamp, char *datetime) {
  time_t rawtime = timestamp;
  memset(datetime, 0, 24);
  strncpy(datetime, ctime(&rawtime), 24);
}


x86 assembly (clang, -O0):
<to_date_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <ctime@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    $0x18,%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_date_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <memset@plt>
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x18,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @to_date_time(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i8*, i8** %4
%8 = call i32 @memset(i8* %7, i32 0, i32 24)
%9 = load i8*, i8** %4
%10 = call i32 @ctime(i32* %5)
%11 = call i32 @strncpy(i8* %9, i32 %10, i32 24)
ret void
}

LLVM IR (-O2):
define void @to_date_time(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %0, i32* %3
%5 = tail call i32 @memset(i8* %1, i32 0, i32 24)
%6 = call i32 @ctime(i32* %3)
%7 = call i32 @strncpy(i8* %1, i32 %6, i32 24)
ret void
}
char *strcpy(char *dest, const char *src) {
  char *dst = dest;
  while ((*dst = *src) != '\0') {
    src++;
    dst++;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1149 <strcpy+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
scalar_t__ isPrime(long);
long nextPrime(long oldNum) {
  long newNum = oldNum;
  while (1) {
    newNum++;
    if (isPrime(newNum))
      return newNum;
  }
  return -1;
}


x86 assembly (clang, -O0):
<nextPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isPrime@plt>
cmp    $0x0,%rax
je     114d <nextPrime+0x3d>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1124 <nextPrime+0x14>

x86 assembly (clang, -O2):
<nextPrime>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <isPrime@plt>
test   %rax,%rax
je     1120 <nextPrime+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @nextPrime(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
br label %5
5: ; preds = %1, %13
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i64 @isPrime(i64 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = load i64, i64* %3
ret i64 %12
13: ; preds = %5
br label %5
}

LLVM IR (-O2):
define i64 @nextPrime(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %4, %2 ]
%4 = add nsw i64 %3, 1
%5 = tail call i64 @isPrime(i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i64 %4
}
int unknown3() {
  int x;
  return x;
}


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

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

LLVM IR (-O0):
define i32 @unknown3() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @unknown3() {
ret i32 undef
}
/* Variables and functions */
int Pop();
int /*<<< orphan*/ Push(int);
int CmdEorBitwise(void) {
  Push(Pop() ^ Pop());
  return 0;
}


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

x86 assembly (clang, -O2):
<CmdEorBitwise>:
push   %rbx
xor    %eax,%eax
call   1030 <Pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Pop@plt>
xor    %eax,%ebx
mov    %ebx,%edi
call   1040 <Push@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CmdEorBitwise() {
%1 = call i32 (...) @Pop()
%2 = call i32 (...) @Pop()
%3 = xor i32 %1, %2
%4 = call i32 @Push(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdEorBitwise() {
%1 = tail call i32 (...) @Pop()
%2 = tail call i32 (...) @Pop()
%3 = xor i32 %2, %1
%4 = tail call i32 @Push(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glutSolidTeapot(double);
void teapot(void) { glutSolidTeapot(0.3); }


x86 assembly (clang, -O0):
<teapot>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<teapot>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <glutSolidTeapot@plt>

LLVM IR (-O0):
define void @teapot() {
%1 = call i32 @glutSolidTeapot(double 3.000000e-01)
ret void
}

LLVM IR (-O2):
define void @teapot() {
%1 = tail call i32 @glutSolidTeapot(double 3.000000e-01)
ret void
}
void gtk_image_set_from_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_set_from_pixbuf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short);
__attribute__((no, noclone)) unsigned short f3(unsigned short x,
                                               unsigned short y) {
  unsigned short r = x + y;
  if (x < r)
    foo(r);
  return r;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    114d <f3+0x3d>
movzwl -0x6(%rbp),%edi
call   1030 <foo@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %esi,%ebx
add    %edi,%ebx
cmp    %di,%bx
jbe    1122 <f3+0x12>
movzwl %bx,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define zeroext i16 @f3(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %1, %0
%4 = icmp ugt i16 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i16 zeroext %3)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
void foo48() {}


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

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

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

LLVM IR (-O2):
define void @foo48() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ one(int);
int main() {
  int help = 1;
  one(help);
  return help;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <one@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <one@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @one(i32 1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void bwa_print_sam_PG() {
  printf("@PG\tID:bwa\tPN:bwa\tVN:%s\n", "0.6.2-r126");
}


x86 assembly (clang, -O0):
<bwa_print_sam_PG>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef7(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwa_print_sam_PG>:
lea    0xee9(%rip),%rdi
lea    0xefb(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"@PG\09ID:bwa\09PN:bwa\09VN:%s\0A\00"
@.str.1 = [11 x i8] c"0.6.2-r126\00"
define void @bwa_print_sam_PG() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"@PG\09ID:bwa\09PN:bwa\09VN:%s\0A\00"
@.str.1 = [11 x i8] c"0.6.2-r126\00"
define void @bwa_print_sam_PG() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int square(int);
int main() {
  int i = 2;
  int j = square(i);
  printf("The square of %d is %d\n", i, j);
  j = square(10);
  printf("The square of 10 is %d\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <square@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <square@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <square@plt>
lea    0xece(%rip),%rdi
mov    $0x2,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <square@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"The square of %d is %d\0A\00"
@.str.1 = [24 x i8] c"The square of 10 is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @square(i32 2)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32 %1)
%3 = tail call i32 @square(i32 10)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ run_mapper();
int main() {
  run_mapper();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run_mapper@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @run_mapper()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @run_mapper()
ret i32 0
}
/* Variables and functions */
int f393(int *);
int f394(int *p) { return f393(p); }


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

x86 assembly (clang, -O2):
<f394>:
jmp    1030 <f393@plt>

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

LLVM IR (-O2):
define i32 @f394(i32* %0) {
%2 = tail call i32 @f393(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_CONT;
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/);
int ptrace_continue(pid_t pid) { return ptrace(PTRACE_CONT, pid, NULL, 0); }


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

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

LLVM IR (-O0):
@PTRACE_CONT = global i32 0
define i32 @ptrace_continue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_CONT
%4 = load i32, i32* %2
%5 = call i32 @ptrace(i32 %3, i32 %4, i32* null, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@PTRACE_CONT = global i32 0
define i32 @ptrace_continue(i32 %0) {
%2 = load i32, i32* @PTRACE_CONT
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32* null, i32 0)
ret i32 %3
}
void swap_ptr(void **x, void **y) {
  void *t = *x;
  *x = *y;
  *y = t;
}


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

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

LLVM IR (-O0):
define void @swap_ptr(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap_ptr(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prt(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void do_cmd_unknown(void) {
  prt("'?':help, mouseclick on player:command suggestions, CTRL-h:complete "
      "command list.",
      0, 0);
}


x86 assembly (clang, -O0):
<do_cmd_unknown>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <prt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_unknown>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <prt@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"'?':help, mouseclick on player:command suggestions, CTRL-h:complete command list.\00"
define void @do_cmd_unknown() {
%1 = call i32 @prt(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [82 x i8] c"'?':help, mouseclick on player:command suggestions, CTRL-h:complete command list.\00"
define void @do_cmd_unknown() {
%1 = tail call i32 @prt(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setchr8(int /*<<< orphan*/);
int /*<<< orphan*/ setprg16(int, int /*<<< orphan*/);
int /*<<< orphan*/ setprg2r(int, int, int);
int /*<<< orphan*/ setprg8r(int, int, int);
void Sync(void) {
  setprg2r(0x10, 0x0800, 0);
  setprg2r(0x10, 0x1000, 1);
  setprg2r(0x10, 0x1800, 2);
  setprg8r(0x10, 0x6000, 1);
  setprg16(0x8000, 0);
  setprg16(0xC000, ~0);
  setchr8(0);
}


x86 assembly (clang, -O0):
<Sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
mov    $0x800,%esi
xor    %edx,%edx
call   1060 <setprg2r@plt>
mov    $0x10,%edi
mov    $0x1000,%esi
mov    $0x1,%edx
call   1060 <setprg2r@plt>
mov    $0x10,%edi
mov    $0x1800,%esi
mov    $0x2,%edx
call   1060 <setprg2r@plt>
mov    $0x10,%edi
mov    $0x6000,%esi
mov    $0x1,%edx
call   1050 <setprg8r@plt>
mov    $0x8000,%edi
xor    %esi,%esi
call   1030 <setprg16@plt>
mov    $0xc000,%edi
mov    $0xffffffff,%esi
call   1030 <setprg16@plt>
xor    %edi,%edi
call   1040 <setchr8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sync>:
push   %rax
mov    $0x10,%edi
mov    $0x800,%esi
xor    %edx,%edx
call   1060 <setprg2r@plt>
mov    $0x10,%edi
mov    $0x1000,%esi
mov    $0x1,%edx
call   1060 <setprg2r@plt>
mov    $0x10,%edi
mov    $0x1800,%esi
mov    $0x2,%edx
call   1060 <setprg2r@plt>
mov    $0x10,%edi
mov    $0x6000,%esi
mov    $0x1,%edx
call   1050 <setprg8r@plt>
mov    $0x8000,%edi
xor    %esi,%esi
call   1030 <setprg16@plt>
mov    $0xc000,%edi
mov    $0xffffffff,%esi
call   1030 <setprg16@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <setchr8@plt>

LLVM IR (-O0):
define void @Sync() {
%1 = call i32 @setprg2r(i32 16, i32 2048, i32 0)
%2 = call i32 @setprg2r(i32 16, i32 4096, i32 1)
%3 = call i32 @setprg2r(i32 16, i32 6144, i32 2)
%4 = call i32 @setprg8r(i32 16, i32 24576, i32 1)
%5 = call i32 @setprg16(i32 32768, i32 0)
%6 = call i32 @setprg16(i32 49152, i32 -1)
%7 = call i32 @setchr8(i32 0)
ret void
}

LLVM IR (-O2):
define void @Sync() {
%1 = tail call i32 @setprg2r(i32 16, i32 2048, i32 0)
%2 = tail call i32 @setprg2r(i32 16, i32 4096, i32 1)
%3 = tail call i32 @setprg2r(i32 16, i32 6144, i32 2)
%4 = tail call i32 @setprg8r(i32 16, i32 24576, i32 1)
%5 = tail call i32 @setprg16(i32 32768, i32 0)
%6 = tail call i32 @setprg16(i32 49152, i32 -1)
%7 = tail call i32 @setchr8(i32 0)
ret void
}
void wifi_rsp_system_hello(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @wifi_rsp_system_hello(i8* nocapture %0) {
ret void
}
char *RCSid() {
  return RCSid("$Id: doc2rtf.c,v 1.16 2007/10/24 00:47:51 sfeam Exp $");
}


x86 assembly (clang, -O0):
<RCSid>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <RCSid@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [54 x i8] c"$Id: doc2rtf.c,v 1.16 2007/10/24 00:47:51 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
void kasan_cache_shutdown(struct kmem_cache *cache) {}


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

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

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

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @kasan_cache_shutdown(%struct.kmem_cache* nocapture %0) {
ret void
}
unsigned long sme_get_me_mask(void) { return 0UL; }


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

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

LLVM IR (-O0):
define i64 @sme_get_me_mask() {
ret i64 0
}

LLVM IR (-O2):
define i64 @sme_get_me_mask() {
ret i64 0
}
int gb2hz_init(arg)
char *arg;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @gb2hz_init(i8* nocapture readnone %0) {
ret i32 0
}
char f1(char *p, int i) { return p[i]; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @f1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @f1(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
test11a(int *x) {
  for (*x;;)
    (putchar(*x++));
}


x86 assembly (clang, -O0):
<test11a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <test11a+0xc>

x86 assembly (clang, -O2):
<test11a>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%edi
add    $0x4,%rbx
call   1030 <putchar@plt>
jmp    1120 <test11a+0x10>

LLVM IR (-O0):
define i32 @test11a(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
br label %5
5: ; preds = %5, %1
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %2
%8 = load i32, i32* %6
%9 = call i32 @putchar(i32 %8)
br label %5
}

LLVM IR (-O2):
define i32 @test11a(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %3
%6 = tail call i32 @putchar(i32 %5)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ sgn(int const);
int modPos(int const n, int const b) {
  return (sgn(n % b) != -sgn(b)) ? n % b : (n % b + b);
}


x86 assembly (clang, -O0):
<modPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
call   1030 <sgn@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sgn@plt>
mov    %eax,%edx
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
je     1157 <modPos+0x47>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
jmp    1166 <modPos+0x56>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modPos>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%ebp
mov    %edx,%edi
call   1030 <sgn@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <sgn@plt>
xor    %ecx,%ecx
add    %r14d,%eax
cmove  %ebx,%ecx
add    %ebp,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @modPos(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = tail call i32 @sgn(i32 %3)
%5 = tail call i32 @sgn(i32 %1)
%6 = sub nsw i32 0, %5
%7 = icmp eq i32 %4, %6
%8 = select i1 %7, i32 %1, i32 0
%9 = add nsw i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ consoleBufferOpen();
int /*<<< orphan*/ disableRawMode();
int /*<<< orphan*/ editorRefreshScreen();
int /*<<< orphan*/ enableRawMode();
void editorHandleSigcont() {
  disableRawMode();
  consoleBufferOpen();
  enableRawMode();
  editorRefreshScreen();
}


x86 assembly (clang, -O0):
<editorHandleSigcont>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <disableRawMode@plt>
mov    $0x0,%al
call   1050 <consoleBufferOpen@plt>
mov    $0x0,%al
call   1030 <enableRawMode@plt>
mov    $0x0,%al
call   1060 <editorRefreshScreen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<editorHandleSigcont>:
push   %rax
xor    %eax,%eax
call   1040 <disableRawMode@plt>
xor    %eax,%eax
call   1050 <consoleBufferOpen@plt>
xor    %eax,%eax
call   1030 <enableRawMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <editorRefreshScreen@plt>

LLVM IR (-O0):
define void @editorHandleSigcont() {
%1 = call i32 (...) @disableRawMode()
%2 = call i32 (...) @consoleBufferOpen()
%3 = call i32 (...) @enableRawMode()
%4 = call i32 (...) @editorRefreshScreen()
ret void
}

LLVM IR (-O2):
define void @editorHandleSigcont() {
%1 = tail call i32 (...) @disableRawMode()
%2 = tail call i32 (...) @consoleBufferOpen()
%3 = tail call i32 (...) @enableRawMode()
%4 = tail call i32 (...) @editorRefreshScreen()
ret void
}