xunge/DecIR huggingface dataset:
void bu_compile_floatp(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("FLOATP");
  EMITEND();
  return;
er:
  cerror("floatp: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_floatp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_compile_arg_list@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1169 <bu_compile_floatp+0x29>
jmp    1183 <bu_compile_floatp+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_floatp+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_floatp>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <bu_compile_arg_list@plt>
cmp    $0x1,%eax
jne    1166 <bu_compile_floatp+0x26>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [7 x i8] c"FLOATP\00"
@.str.1 = [24 x i8] c"floatp: wrong # of args\00"
define void @bu_compile_floatp(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i32
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @EMITEND()
br label %15
12: ; preds = %8
%13 = load %struct.conscell*, %struct.conscell** %2
%14 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [7 x i8] c"FLOATP\00"
@.str.1 = [24 x i8] c"floatp: wrong # of args\00"
define void @bu_compile_floatp(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @EMITEND()
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
struct s3c24x0_watchdog *s3c24x0_get_base_watchdog(void) {
  return (struct s3c24x0_watchdog *)0x53000000;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_watchdog = type opaque
define %struct.s3c24x0_watchdog* @s3c24x0_get_base_watchdog() {
ret %struct.s3c24x0_watchdog* inttoptr (i64 1392508928 to %struct.s3c24x0_watchdog*)
}

LLVM IR (-O2):
%struct.s3c24x0_watchdog = type opaque
define %struct.s3c24x0_watchdog* @s3c24x0_get_base_watchdog() {
ret %struct.s3c24x0_watchdog* inttoptr (i64 1392508928 to %struct.s3c24x0_watchdog*)
}
int row_byte_big5hkscs(int row) { return 0x81 + row; }


x86 assembly (clang, -O0):
<row_byte_big5hkscs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x81,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_byte_big5hkscs>:
lea    0x81(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @row_byte_big5hkscs(i32 %0) {
%2 = add nsw i32 %0, 129
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ CG_ShutDownG2Weapons();
int /*<<< orphan*/ trap_FX_FreeSystem();
int /*<<< orphan*/ trap_ROFF_Clean();
void CG_Shutdown(void) {
  trap_FX_FreeSystem();
  trap_ROFF_Clean();
  CG_ShutDownG2Weapons();
}


x86 assembly (clang, -O0):
<CG_Shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <trap_FX_FreeSystem@plt>
mov    $0x0,%al
call   1050 <trap_ROFF_Clean@plt>
mov    $0x0,%al
call   1040 <CG_ShutDownG2Weapons@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_Shutdown>:
push   %rax
xor    %eax,%eax
call   1030 <trap_FX_FreeSystem@plt>
xor    %eax,%eax
call   1050 <trap_ROFF_Clean@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CG_ShutDownG2Weapons@plt>

LLVM IR (-O0):
define void @CG_Shutdown() {
%1 = call i32 (...) @trap_FX_FreeSystem()
%2 = call i32 (...) @trap_ROFF_Clean()
%3 = call i32 (...) @CG_ShutDownG2Weapons()
ret void
}

LLVM IR (-O2):
define void @CG_Shutdown() {
%1 = tail call i32 (...) @trap_FX_FreeSystem()
%2 = tail call i32 (...) @trap_ROFF_Clean()
%3 = tail call i32 (...) @CG_ShutDownG2Weapons()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_64(int /*<<< orphan*/);
uint64_t be64toh(uint64_t big_endian_64bits) {
  return bswap_64(big_endian_64bits);
}


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

x86 assembly (clang, -O2):
<be64toh>:
jmp    1030 <bswap_64@plt>

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

LLVM IR (-O2):
define i32 @be64toh(i32 %0) {
%2 = tail call i32 @bswap_64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ done(int);
void onintr(int signo) { done(1); }


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

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

LLVM IR (-O0):
define void @onintr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @done(i32 1)
ret void
}

LLVM IR (-O2):
define void @onintr(i32 %0) {
%2 = tail call i32 @done(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notImplementedRTF();
void PrtFrameR() { notImplementedRTF(); }


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

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

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

LLVM IR (-O2):
define void @PrtFrameR() {
%1 = tail call i32 (...) @notImplementedRTF()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_longdouble_max_to_all(long double *target,
                                        long double *source, int nreduce,
                                        int PE_start, int logPE_stride,
                                        int PE_size, long double *pWrk,
                                        long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longdouble_max_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_longdouble_max_to_all(x86_fp80* %0, x86_fp80* %1, i32 %2, i32 %3, i32 %4, i32 %5, x86_fp80* %6, i64* %7) {
%9 = alloca x86_fp80*
%10 = alloca x86_fp80*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca x86_fp80*
%16 = alloca i64*
store x86_fp80* %0, x86_fp80** %9
store x86_fp80* %1, x86_fp80** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store x86_fp80* %6, x86_fp80** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_longdouble_max_to_all(x86_fp80* nocapture readnone %0, x86_fp80* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, x86_fp80* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int ft_isdigit(int c) {
  if (c > 47 && c < 58)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2f,-0x8(%rbp)
jle    1127 <ft_isdigit+0x27>
cmpl   $0x3a,-0x8(%rbp)
jge    1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 47
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 58
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@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>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int ft_strlenz(const char *s) {
  int i;
  if (!s)
    return (0);
  i = 0;
  while (*(s + i) != '\0') {
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlenz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ft_strlenz+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114f <ft_strlenz+0x4f>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <ft_strlenz+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <ft_strlenz+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlenz>:
test   %rdi,%rdi
je     111d <ft_strlenz+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlenz+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlenz(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
void ignore_line(FILE *in) {
  int ch;
  while (1) {
    ch = getc(in);
    if (ch == '\n' || ch == EOF) {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<ignore_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
je     1144 <ignore_line+0x34>
mov    -0xc(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
jne    1149 <ignore_line+0x39>
jmp    114e <ignore_line+0x3e>
jmp    111c <ignore_line+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_line>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1132 <ignore_line+0x22>
cmp    (%r14),%eax
jne    1120 <ignore_line+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @ignore_line(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getc(i32* %0)
%4 = icmp eq i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %3, %5
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int write(int, char *, int);
int tun_write(int fd, char *buf, int len) { return write(fd, buf, len); }


x86 assembly (clang, -O0):
<tun_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @tun_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun_1() { printf("Fun_1;\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Fun_1;\00"
define void @fun_1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d", getpid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int test_main();
int main(void) { return test_main(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_main()
ret i32 %1
}
int str_to_hex(char *str, char *str_hex) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @str_to_hex(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double izero(double);
double sqrt(int);
double win(double n, int len, double alp, double iza) {
  return izero(alp * sqrt(1 - 4 * n * n / ((len - 1.0) * (len - 1.0)))) / iza;
}


x86 assembly (clang, -O0):
<win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xebc(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe9d(%rip),%xmm2
subsd  %xmm2,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
movsd  0xe8c(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe78(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <izero@plt>
divsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<win>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  0xec8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
addsd  0xeb9(%rip),%xmm0
mulsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
addsd  0xeb1(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
call   1030 <izero@plt>
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @win(double %0, i32 %1, double %2, double %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %5
%11 = fmul double 4.000000e+00, %10
%12 = load double, double* %5
%13 = fmul double %11, %12
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fsub double %15, 1.000000e+00
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fsub double %18, 1.000000e+00
%20 = fmul double %16, %19
%21 = fdiv double %13, %20
%22 = fsub double 1.000000e+00, %21
%23 = fptosi double %22 to i32
%24 = call double @sqrt(i32 %23)
%25 = fmul double %9, %24
%26 = call double @izero(double %25)
%27 = load double, double* %8
%28 = fdiv double %26, %27
ret double %28
}

LLVM IR (-O2):
define double @win(double %0, i32 %1, double %2, double %3) {
%5 = fmul double %0, 4.000000e+00
%6 = fmul double %5, %0
%7 = sitofp i32 %1 to double
%8 = fadd double %7, -1.000000e+00
%9 = fmul double %8, %8
%10 = fdiv double %6, %9
%11 = fsub double 1.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = tail call double @sqrt(i32 %12)
%14 = fmul double %13, %2
%15 = tail call double @izero(double %14)
%16 = fdiv double %15, %3
ret double %16
}
void initBoard(int *boardData) {
  int i;
  for (i = 0; i <= 8; i++) {
    boardData[i] = i + 2;
  }
}


x86 assembly (clang, -O0):
<initBoard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     1138 <initBoard+0x38>
mov    -0xc(%rbp),%edx
add    $0x2,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initBoard+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initBoard>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movl   $0xa,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @initBoard(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 2, i32 3, i32 4, i32 5>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 6, i32 7, i32 8, i32 9>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 10, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void fast_memcpy(char *dst, char *src, int size) { memcpy(dst, src, size); }


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

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

LLVM IR (-O0):
define void @fast_memcpy(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 @memcpy(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @fast_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int close(int);
int pcsl_serial_close(int port) {
  int result;
  result = close(port);
  return result;
}


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

x86 assembly (clang, -O2):
<pcsl_serial_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @pcsl_serial_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  setuid(0);
  system("/bin/sh /var/www/php_shell.sh");
  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)
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"/bin/sh /var/www/php_shell.sh\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 @setuid(i32 0)
%7 = call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"/bin/sh /var/www/php_shell.sh\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @setuid(i32 0)
%4 = tail call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
bool float_match(float a, float b) {
  if (b > a)
    return float_match(a, b);
  if (a - b < 0.001)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<float_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1148 <float_match+0x38>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <float_match@plt>
mov    %eax,-0x4(%rbp)
jmp    117b <float_match+0x6b>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1174 <float_match+0x64>
movl   $0x1,-0x4(%rbp)
jmp    117b <float_match+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_match>:
ucomiss %xmm0,%xmm1
jbe    1112 <float_match+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <float_match+0x10>
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xede(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @float_match(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load float, float* %4
%11 = load float, float* %5
%12 = call i32 @float_match(float %10, float %11)
store i32 %12, i32* %3
br label %21
13: ; preds = %2
%14 = load float, float* %4
%15 = load float, float* %5
%16 = fsub float %14, %15
%17 = fpext float %16 to double
%18 = fcmp olt double %17, 1.000000e-03
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 1, i32* %3
br label %21
20: ; preds = %13
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @float_match(float %0, float %1) {
%3 = fcmp ogt float %1, %0
br i1 %3, label %4, label %5
4: ; preds = %2, %4
br label %4
5: ; preds = %2
%6 = fsub float %0, %1
%7 = fpext float %6 to double
%8 = fcmp olt double %7, 1.000000e-03
%9 = zext i1 %8 to i32
ret i32 %9
}
int a(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<a>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @a(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
size_t _quick_sort_partition(int *, size_t);
void _quick_sort(int *arr, size_t len) {
  if (len < 1)
    return;
  size_t q = _quick_sort_partition(arr, len);
  _quick_sort(arr, q);
  _quick_sort(arr + q + 1, len - (q + 1));
}


x86 assembly (clang, -O0):
<_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jae    1140 <_quick_sort+0x20>
jmp    1185 <_quick_sort+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_quick_sort_partition@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
add    $0x1,%rax
sub    %rax,%rsi
call   1040 <_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1159 <_quick_sort+0x39>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <_quick_sort_partition@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <_quick_sort@plt>
lea    (%r15,%rbx,4),%r15
add    $0x4,%r15
not    %rbx
add    %rbx,%r14
jne    1130 <_quick_sort+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @_quick_sort(i32* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32* [ %9, %4 ], [ %0, %2 ]
%7 = tail call i64 @_quick_sort_partition(i32* %6, i64 %5)
tail call void @_quick_sort(i32* %6, i64 %7)
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = getelementptr inbounds i32, i32* %8, i64 %7
%10 = xor i64 %7, -1
%11 = add i64 %5, %10
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int utf8_strlen_screen(char const *);
int config_check_separator(void *data, struct t_config_option *option,
                           const char *value) {
  (void)data;
  (void)option;
  return (utf8_strlen_screen(value) <= 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<config_check_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <utf8_strlen_screen@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmovle %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_check_separator>:
push   %rax
mov    %rdx,%rdi
call   1030 <utf8_strlen_screen@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define i32 @config_check_separator(i8* %0, %struct.t_config_option* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.t_config_option*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.t_config_option* %1, %struct.t_config_option** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.t_config_option*, %struct.t_config_option** %5
%9 = load i8*, i8** %6
%10 = call i32 @utf8_strlen_screen(i8* %9)
%11 = icmp sle i32 %10, 1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define i32 @config_check_separator(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @utf8_strlen_screen(i8* %2)
%5 = icmp slt i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct vect2 {
  int dummy;
};

/* Variables and functions */
void *getDatVt2(struct vect2 *obj) {
  if (obj != NULL) {
    return (void *)((((void *)obj) + (2 * sizeof(unsigned int))));
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<getDatVt2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1124 <getDatVt2+0x24>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <getDatVt2+0x2c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDatVt2>:
lea    0x8(%rdi),%rax
test   %rdi,%rdi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
%struct.vect2 = type { i32 }
define i8* @getDatVt2(%struct.vect2* %0) {
%2 = alloca i8*
%3 = alloca %struct.vect2*
store %struct.vect2* %0, %struct.vect2** %3
%4 = load %struct.vect2*, %struct.vect2** %3
%5 = icmp ne %struct.vect2* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.vect2*, %struct.vect2** %3
%8 = bitcast %struct.vect2* %7 to i8*
%9 = getelementptr i8, i8* %8, i64 8
store i8* %9, i8** %2
br label %11
10: ; preds = %1
store i8* null, i8** %2
br label %11
11: ; preds = %10, %6
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
%struct.vect2 = type { i32 }
define i8* @getDatVt2(%struct.vect2* readnone %0) {
%2 = icmp eq %struct.vect2* %0, null
%3 = getelementptr %struct.vect2, %struct.vect2* %0, i64 2
%4 = bitcast %struct.vect2* %3 to i8*
%5 = select i1 %2, i8* null, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fab_free(void *buf) { free(buf); }


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

x86 assembly (clang, -O2):
<fab_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fab_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int resta(int a, int b) {
  int c;
  c = a - b;
  return c;
}


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

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

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

LLVM IR (-O2):
define i32 @resta(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void swapEndiannes(uint32_t *value) {
  uint32_t tmp = *value;
  *value = (tmp >> 24) | (tmp << 24) | ((tmp >> 8) & 0x0000FF00) |
           ((tmp << 8) & 0x00FF0000);
}


x86 assembly (clang, -O0):
<swapEndiannes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff00,%eax
or     %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapEndiannes>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    $0x18,%ecx
mov    %eax,%edx
shl    $0x18,%edx
or     %ecx,%edx
mov    %eax,%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %edx,%ecx
shl    $0x8,%eax
and    $0xff0000,%eax
or     %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swapEndiannes(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = ashr i32 %6, 24
%8 = load i32, i32* %3
%9 = shl i32 %8, 24
%10 = or i32 %7, %9
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = and i32 %12, 65280
%14 = or i32 %10, %13
%15 = load i32, i32* %3
%16 = shl i32 %15, 8
%17 = and i32 %16, 16711680
%18 = or i32 %14, %17
%19 = load i32*, i32** %2
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @swapEndiannes(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 24
%4 = shl i32 %2, 24
%5 = or i32 %3, %4
%6 = lshr i32 %2, 8
%7 = and i32 %6, 65280
%8 = or i32 %5, %7
%9 = shl i32 %2, 8
%10 = and i32 %9, 16711680
%11 = or i32 %8, %10
store i32 %11, i32* %0
ret void
}
void loop_prune2_Good_FP(int length, int j) {
  int i;
  char a[length];
  for (i = length - 1; i >= 0; i--) {
    if (j < i && j >= 0) {
      a[length - i] = 'Z';
    }
  }
}


x86 assembly (clang, -O0):
<loop_prune2_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1181 <loop_prune2_Good_FP+0x81>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116e <loop_prune2_Good_FP+0x6e>
cmpl   $0x0,-0x8(%rbp)
jl     116e <loop_prune2_Good_FP+0x6e>
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x5a,(%rax,%rcx,1)
jmp    1173 <loop_prune2_Good_FP+0x73>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <loop_prune2_Good_FP+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @loop_prune2_Good_FP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %5
br label %14
14: ; preds = %31, %2
%15 = load i32, i32* %5
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %34
17: ; preds = %14
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i32, i32* %4
%23 = icmp sge i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %3
%26 = load i32, i32* %5
%27 = sub nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %11, i64 %28
store i8 90, i8* %29
br label %30
30: ; preds = %24, %21, %17
br label %31
31: ; preds = %30
%32 = load i32, i32* %5
%33 = add nsw i32 %32, -1
store i32 %33, i32* %5
br label %14
34: ; preds = %14
%35 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @loop_prune2_Good_FP(i32 %0, i32 %1) {
ret void
}
int test_imm_3Auint8_mem(unsigned char *val) {
  return ((*val) & (-0x3A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Auint8_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, -58
%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_3Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -58
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void tttt(void) {
  int i;
  float temp = 0.0;
  for (i = 0; i < 10000; i++)
    temp += 4.0;
}


x86 assembly (clang, -O0):
<tttt>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    114c <tttt+0x4c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <tttt+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tttt() {
%1 = alloca i32
%2 = alloca float
store float 0.000000e+00, float* %2
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fadd double %8, 4.000000e+00
%10 = fptrunc double %9 to float
store float %10, float* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @tttt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ puts(char *const);
int main() {
  char *const p1 = "hello,world";
  char p_arr[20] = "this is array";
  printf("p1[0]=%c\n", p1[0]);
  *((char **)&p1) = p_arr;
  puts(p1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeda(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    0xeac(%rip),%rdi
movsbl 0xe99(%rip),%esi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"hello,world\00"
@__const.main.p_arr = [20 x i8] c"this is array\00\00\00\00\00\00\00"
@.str.1 = [10 x i8] c"p1[0]=%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [20 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = bitcast [20 x i8]* %3 to i8*
%5 = load i8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
store i8* %7, i8** %2
%8 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello,world\00"
@.str.1 = [10 x i8] c"p1[0]=%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext 104)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t EPIIntErrorStatus(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x0000021C))));
}


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

x86 assembly (clang, -O2):
<EPIIntErrorStatus>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x21c(%rax),%rax
ret

LLVM IR (-O0):
define i64 @EPIIntErrorStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 540
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @EPIIntErrorStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 540
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
void sweap_by_value(int x, int y) {
  int temp;
  temp = x;
  x = y;
  y = temp;
}


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

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

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

LLVM IR (-O2):
define void @sweap_by_value(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test45_Test8_test1__I() { foo(); }


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

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

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

LLVM IR (-O2):
define void @test45_Test8_test1__I() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_solvable(int *);
int /*<<< orphan*/ table_randomize(int *);
void table_shuffle(int *table) {
  do
    table_randomize(table);
  while (!is_solvable(table));
}


x86 assembly (clang, -O0):
<table_shuffle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <table_randomize@plt>
mov    -0x8(%rbp),%rdi
call   1030 <is_solvable@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <table_shuffle+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<table_shuffle>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <table_randomize@plt>
mov    %rbx,%rdi
call   1030 <is_solvable@plt>
test   %eax,%eax
je     1130 <table_shuffle+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @table_shuffle(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %6, %1
%4 = load i32*, i32** %2
%5 = call i32 @table_randomize(i32* %4)
br label %6
6: ; preds = %3
%7 = load i32*, i32** %2
%8 = call i32 @is_solvable(i32* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %3, label %11
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @table_shuffle(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @table_randomize(i32* %0)
%4 = tail call i32 @is_solvable(i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}