xunge/DecIR huggingface dataset:
unsigned long long int
unsignedlonglongint_ignoring_unsignedlonglong(unsigned long long int x,
                                              unsigned long long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlonglongint_ignoring_unsignedlonglong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
void gtk_tree_model_row_deleted() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dstdevyc(int, int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dstdevyc(N, 1, x, stride);
  printf("sample standard deviation: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%ecx
mov    $0x1,%esi
call   1040 <stdlib_strided_dstdevyc@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1040 <stdlib_strided_dstdevyc@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [32 x i8] c"sample standard deviation: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dstdevyc(i32 %6, i32 1, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [32 x i8] c"sample standard deviation: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dstdevyc(i32 4, i32 1, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int f353(int *);
int f354(int *p) { return f353(p); }


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

x86 assembly (clang, -O2):
<f354>:
jmp    1030 <f353@plt>

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

LLVM IR (-O2):
define i32 @f354(i32* %0) {
%2 = tail call i32 @f353(i32* %0)
ret i32 %2
}
void ff_hevc_put_hevc_qpel_v64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v64_10_sse4() {
ret void
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ pow(double, int);
double PairPotential(double r) {
  double ret = exp(-pow((r), 4));
  return ret;
}


x86 assembly (clang, -O0):
<PairPotential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PairPotential>:
push   %rax
mov    $0x4,%edi
call   1040 <pow@plt>
neg    %eax
mov    %eax,%edi
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @PairPotential(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @pow(double %4, i32 4)
%6 = sub nsw i32 0, %5
%7 = call double @exp(i32 %6)
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @PairPotential(double %0) {
%2 = tail call i32 @pow(double %0, i32 4)
%3 = sub nsw i32 0, %2
%4 = tail call double @exp(i32 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ i80186rep(int /*<<< orphan*/);
void i80186_repne() { i80186rep(0); }


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

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

LLVM IR (-O0):
define void @i80186_repne() {
%1 = call i32 @i80186rep(i32 0)
ret void
}

LLVM IR (-O2):
define void @i80186_repne() {
%1 = tail call i32 @i80186rep(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void out_8(int word) { putchar(word & 0xFF); }


x86 assembly (clang, -O0):
<out_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_8>:
movzbl %dil,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @out_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @putchar(i32 %4)
ret void
}

LLVM IR (-O2):
define void @out_8(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @putchar(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void foo(char *p) {
  for (;;) {
    memcpy(p, p + 1, strlen(p));
    p++;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    112c <foo+0xc>

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    %r14,%rbx
jmp    1130 <foo+0x10>

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %3, %1
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @memcpy(i8* %4, i8* %6, i32 %8)
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %3
}

LLVM IR (-O2):
define void @foo(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = tail call i32 @strlen(i8* %3)
%6 = tail call i32 @memcpy(i8* %3, i8* %4, i32 %5)
br label %2
}
/* Variables and functions */
void *alloc(unsigned int);
void *talloc(unsigned s) { return alloc(s); }


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

x86 assembly (clang, -O2):
<talloc>:
jmp    1030 <alloc@plt>

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

LLVM IR (-O2):
define i8* @talloc(i32 %0) {
%2 = tail call i8* @alloc(i32 %0)
ret i8* %2
}
/* Type definitions */
struct drunkard {
  int dummy;
};

/* Variables and functions */
scalar_t__ drunkard_rng_chance(struct drunkard *, double);
int /*<<< orphan*/ drunkard_start_random_northsouth_edge(struct drunkard *);
int /*<<< orphan*/ drunkard_start_random_westeast_edge(struct drunkard *);
void drunkard_start_random_edge(struct drunkard *drunk) {
  if (drunkard_rng_chance(drunk, 0.5))
    drunkard_start_random_westeast_edge(drunk);
  else
    drunkard_start_random_northsouth_edge(drunk);
}


x86 assembly (clang, -O0):
<drunkard_start_random_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xeb8(%rip),%xmm0
call   1040 <drunkard_rng_chance@plt>
cmp    $0x0,%rax
je     1165 <drunkard_start_random_edge+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <drunkard_start_random_westeast_edge@plt>
jmp    116e <drunkard_start_random_edge+0x3e>
mov    -0x8(%rbp),%rdi
call   1050 <drunkard_start_random_northsouth_edge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drunkard_start_random_edge>:
push   %rbx
mov    %rdi,%rbx
movsd  0xec4(%rip),%xmm0
call   1040 <drunkard_rng_chance@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114f <drunkard_start_random_edge+0x1f>
pop    %rbx
jmp    1030 <drunkard_start_random_westeast_edge@plt>
pop    %rbx
jmp    1050 <drunkard_start_random_northsouth_edge@plt>

LLVM IR (-O0):
%struct.drunkard = type { i32 }
define void @drunkard_start_random_edge(%struct.drunkard* %0) {
%2 = alloca %struct.drunkard*
store %struct.drunkard* %0, %struct.drunkard** %2
%3 = load %struct.drunkard*, %struct.drunkard** %2
%4 = call i64 @drunkard_rng_chance(%struct.drunkard* %3, double 5.000000e-01)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.drunkard*, %struct.drunkard** %2
%8 = call i32 @drunkard_start_random_westeast_edge(%struct.drunkard* %7)
br label %12
9: ; preds = %1
%10 = load %struct.drunkard*, %struct.drunkard** %2
%11 = call i32 @drunkard_start_random_northsouth_edge(%struct.drunkard* %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
%struct.drunkard = type { i32 }
define void @drunkard_start_random_edge(%struct.drunkard* %0) {
%2 = tail call i64 @drunkard_rng_chance(%struct.drunkard* %0, double 5.000000e-01)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @drunkard_start_random_westeast_edge(%struct.drunkard* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @drunkard_start_random_northsouth_edge(%struct.drunkard* %0)
br label %8
8: ; preds = %6, %4
ret void
}
int h_acceptable(void *expv, struct dentry *dentry) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @h_acceptable(i8* nocapture readnone %0, %struct.dentry* nocapture readnone %1) {
ret i32 1
}
int test_imm_44uint8_mem(unsigned char *val) {
  return ((*val) & (-0x44 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_44uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -68
%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_44uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -68
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(void) { fputs("hello\n", stderr); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello\0A\00"
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
char *getsenv(char *s) {
  char *t = getenv(s);
  if (t)
    return t;
  return "";
}


x86 assembly (clang, -O0):
<getsenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1141 <getsenv+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <getsenv+0x3c>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsenv>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getsenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @getenv(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getsenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("ea_multi_xma 0.2\n");
  printf("usage:\n");
  printf("ea_multi_xma infile [-o 0xOffset]\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"ea_multi_xma 0.2\0A\00"
@.str.1 = [8 x i8] c"usage:\0A\00"
@.str.2 = [35 x i8] c"ea_multi_xma infile [-o 0xOffset]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"ea_multi_xma 0.2\00"
@str.3 = [7 x i8] c"usage:\00"
@str.4 = [34 x i8] c"ea_multi_xma infile [-o 0xOffset]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
ret void
}
int *func1(void) {
  int i;
  return &i;
}


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

x86 assembly (clang, -O2):
<func1>:
lea    -0x4(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @func1() {
%1 = alloca i32
ret i32* %1
}

LLVM IR (-O2):
define noalias i32* @func1() {
%1 = alloca i32
ret i32* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ stack_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_sigaltstack;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ const *,
            int /*<<< orphan*/ *);
int dosemu_sigaltstack(const stack_t *ss, stack_t *oss) {
  return syscall(SYS_sigaltstack, ss, oss);
}


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

x86 assembly (clang, -O2):
<dosemu_sigaltstack>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_sigaltstack = global i32 0
define i32 @dosemu_sigaltstack(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @SYS_sigaltstack
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @syscall(i32 %5, i32* %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@SYS_sigaltstack = global i32 0
define i32 @dosemu_sigaltstack(i32* %0, i32* %1) {
%3 = load i32, i32* @SYS_sigaltstack
%4 = tail call i32 @syscall(i32 %3, i32* %0, i32* %1)
ret i32 %4
}
int fun1234() { return 1234; }


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

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

LLVM IR (-O0):
define i32 @fun1234() {
ret i32 1234
}

LLVM IR (-O2):
define i32 @fun1234() {
ret i32 1234
}
/* Variables and functions */
int memcpy(int, int, int);
memcpy_tofs(int x, int y, int z) { return memcpy(x, y, z); }


x86 assembly (clang, -O0):
<memcpy_tofs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_tofs>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i32 @memcpy_tofs(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
%10 = call i32 @memcpy(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @memcpy_tofs(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @memcpy(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
size_t pad32(size_t len) { return (sizeof(uint32_t) * ((len + 3) / 4)); }


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

x86 assembly (clang, -O2):
<pad32>:
lea    0x3(%rdi),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @pad32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3
%5 = udiv i64 %4, 4
%6 = mul i64 4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @pad32(i64 %0) {
%2 = add i64 %0, 3
%3 = and i64 %2, -4
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, int);
void Move_Ret_To_Foreign_D(int index) {
  Inst_Printf("fstpl", "pl_foreign_double+%d", index * 8);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Foreign_D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Foreign_D>:
lea    0x0(,%rdi,8),%edx
lea    0xee2(%rip),%rdi
lea    0xee1(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"fstpl\00"
@.str.1 = [21 x i8] c"pl_foreign_double+%d\00"
define void @Move_Ret_To_Foreign_D(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
%5 = call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"fstpl\00"
@.str.1 = [21 x i8] c"pl_foreign_double+%d\00"
define void @Move_Ret_To_Foreign_D(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stackDecrement(int, int);
void stackIncrement(int context, int indexFromTop) {
  stackDecrement(context, -indexFromTop);
}


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

x86 assembly (clang, -O2):
<stackIncrement>:
neg    %esi
jmp    1030 <stackDecrement@plt>

LLVM IR (-O0):
define void @stackIncrement(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 = sub nsw i32 0, %6
%8 = call i32 @stackDecrement(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @stackIncrement(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @stackDecrement(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
bool is_int(const char *p) { return (*p) & 0x80; }


x86 assembly (clang, -O0):
<is_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_int>:
movzbl (%rdi),%eax
and    $0xffffff80,%eax
ret

LLVM IR (-O0):
define i32 @is_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 128
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -128
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ ulong;

/* Variables and functions */
int asm_cmp64(ulong *a, ulong *b) {
  if (a[0] != b[0])
    return 1;
  if (a[1] != b[1])
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<asm_cmp64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
je     112c <asm_cmp64+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1155 <asm_cmp64+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    0x8(%rcx),%rax
je     114e <asm_cmp64+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <asm_cmp64+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asm_cmp64>:
mov    (%rdi),%rcx
mov    $0x1,%eax
cmp    (%rsi),%rcx
jne    111a <asm_cmp64+0x1a>
mov    0x8(%rdi),%rcx
xor    %eax,%eax
cmp    0x8(%rsi),%rcx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @asm_cmp64(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i64, i64* %0, i64 1
%8 = load i64, i64* %7
%9 = getelementptr inbounds i64, i64* %1, i64 1
%10 = load i64, i64* %9
%11 = icmp ne i64 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 1, %2 ], [ %12, %6 ]
ret i32 %14
}
/* Type definitions */
struct net_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ netif_start_queue(struct net_device *);
void netif_tx_start_all_queues(struct net_device *dev) {
  netif_start_queue(dev);
}


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

x86 assembly (clang, -O2):
<netif_tx_start_all_queues>:
jmp    1030 <netif_start_queue@plt>

LLVM IR (-O0):
%struct.net_device = type { i32 }
define void @netif_tx_start_all_queues(%struct.net_device* %0) {
%2 = alloca %struct.net_device*
store %struct.net_device* %0, %struct.net_device** %2
%3 = load %struct.net_device*, %struct.net_device** %2
%4 = call i32 @netif_start_queue(%struct.net_device* %3)
ret void
}

LLVM IR (-O2):
%struct.net_device = type { i32 }
define void @netif_tx_start_all_queues(%struct.net_device* %0) {
%2 = tail call i32 @netif_start_queue(%struct.net_device* %0)
ret void
}
/* Variables and functions */
int sqrt(int);
int is_prime(int a) {
  for (int i = 2; i <= sqrt(a); i++) {
    if (a % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     116c <is_prime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <is_prime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1173 <is_prime+0x63>
jmp    115e <is_prime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <is_prime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
jl     1152 <is_prime+0x42>
mov    $0x1,%ebx
nopl   (%rax)
add    $0x1,%ebx
mov    %r14d,%eax
cltd
idiv   %ebx
mov    %edx,%ebp
test   %edx,%edx
je     114b <is_prime+0x3b>
mov    %r14d,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <is_prime+0x20>
xor    %eax,%eax
test   %ebp,%ebp
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %15, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 2, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4
%13 = xor i1 %11, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %1
%16 = phi i32 [ 1, %1 ], [ %14, %12 ]
ret i32 %16
}
int change_velocity(position, downcase, upcase) {
  if ((position == downcase) || (position == upcase))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<change_velocity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1125 <change_velocity+0x25>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1131 <change_velocity+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <change_velocity+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_velocity>:
cmp    %esi,%edi
sete   %al
cmp    %edx,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @change_velocity(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
%5 = icmp eq i32 %0, %2
%6 = or i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void strncpy_no_null_1_Bad_FN() {
  char src[5] = "test";
  src[4] = 'a';
  char dst[10];
  strncpy(dst, src, 5);
  int a[10];
  a[strlen(dst)] = 0;
}


x86 assembly (clang, -O0):
<strncpy_no_null_1_Bad_FN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
movb   $0x61,-0x1(%rbp)
lea    -0xf(%rbp),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
lea    -0xf(%rbp),%rdi
call   1040 <strlen@plt>
movl   $0x0,-0x40(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_no_null_1_Bad_FN>:
sub    $0x18,%rsp
movl   $0x74736574,0x8(%rsp)
74
movb   $0x61,0xc(%rsp)
lea    0xe(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.strncpy_no_null_1_Bad_FN.src = [5 x i8] c"test\00"
define void @strncpy_no_null_1_Bad_FN() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = alloca [10 x i32]
%4 = bitcast [5 x i8]* %1 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
store i8 97, i8* %5
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%8 = call i32 @strncpy(i8* %6, i8* %7, i32 5)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = call i64 @strlen(i8* %9)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %10
store i32 0, i32* %11
ret void
}

LLVM IR (-O2):
define void @strncpy_no_null_1_Bad_FN() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = bitcast [5 x i8]* %1 to i32*
store i32 1953719668, i32* %4
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
store i8 97, i8* %5
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @strncpy(i8* %6, i8* %3, i32 5)
ret void
}
void warnsay(s) char const *s;
{ startsay(s, "warning: "); }


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

x86 assembly (clang, -O2):
<warnsay>:
lea    0xee9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <startsay@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"warning: \00"
define void @warnsay(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @startsay to i32 (i8*, i8*, ...)*)(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"warning: \00"
define void @warnsay(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @startsay to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_rand32();
double to_real3(int /*<<< orphan*/);
double genrand_real3(void) { return to_real3(gen_rand32()); }


x86 assembly (clang, -O0):
<genrand_real3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gen_rand32@plt>
mov    %eax,%edi
call   1030 <to_real3@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define double @genrand_real3() {
%1 = call i32 (...) @gen_rand32()
%2 = call double @to_real3(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @genrand_real3() {
%1 = tail call i32 (...) @gen_rand32()
%2 = tail call double @to_real3(i32 %1)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned int i;
  i = -1;
  printf("When unsigned integer is set to -1, it equals %u\n", i);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"When unsigned integer is set to -1, it equals %u\0A\00"
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 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"When unsigned integer is set to -1, it equals %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Variables and functions */
unsigned long update_adler32(long, unsigned char *, int);
unsigned long nbase_adler32(unsigned char *buf, int len) {
  return update_adler32(1L, buf, len);
}


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

x86 assembly (clang, -O2):
<nbase_adler32>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <update_adler32@plt>

LLVM IR (-O0):
define i64 @nbase_adler32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @update_adler32(i64 1, i8* %5, i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @nbase_adler32(i8* %0, i32 %1) {
%3 = tail call i64 @update_adler32(i64 1, i8* %0, i32 %1)
ret i64 %3
}
/* Variables and functions */
char getchar();
char no_newlines_getchar(void) {
  char key;
  do {
    key = getchar();
  } while (key == '\n');
  return key;
}


x86 assembly (clang, -O0):
<no_newlines_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1118 <no_newlines_getchar+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_newlines_getchar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1120 <no_newlines_getchar+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @no_newlines_getchar() {
%1 = alloca i8
br label %2
2: ; preds = %4, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
br i1 %7, label %2, label %8
8: ; preds = %4
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @no_newlines_getchar() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %1, label %4
4: ; preds = %1
ret i8 %2
}
/* Type definitions */
struct tms {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int _times(struct tms *buf) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<_times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_times>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
@EACCES = global i32 0
@errno = global i32 0
define i32 @_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load i32, i32* @EACCES
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@EACCES = global i32 0
@errno = global i32 0
define i32 @_times(%struct.tms* nocapture readnone %0) {
%2 = load i32, i32* @EACCES
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  pid_t f1, f2, f3, f4;
  f1 = fork();
  if (f1 == 0) {
    printf("A\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <main+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    1139 <main+0x19>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"A\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, char const *, char const *,
                          char const *);
void print_usage(const char *binary_name) {
  const char *format =
      "Usage: %s [options]\n"
      "Options:\n"
      "    -c <procotol://address>  connect to the remote address\n"
      "    -m <message>  transfer message to peer\n"
      "Examples:\n"
      "    %s -c ipc:///tmp/uds.ipc -m \"Hello libgs!\"\n"
      "    %s -c tcp://127.0.0.1:10000 -m \"Hello libgs!\"\n"
      "\n";
  printf(format, binary_name, binary_name, binary_name);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [240 x i8] c"Usage: %s [options]\0AOptions:\0A -c <procotol://address> connect to the remote address\0A -m <message> transfer message to peer\0AExamples:\0A %s -c ipc:///tmp/uds.ipc -m \22Hello libgs!\22\0A %s -c tcp://127.0.0.1:10000 -m \22Hello libgs!\22\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [240 x i8] c"Usage: %s [options]\0AOptions:\0A -c <procotol://address> connect to the remote address\0A -m <message> transfer message to peer\0AExamples:\0A %s -c ipc:///tmp/uds.ipc -m \22Hello libgs!\22\0A %s -c tcp://127.0.0.1:10000 -m \22Hello libgs!\22\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0)
ret void
}
void foo(void) {
  int i = 0;
  i++;
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
void I420ToI422() {}


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

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

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

LLVM IR (-O2):
define void @I420ToI422() {
ret void
}
int fibonacci(int n) {
  if (n < 1) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <fibonacci+0x30>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
xor    %r14d,%r14d
test   %ebp,%ebp
je     1145 <fibonacci+0x35>
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%r14d
add    $0xfffffffe,%ebp
cmp    $0x2,%ebx
mov    %ecx,%ebx
ja     1120 <fibonacci+0x10>
xor    %eax,%eax
jmp    114a <fibonacci+0x3a>
xor    %r14d,%r14d
jmp    114d <fibonacci+0x3d>
mov    $0x1,%eax
add    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp eq i32 %4, 1
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @fibonacci(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
%12 = icmp ult i32 %4, 3
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ %11, %7 ], [ %5, %3 ]
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void memory_exhausted() {
  fprintf(stderr, "error: cannot allocate memory\n");
  abort();
}


x86 assembly (clang, -O0):
<memory_exhausted>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<memory_exhausted>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"error: cannot allocate memory\0A\00"
define void @memory_exhausted() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"error: cannot allocate memory\0A\00"
define void @memory_exhausted() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int check_password(const char *pass) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_password(i8* nocapture readnone %0) {
ret i32 0
}