xunge/DecIR huggingface dataset:
char *copy(p, ep, s)
register char *p, *s;
char *ep;
{
  while (p < ep && *s) {
    *p++ = *s++;
  }
  return p;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1133 <copy+0x33>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1143 <copy+0x43>
jmp    116a <copy+0x6a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1110 <copy+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    112b <copy+0x2b>
mov    %rsi,%r8
sub    %rax,%r8
xor    %edi,%edi
movzbl (%rdx,%rdi,1),%ecx
test   %cl,%cl
je     1128 <copy+0x28>
mov    %cl,(%rax,%rdi,1)
add    $0x1,%rdi
cmp    %rdi,%r8
jne    1110 <copy+0x10>
mov    %rsi,%rax
ret
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @copy(i8* writeonly %0, i8* readnone %1, i8* nocapture %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = ptrtoint i8* %1 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = getelementptr i8, i8* %0, i64 %8
br label %10
10: ; preds = %5, %15
%11 = phi i8* [ %16, %15 ], [ %2, %5 ]
%12 = phi i8* [ %17, %15 ], [ %0, %5 ]
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = getelementptr inbounds i8, i8* %11, i64 1
%17 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %13, i8* %12
%18 = icmp eq i8* %17, %9
br i1 %18, label %19, label %10
19: ; preds = %10, %15, %3
%20 = phi i8* [ %0, %3 ], [ %9, %15 ], [ %12, %10 ]
ret i8* %20
}
char clearBit_fun_char(char x, unsigned i) { return x & ~(1 << i); }


x86 assembly (clang, -O0):
<clearBit_fun_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBit_fun_char>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
not    %al
and    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @clearBit_fun_char(i8 signext %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 = sext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @clearBit_fun_char(i8 signext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = xor i8 %4, -1
%6 = and i8 %5, %0
ret i8 %6
}
void foo347(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo347(i32 %0) {
ret void
}
int pantech_cdrom_do_cancel_cdrom_mode_timer(struct fsg_common *common,
                                             struct fsg_buffhd *bh) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.fsg_common = type opaque
%struct.fsg_buffhd = type opaque
define i32 @pantech_cdrom_do_cancel_cdrom_mode_timer(%struct.fsg_common* nocapture readnone %0, %struct.fsg_buffhd* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned short ehrpwm_read(int /*<<< orphan*/, int);
int ehrpwm_tz_read_status(uint8_t module, unsigned short *status) {
  *status = ehrpwm_read(module, 0x2C);
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_tz_read_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2c,%esi
call   1030 <ehrpwm_read@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_tz_read_status>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2c,%esi
call   1030 <ehrpwm_read@plt>
mov    %ax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ehrpwm_tz_read_status(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i16*
store i32 %0, i32* %3
store i16* %1, i16** %4
%5 = load i32, i32* %3
%6 = call zeroext i16 @ehrpwm_read(i32 %5, i32 44)
%7 = load i16*, i16** %4
store i16 %6, i16* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @ehrpwm_tz_read_status(i32 %0, i16* nocapture writeonly %1) {
%3 = tail call zeroext i16 @ehrpwm_read(i32 %0, i32 44)
store i16 %3, i16* %1
ret i32 0
}
/* Variables and functions */
int spec_compare(void const *, void const *);
int spec_compare_qsort_d(const void *a, const void *b) {
  return spec_compare(b, a);
}


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

x86 assembly (clang, -O2):
<spec_compare_qsort_d>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <spec_compare@plt>

LLVM IR (-O0):
define i32 @spec_compare_qsort_d(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 = load i8*, i8** %3
%7 = call i32 @spec_compare(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @spec_compare_qsort_d(i8* %0, i8* %1) {
%3 = tail call i32 @spec_compare(i8* %1, i8* %0)
ret i32 %3
}
char *numeric_dec_to_oct(long long int number) { return ""; }


x86 assembly (clang, -O0):
<numeric_dec_to_oct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric_dec_to_oct>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_dec_to_oct(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @numeric_dec_to_oct(i64 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void handle_nmi(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ConvertToDouble(unsigned char *, double *);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int ConvertFreadDouble(FILE *fp, double *val) {
  unsigned char tmp[8];
  if (fread(tmp, 8, 1, fp) != 1)
    return -1;
  ConvertToDouble(tmp, val);
  return 0;
}


x86 assembly (clang, -O0):
<ConvertFreadDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     115c <ConvertFreadDouble+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <ConvertFreadDouble+0x50>
lea    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ConvertToDouble@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertFreadDouble>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x1,%ecx
jne    115a <ConvertFreadDouble+0x3a>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <ConvertToDouble@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ConvertFreadDouble(i32* %0, double* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
%6 = alloca [8 x i8]
store i32* %0, i32** %4
store double* %1, double** %5
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%8 = load i32*, i32** %4
%9 = call i32 @fread(i8* %7, i32 8, i32 1, i32* %8)
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%14 = load double*, double** %5
%15 = call i32 @ConvertToDouble(i8* %13, double* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ConvertFreadDouble(i32* nocapture %0, double* %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = call i32 @fread(i8* %4, i32 8, i32 1, i32* %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @ConvertToDouble(i8* %4, double* %1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s <trials> [generator]\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s <trials> [generator]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s <trials> [generator]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int isEqual(int x, int y) { return !(x ^ y); }


x86 assembly (clang, -O0):
<isEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEqual>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isEqual(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 = xor i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isEqual(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void misc(void) { printf("misc code says hello\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"misc code says hello\0A\00"
define void @misc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"misc code says hello\00"
define void @misc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
int *max(int *pa, int *pb) {
  if (*pa >= *pb)
    return pa;
  else
    return pb;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jl     112b <max+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1133 <max+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rdi,%rax
mov    (%rdi),%ecx
cmp    (%rsi),%ecx
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i32* @max(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = select i1 %5, i32* %1, i32* %0
ret i32* %6
}
int fun936() { return 936; }


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

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

LLVM IR (-O0):
define i32 @fun936() {
ret i32 936
}

LLVM IR (-O2):
define i32 @fun936() {
ret i32 936
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void warning(const char *message, int line_number) {
  if (line_number > 0)
    fprintf(stderr, "warning: line %d: %s\n", line_number, message);
  else
    fprintf(stderr, "warning: %s\n", message);
}


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114c <warning+0x3c>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1167 <warning+0x57>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
test   %esi,%esi
jle    1130 <warning+0x20>
mov    %esi,%edx
lea    0xed7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
lea    0xedf(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"warning: line %d: %s\0A\00"
@.str.1 = [13 x i8] c"warning: %s\0A\00"
define void @warning(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
br label %16
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %3
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"warning: line %d: %s\0A\00"
@.str.1 = [13 x i8] c"warning: %s\0A\00"
define void @warning(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = load i32, i32* @stderr
br i1 %3, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int setcolor(int color) { return syscall(59, color, 0); }


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

x86 assembly (clang, -O2):
<setcolor>:
mov    %edi,%esi
mov    $0x3b,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setcolor(i32 %0) {
%2 = tail call i32 @syscall(i32 59, i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int cmp(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s1[10] = "caz";
  char s2[10] = "chenzong";
  printf("%d\n", cmp(s1, s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <cmp@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movw   $0x0,0x20(%rsp)
movq   $0x7a6163,0x18(%rsp)
movabs $0x676e6f7a6e656863,%rax
6f 6e 67
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <cmp@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [10 x i8] c"caz\00\00\00\00\00\00\00"
@__const.main.s2 = [10 x i8] c"chenzong\00\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = bitcast [10 x i8]* %3 to i8*
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call i32 @cmp(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [10 x i8] c"caz\00\00\00\00\00\00\00"
@__const.main.s2 = [10 x i8] c"chenzong\00\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @cmp(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void I400Copy() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @I400Copy() {
ret void
}
/* Type definitions */
struct sfmt_state_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gen_rand32(struct sfmt_state_t *);
double to_real1(int /*<<< orphan*/);
double genrand_real1(struct sfmt_state_t *s) { return to_real1(gen_rand32(s)); }


x86 assembly (clang, -O0):
<genrand_real1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gen_rand32@plt>
mov    %eax,%edi
call   1040 <to_real1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sfmt_state_t = type { i32 }
define double @genrand_real1(%struct.sfmt_state_t* %0) {
%2 = alloca %struct.sfmt_state_t*
store %struct.sfmt_state_t* %0, %struct.sfmt_state_t** %2
%3 = load %struct.sfmt_state_t*, %struct.sfmt_state_t** %2
%4 = call i32 @gen_rand32(%struct.sfmt_state_t* %3)
%5 = call double @to_real1(i32 %4)
ret double %5
}

LLVM IR (-O2):
%struct.sfmt_state_t = type { i32 }
define double @genrand_real1(%struct.sfmt_state_t* %0) {
%2 = tail call i32 @gen_rand32(%struct.sfmt_state_t* %0)
%3 = tail call double @to_real1(i32 %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void my_malloc2(int n) { malloc(n); }


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

x86 assembly (clang, -O2):
<my_malloc2>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define void @my_malloc2(i32 %0) {
%2 = tail call i32 @malloc(i32 %0)
ret void
}
/* Variables and functions */
double cos(int);
double hamming(double x) {
  return 0.54 - 0.46 * cos(2 * 3.14159265358979323846 * x);
}


x86 assembly (clang, -O0):
<hamming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming>:
push   %rax
mulsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
mulsd  0xede(%rip),%xmm0
addsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hamming(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x401921FB54442D18, %3
%5 = fptosi double %4 to i32
%6 = call double @cos(i32 %5)
%7 = call double @llvm.fmuladd.f64(double -4.600000e-01, double %6, double 5.400000e-01)
ret double %7
}

LLVM IR (-O2):
define double @hamming(double %0) {
%2 = fmul double %0, 0x401921FB54442D18
%3 = fptosi double %2 to i32
%4 = tail call double @cos(i32 %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double -4.600000e-01, double 5.400000e-01)
ret double %5
}
__typeof__(islower(1)) test_islower_37(void) { return islower(1); }


x86 assembly (clang, -O0):
<test_islower_37>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <islower@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_islower_37>:
mov    $0x1,%edi
jmp    1030 <islower@plt>

LLVM IR (-O0):
define i32 @test_islower_37() {
%1 = call i32 @islower(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_islower_37() {
%1 = tail call i32 @islower(i32 1)
ret i32 %1
}
/* Variables and functions */
int bb_strtoll(char const *, char **, int);
__attribute__((always_)) int bb_strtoi(const char *arg, char **endp, int base) {
  return bb_strtoll(arg, endp, base);
}


x86 assembly (clang, -O0):
<bb_strtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bb_strtoll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_strtoi>:
jmp    1030 <bb_strtoll@plt>

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

LLVM IR (-O2):
define i32 @bb_strtoi(i8* %0, i8** %1, i32 %2) {
%4 = tail call i32 @bb_strtoll(i8* %0, i8** %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int ioprint() {
  int c;
  while ((c = getc(stdin)) != EOF) {
    putc(c, stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<ioprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%eax
je     115e <ioprint+0x3e>
mov    -0x4(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
jmp    1128 <ioprint+0x8>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioprint>:
push   %r15
push   %r14
push   %rbx
mov    0x2ebc(%rip),%r14
mov    (%r14),%edi
call   1040 <getc@plt>
mov    0x2ea5(%rip),%r15
cmp    (%r15),%eax
je     1166 <ioprint+0x46>
mov    0x2e89(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %eax,%edi
call   1030 <putc@plt>
mov    (%r14),%edi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1150 <ioprint+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
@stdout = global i32 0
define i32 @ioprint() {
%1 = alloca i32
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* @stdin
%4 = call i32 @getc(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %1
%9 = load i32, i32* @stdout
%10 = call i32 @putc(i32 %8, i32 %9)
br label %2
11: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
@stdout = global i32 0
define i32 @ioprint() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @getc(i32 %1)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %13, label %5
5: ; preds = %0, %5
%6 = phi i32 [ %10, %5 ], [ %2, %0 ]
%7 = load i32, i32* @stdout
%8 = tail call i32 @putc(i32 %6, i32 %7)
%9 = load i32, i32* @stdin
%10 = tail call i32 @getc(i32 %9)
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %5
13: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(int);
void uart_ff(void) { uart_putc(0x0C); }


x86 assembly (clang, -O0):
<uart_ff>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <uart_putc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_ff>:
mov    $0xc,%edi
jmp    1030 <uart_putc@plt>

LLVM IR (-O0):
define void @uart_ff() {
%1 = call i32 @uart_putc(i32 12)
ret void
}

LLVM IR (-O2):
define void @uart_ff() {
%1 = tail call i32 @uart_putc(i32 12)
ret void
}
void GXEnd() {}


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

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

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

LLVM IR (-O2):
define void @GXEnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2scr(int, float, float, float);
void s2scr_(int *idx, float *r, float *g, float *b) { s2scr(*idx, *r, *g, *b); }


x86 assembly (clang, -O0):
<s2scr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
call   1030 <s2scr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2scr_>:
mov    (%rdi),%edi
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
movss  (%rcx),%xmm2
jmp    1030 <s2scr@plt>

LLVM IR (-O0):
define void @s2scr_(i32* %0, float* %1, float* %2, float* %3) {
%5 = alloca i32*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store i32* %0, i32** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = load float*, float** %8
%16 = load float, float* %15
%17 = call i32 @s2scr(i32 %10, float %12, float %14, float %16)
ret void
}

LLVM IR (-O2):
define void @s2scr_(i32* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load i32, i32* %0
%6 = load float, float* %1
%7 = load float, float* %2
%8 = load float, float* %3
%9 = tail call i32 @s2scr(i32 %5, float %6, float %7, float %8)
ret void
}
/* Variables and functions */
int g(int);
int f() { return g(10); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0xa,%edi
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 @g(i32 10)
ret i32 %1
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 @g(i32 10)
ret i32 %1
}
int dx_init_console(const char *title) {
  if (title[0])
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dx_init_console>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1121 <dx_init_console+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1128 <dx_init_console+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dx_init_console>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @dx_init_console(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @dx_init_console(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void outer_test() {
  int outer1(float);
  int outer2(int);
  int outer3(int);
  int outer4(int);
  int outer5(int);
  int *outer6(int);
  int *outer7(int);
  int outer8(int);
  int *ip7 = outer7(6);
}


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

x86 assembly (clang, -O2):
<outer_test>:
mov    $0x6,%edi
jmp    1030 <outer7@plt>

LLVM IR (-O0):
define void @outer_test() {
%1 = alloca i32*
%2 = call i32* @outer7(i32 6)
store i32* %2, i32** %1
ret void
}

LLVM IR (-O2):
define void @outer_test() {
%1 = tail call i32* @outer7(i32 6)
ret void
}
/* Variables and functions */
int change_mparam(int, int);
int dlmallopt(int param_number, int value) {
  return change_mparam(param_number, value);
}


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

x86 assembly (clang, -O2):
<dlmallopt>:
jmp    1030 <change_mparam@plt>

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

LLVM IR (-O2):
define i32 @dlmallopt(i32 %0, i32 %1) {
%3 = tail call i32 @change_mparam(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct mtwist_state {
  int dummy;
};

/* Variables and functions */
int mtwist_int(struct mtwist_state *, int);
int random_initial(struct mtwist_state *mt) { return 'A' + mtwist_int(mt, 26); }


x86 assembly (clang, -O0):
<random_initial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1a,%esi
call   1030 <mtwist_int@plt>
add    $0x41,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_initial>:
push   %rax
mov    $0x1a,%esi
call   1030 <mtwist_int@plt>
add    $0x41,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mtwist_state = type { i32 }
define i32 @random_initial(%struct.mtwist_state* %0) {
%2 = alloca %struct.mtwist_state*
store %struct.mtwist_state* %0, %struct.mtwist_state** %2
%3 = load %struct.mtwist_state*, %struct.mtwist_state** %2
%4 = call i32 @mtwist_int(%struct.mtwist_state* %3, i32 26)
%5 = add nsw i32 65, %4
ret i32 %5
}

LLVM IR (-O2):
%struct.mtwist_state = type { i32 }
define i32 @random_initial(%struct.mtwist_state* %0) {
%2 = tail call i32 @mtwist_int(%struct.mtwist_state* %0, i32 26)
%3 = add nsw i32 %2, 65
ret i32 %3
}
/* Variables and functions */
int strlen(const char *str) {
  int size = 0;
  while (*str++ != '\0')
    size++;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void openaccess_(anal_user_code, anal_user_name, anal_site_name,
                 return_code) double *anal_user_code,
    *anal_user_name, *anal_site_name;
int *return_code;
{ *return_code = 10000; }


x86 assembly (clang, -O0):
<openaccess_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x2710,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<openaccess_>:
movl   $0x2710,(%rcx)
ret

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

LLVM IR (-O2):
define void @openaccess_(double* nocapture readnone %0, double* nocapture readnone %1, double* nocapture readnone %2, i32* nocapture writeonly %3) {
store i32 10000, i32* %3
ret void
}
/* Variables and functions */
int dup2(int, int);
int bs_dup2(int oldfd, int newfd) { return dup2(oldfd, newfd); }


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

x86 assembly (clang, -O2):
<bs_dup2>:
jmp    1030 <dup2@plt>

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

LLVM IR (-O2):
define i32 @bs_dup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("init_null: Hello World\n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"init_null: Hello World\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [23 x i8] c"init_null: Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ func_b();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("main()\n");
  func_b();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <func_b@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"main()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func_b()
ret i32 0
}
/* Variables and functions */
double floor(double);
double fmod(double, double);
double dmm2deg(double dmm) {
  return floor(dmm / 100.0) + fmod(dmm, 100.0) / 60.0;
}


x86 assembly (clang, -O0):
<dmm2deg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
call   1030 <fmod@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe96(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmm2deg>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
divsd  0xece(%rip),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0xeb5(%rip),%xmm1
call   1030 <fmod@plt>
divsd  0xeb0(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @dmm2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+02
%5 = call double @llvm.floor.f64(double %4)
%6 = load double, double* %2
%7 = call double @fmod(double %6, double 1.000000e+02)
%8 = fdiv double %7, 6.000000e+01
%9 = fadd double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @dmm2deg(double %0) {
%2 = fdiv double %0, 1.000000e+02
%3 = tail call double @llvm.floor.f64(double %2)
%4 = tail call double @fmod(double %0, double 1.000000e+02)
%5 = fdiv double %4, 6.000000e+01
%6 = fadd double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, scalar_t__);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *mallocKey(char *key) {
  char *ret = malloc(strlen(key) + 1);
  bzero(ret, strlen(key) + 1);
  strcpy(ret, key);
  return ret;
}


x86 assembly (clang, -O0):
<mallocKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1060 <bzero@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocKey>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1060 <bzero@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mallocKey(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i32 @bzero(i8* %8, i64 %11)
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @mallocKey(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @bzero(i8* %4, i64 %3)
%6 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_DETACH;
int /*<<< orphan*/ perror(char *);
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *);
int stop_trace(pid_t child) {
  int ret;
  ret = ptrace(PTRACE_DETACH, child, NULL, NULL);
  if (ret) {
    perror("ptrace(PTRACE_DETACH) failed");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stop_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1168 <stop_trace+0x48>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    116f <stop_trace+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_trace>:
push   %rbx
mov    %edi,%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
test   %eax,%eax
jne    113f <stop_trace+0x1f>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%ebx
jmp    113b <stop_trace+0x1b>

LLVM IR (-O0):
@PTRACE_DETACH = global i32 0
@.str = [29 x i8] c"ptrace(PTRACE_DETACH) failed\00"
define i32 @stop_trace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* @PTRACE_DETACH
%6 = load i32, i32* %3
%7 = call i32 @ptrace(i32 %5, i32 %6, i32* null, i32* null)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@PTRACE_DETACH = global i32 0
@.str = [29 x i8] c"ptrace(PTRACE_DETACH) failed\00"
define i32 @stop_trace(i32 %0) {
%2 = load i32, i32* @PTRACE_DETACH
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32* null, i32* null)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
void e() {
  int i, j;
  for (i = 0; i < 2 * 5; i++) {
    for (j = 0; j < 1000000; j++) {
      ;
    }
  }
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    114f <e+0x4f>
movl   $0x0,-0x8(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    113c <e+0x3c>
jmp    112e <e+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <e+0x1c>
jmp    1141 <e+0x41>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <e+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @e() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("HelloWorld\n");
  printf("C Programming\n");
  printf("Welcome\n");
  return 0;
}


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    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%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
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"HelloWorld\0A\00"
@.str.1 = [15 x i8] c"C Programming\0A\00"
@.str.2 = [9 x i8] c"Welcome\0A\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 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"HelloWorld\00"
@str.3 = [14 x i8] c"C Programming\00"
@str.4 = [8 x i8] c"Welcome\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}