xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ alldone(int);
int /*<<< orphan*/ non_fatal(char *, char *);
void Fatal(char *s1, char *s2) {
  non_fatal(s1, s2);
  alldone(1);
}


x86 assembly (clang, -O0):
<Fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <non_fatal@plt>
mov    $0x1,%edi
call   1030 <alldone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fatal>:
push   %rax
call   1040 <non_fatal@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <alldone@plt>

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

LLVM IR (-O2):
define void @Fatal(i8* %0, i8* %1) {
%3 = tail call i32 @non_fatal(i8* %0, i8* %1)
%4 = tail call i32 @alldone(i32 1)
ret void
}
/* Variables and functions */
long grg_rotate_grid_index(long const, long **, long const *, long const *);
long ksp_rotate_grgrid_index(const long grid_index, long rotation[3][3],
                             const long D_diag[3], const long PS[3]) {
  return grg_rotate_grid_index(grid_index, rotation, D_diag, PS);
}


x86 assembly (clang, -O0):
<ksp_rotate_grgrid_index>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <grg_rotate_grid_index@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ksp_rotate_grgrid_index>:
jmp    1030 <grg_rotate_grid_index@plt>

LLVM IR (-O0):
define i64 @ksp_rotate_grgrid_index(i64 %0, [3 x i64]* %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca [3 x i64]*
%7 = alloca i64*
%8 = alloca i64*
store i64 %0, i64* %5
store [3 x i64]* %1, [3 x i64]** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64, i64* %5
%10 = load [3 x i64]*, [3 x i64]** %6
%11 = bitcast [3 x i64]* %10 to i64**
%12 = load i64*, i64** %7
%13 = load i64*, i64** %8
%14 = call i64 @grg_rotate_grid_index(i64 %9, i64** %11, i64* %12, i64* %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @ksp_rotate_grgrid_index(i64 %0, [3 x i64]* %1, i64* %2, i64* %3) {
%5 = bitcast [3 x i64]* %1 to i64**
%6 = tail call i64 @grg_rotate_grid_index(i64 %0, i64** %5, i64* %2, i64* %3)
ret i64 %6
}
/* Variables and functions */
long double cbrt(long double);
long double cbrtl(long double a1) { return cbrt(a1); }


x86 assembly (clang, -O0):
<cbrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <cbrt@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtl>:
jmp    1030 <cbrt@plt>

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

LLVM IR (-O2):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = tail call x86_fp80 @cbrt(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
struct ext4_inode {
  int dummy;
};

/* Variables and functions */
int inode_get_by_number(int /*<<< orphan*/, struct ext4_inode *);
int /*<<< orphan*/ inode_get_idx_by_path(char const *);
int inode_get_by_path(const char *path, struct ext4_inode *inode) {
  return inode_get_by_number(inode_get_idx_by_path(path), inode);
}


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

x86 assembly (clang, -O2):
<inode_get_by_path>:
push   %rbx
mov    %rsi,%rbx
call   1030 <inode_get_idx_by_path@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <inode_get_by_number@plt>

LLVM IR (-O0):
%struct.ext4_inode = type { i32 }
define i32 @inode_get_by_path(i8* %0, %struct.ext4_inode* %1) {
%3 = alloca i8*
%4 = alloca %struct.ext4_inode*
store i8* %0, i8** %3
store %struct.ext4_inode* %1, %struct.ext4_inode** %4
%5 = load i8*, i8** %3
%6 = call i32 @inode_get_idx_by_path(i8* %5)
%7 = load %struct.ext4_inode*, %struct.ext4_inode** %4
%8 = call i32 @inode_get_by_number(i32 %6, %struct.ext4_inode* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.ext4_inode = type { i32 }
define i32 @inode_get_by_path(i8* %0, %struct.ext4_inode* %1) {
%3 = tail call i32 @inode_get_idx_by_path(i8* %0)
%4 = tail call i32 @inode_get_by_number(i32 %3, %struct.ext4_inode* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ creat_page();
int /*<<< orphan*/ mmu_init();
int gboot_main() {
  creat_page();
  mmu_init();
  (*(volatile unsigned long *)0xA0008800) = 0x11110000;
  (*(volatile unsigned long *)0xA0008808) = 0x0;
  return 0;
}


x86 assembly (clang, -O0):
<gboot_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <creat_page@plt>
mov    $0x0,%al
call   1040 <mmu_init@plt>
mov    $0xa0008800,%eax
movq   $0x11110000,(%rax)
mov    $0xa0008808,%eax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gboot_main>:
push   %rax
xor    %eax,%eax
call   1030 <creat_page@plt>
xor    %eax,%eax
call   1040 <mmu_init@plt>
mov    $0xa0008800,%eax
movq   $0x11110000,(%rax)
movq   $0x0,0x8(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gboot_main() {
%1 = call i32 (...) @creat_page()
%2 = call i32 (...) @mmu_init()
store volatile i64 286326784, i64* inttoptr (i64 2684389376 to i64*)
store volatile i64 0, i64* inttoptr (i64 2684389384 to i64*)
ret i32 0
}

LLVM IR (-O2):
define i32 @gboot_main() {
%1 = tail call i32 (...) @creat_page()
%2 = tail call i32 (...) @mmu_init()
store volatile i64 286326784, i64* inttoptr (i64 2684389376 to i64*)
store volatile i64 0, i64* inttoptr (i64 2684389384 to i64*)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_setstacksize(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
int iseven(unsigned n) { return n & 1 ? 0 : 1; }


x86 assembly (clang, -O0):
<iseven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iseven>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @iseven(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @iseven(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int getattr(char const *);
int access(const char *name, int mode) {
  if (mode)
    ;
  return (getattr(name) == -1) ? -1 : 0;
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112e <access+0x1e>
jmp    112e <access+0x1e>
mov    -0x8(%rbp),%rdi
call   1030 <getattr@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access>:
push   %rax
call   1030 <getattr@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @access(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 ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %8
8: ; preds = %7, %2
%9 = load i8*, i8** %3
%10 = call i32 @getattr(i8* %9)
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @access(i8* %0, i32 %1) {
%3 = tail call i32 @getattr(i8* %0)
%4 = icmp eq i32 %3, -1
%5 = sext i1 %4 to i32
ret i32 %5
}
int is_blank_char(char c) {
  return c == ' ' || c == '\t' || c == '\r' || c == '\n';
}


x86 assembly (clang, -O0):
<is_blank_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_blank_char+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_blank_char+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_blank_char+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_char>:
cmp    $0x20,%dil
ja     1120 <is_blank_char+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002200,%rdx
bt     %rcx,%rdx
jae    1120 <is_blank_char+0x20>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_blank_char(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void desligarLampada(void *lampadas, void *idxLampada) {
  unsigned char *pLampadas = (unsigned char *)lampadas;
  unsigned int *pIdxLampada = (unsigned int *)idxLampada;
  pLampadas[*pIdxLampada] = 0;
  printf("%d\n", pLampadas[*pIdxLampada]);
}


x86 assembly (clang, -O0):
<desligarLampada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
lea    0xeb1(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desligarLampada>:
mov    (%rsi),%eax
movb   $0x0,(%rdi,%rax,1)
mov    (%rsi),%eax
movzbl (%rdi,%rax,1),%esi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @desligarLampada(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i8*, i8** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %5
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %20)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @desligarLampada(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ht_get_invalid();
char *u642str(int /*<<< orphan*/, int /*<<< orphan*/);
char *get_str_failed_reqs(void) { return u642str(ht_get_invalid(), 0); }


x86 assembly (clang, -O0):
<get_str_failed_reqs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ht_get_invalid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <u642str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_str_failed_reqs>:
push   %rax
xor    %eax,%eax
call   1030 <ht_get_invalid@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <u642str@plt>

LLVM IR (-O0):
define i8* @get_str_failed_reqs() {
%1 = call i32 (...) @ht_get_invalid()
%2 = call i8* @u642str(i32 %1, i32 0)
ret i8* %2
}

LLVM IR (-O2):
define i8* @get_str_failed_reqs() {
%1 = tail call i32 (...) @ht_get_invalid()
%2 = tail call i8* @u642str(i32 %1, i32 0)
ret i8* %2
}
int atoi(const char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR9D_set(void) { return U_WMRCORENONE_set("U_WMR9D"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR9D\00"
define i8* @U_WMR9D_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR9D\00"
define i8* @U_WMR9D_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int __internal_syscall(int, long, long, long, long);
int _close(int file) {
  return __internal_syscall(57, (long)(file), (long)(0), (long)(0), (long)(0));
}


x86 assembly (clang, -O0):
<_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rsi
mov    $0x39,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <__internal_syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_close>:
movslq %edi,%rsi
mov    $0x39,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <__internal_syscall@plt>

LLVM IR (-O0):
define i32 @_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = call i32 @__internal_syscall(i32 57, i64 %4, i64 0, i64 0, i64 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @_close(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i32 @__internal_syscall(i32 57, i64 %2, i64 0, i64 0, i64 0)
ret i32 %3
}
char *strcpy(char *dest, const char *src) {
  char *s = dest;
  while ((*dest++ = *src++))
    ;
  return s;
}


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

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void foo031() {}


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

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

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

LLVM IR (-O2):
define void @foo031() {
ret void
}
void f3(void) {
  _Atomic int a = 0, b[2] = {1, 2};
#pragma omp target
  a++;
#pragma omp target firstprivate(a)
  a++;
#pragma omp target firstprivate(b)
  b[0]++;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
lock addl $0x1,-0x4(%rbp)
lock addl $0x1,-0x4(%rbp)
lock addl $0x1,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movl   $0x0,-0xc(%rsp)
movabs $0x200000001,%rax
mov    %rax,-0x8(%rsp)
lock addl $0x1,-0xc(%rsp)
lock addl $0x1,-0xc(%rsp)
lock addl $0x1,-0x8(%rsp)
ret

LLVM IR (-O0):
define void @f3() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 2, i32* %4
%5 = atomicrmw add i32* %1, i32 1 seq_cst
%6 = atomicrmw add i32* %1, i32 1 seq_cst
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = atomicrmw add i32* %7, i32 1 seq_cst
ret void
}

LLVM IR (-O2):
define void @f3() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast [2 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 1, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 2, i32* %6
%7 = atomicrmw add i32* %1, i32 1 seq_cst
%8 = atomicrmw add i32* %1, i32 1 seq_cst
%9 = atomicrmw add i32* %5, i32 1 seq_cst
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
void dispatch(struct svc_req *request, SVCXPRT *xprt) {}


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

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

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define void @dispatch(%struct.svc_req* %0, i32* %1) {
%3 = alloca %struct.svc_req*
%4 = alloca i32*
store %struct.svc_req* %0, %struct.svc_req** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define void @dispatch(%struct.svc_req* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
int is_valid_varchar(int c) {
  if (!isspace(c)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_varchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1138 <is_valid_varchar+0x28>
movl   $0x1,-0x4(%rbp)
jmp    113f <is_valid_varchar+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_varchar>:
push   %rax
call   1030 <isspace@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_valid_varchar(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 3;
  int *a_ptr = &a;
  *a_ptr = 4;
  printf("a=%d ", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"a=%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
void SSIClockSourceSet(unsigned long ulBase, unsigned long ulSource) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000FC8))) = ulSource;
}


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

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

LLVM IR (-O0):
define void @SSIClockSourceSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @SSIClockSourceSet(i64 %0, i64 %1) {
%3 = add i64 %0, 4040
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
scalar_t__ ceil(size_t);
size_t BitlyLib_SCAVENGEREstimateBas64DecodedDataSize(size_t inDataSize) {
  size_t theDecodedDataSize = (int)ceil(inDataSize / 4.0) * 3;
  return (theDecodedDataSize);
}


x86 assembly (clang, -O0):
<BitlyLib_SCAVENGEREstimateBas64DecodedDataSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
imul   $0x3,%eax,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitlyLib_SCAVENGEREstimateBas64DecodedDataSize>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x20,%rax
lea    (%rax,%rax,2),%rax
sar    $0x20,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BitlyLib_SCAVENGEREstimateBas64DecodedDataSize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fdiv double %5, 4.000000e+00
%7 = fptoui double %6 to i64
%8 = call i64 @ceil(i64 %7)
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 3
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @BitlyLib_SCAVENGEREstimateBas64DecodedDataSize(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fmul double %2, 2.500000e-01
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = mul i64 %5, 12884901888
%7 = ashr exact i64 %6, 32
ret i64 %7
}
/* Variables and functions */
char exp(char);
char internal_exp_b(char value) { return exp(value); }


x86 assembly (clang, -O0):
<internal_exp_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <exp@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_exp_b>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define signext i8 @internal_exp_b(i8 signext %0) {
%2 = tail call signext i8 @exp(i8 signext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void menustate(int inuse) {
  printf("menu is %s\n", inuse ? "INUSE" : "not in use");
  if (!inuse) {
  }
}


x86 assembly (clang, -O0):
<menustate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xeed(%rip),%rsi
lea    0xee0(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    114e <menustate+0x3e>
jmp    114e <menustate+0x3e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menustate>:
test   %edi,%edi
lea    0xef9(%rip),%rax
lea    0xeec(%rip),%rsi
cmove  %rax,%rsi
lea    0xed5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"menu is %s\0A\00"
@.str.1 = [6 x i8] c"INUSE\00"
@.str.2 = [11 x i8] c"not in use\00"
define void @menustate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %1
br label %11
11: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"menu is %s\0A\00"
@.str.1 = [6 x i8] c"INUSE\00"
@.str.2 = [11 x i8] c"not in use\00"
define void @menustate(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincbind(char *, char *, int);
void cgdec2ib(void) { cgincbind("bx", "sub", 1); }


x86 assembly (clang, -O0):
<cgdec2ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x1,%edx
call   1030 <cgincbind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec2ib>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <cgincbind@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"bx\00"
@.str.1 = [4 x i8] c"sub\00"
define void @cgdec2ib() {
%1 = call i32 @cgincbind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"bx\00"
@.str.1 = [4 x i8] c"sub\00"
define void @cgdec2ib() {
%1 = tail call i32 @cgincbind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
float fmaxf(float, float);
float __ocl_fmax_float_float(float src1, float src2) {
  return fmaxf(src1, src2);
}


x86 assembly (clang, -O0):
<__ocl_fmax_float_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_fmax_float_float>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_fmax_float_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.maxnum.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__ocl_fmax_float_float(float %0, float %1) {
%3 = tail call float @llvm.maxnum.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int check_afp_locked(void) { return (!access("/tmp/tmp_afp_lock", F_OK)); }


x86 assembly (clang, -O0):
<check_afp_locked>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_afp_locked>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/tmp/tmp_afp_lock\00"
@F_OK = global i32 0
define i32 @check_afp_locked() {
%1 = load i32, i32* @F_OK
%2 = call i32 @access(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [18 x i8] c"/tmp/tmp_afp_lock\00"
@F_OK = global i32 0
define i32 @check_afp_locked() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned hash_rot13(s)
register const char *s;
{
  register unsigned hash, c;
  hash = 0;
  while ((c = (unsigned char)*s++) != 0) {
    hash += c;
    hash -= (hash << 13) | (hash >> 19);
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_rot13>:
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)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1151 <hash_rot13+0x51>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0xd,%ecx
mov    -0xc(%rbp),%eax
shr    $0x13,%eax
or     %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_rot13+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_rot13>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hash_rot13+0x2a>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movzbl %cl,%eax
add    %edx,%eax
mov    %eax,%ecx
rol    $0xd,%ecx
sub    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash_rot13+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_rot13(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add i32 %7, %8
%11 = tail call i32 @llvm.fshl.i32(i32 %10, i32 %10, i32 13)
%12 = sub i32 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Type definitions */
struct bit_unpack_data {
  int dummy;
};

/* Variables and functions */
struct bit_unpack_data *bit_unpack_new();
int /*<<< orphan*/ bu_assign(struct bit_unpack_data *, void const *, size_t);
struct bit_unpack_data *bit_unpack_new2(const void *data, size_t len) {
  struct bit_unpack_data *new_data = bit_unpack_new();
  if (NULL != new_data) {
    bu_assign(new_data, data, len);
  }
  return new_data;
}


x86 assembly (clang, -O0):
<bit_unpack_new2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <bit_unpack_new@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     1158 <bit_unpack_new2+0x38>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <bu_assign@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_unpack_new2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <bit_unpack_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1148 <bit_unpack_new2+0x28>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <bu_assign@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.bit_unpack_data = type { i32 }
define %struct.bit_unpack_data* @bit_unpack_new2(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca %struct.bit_unpack_data*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call %struct.bit_unpack_data* (...) @bit_unpack_new()
store %struct.bit_unpack_data* %6, %struct.bit_unpack_data** %5
%7 = load %struct.bit_unpack_data*, %struct.bit_unpack_data** %5
%8 = icmp ne %struct.bit_unpack_data* null, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load %struct.bit_unpack_data*, %struct.bit_unpack_data** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @bu_assign(%struct.bit_unpack_data* %10, i8* %11, i64 %12)
br label %14
14: ; preds = %9, %2
%15 = load %struct.bit_unpack_data*, %struct.bit_unpack_data** %5
ret %struct.bit_unpack_data* %15
}

LLVM IR (-O2):
%struct.bit_unpack_data = type { i32 }
define %struct.bit_unpack_data* @bit_unpack_new2(i8* %0, i64 %1) {
%3 = tail call %struct.bit_unpack_data* (...) @bit_unpack_new()
%4 = icmp eq %struct.bit_unpack_data* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @bu_assign(%struct.bit_unpack_data* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret %struct.bit_unpack_data* %3
}
void delay(void) {
  unsigned long i = 0x00fff;
  while (1) {
    i--;
    if (i == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movq   $0xfff,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1128 <delay+0x28>
jmp    112d <delay+0x2d>
jmp    110c <delay+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay() {
%1 = alloca i64
store i64 4095, i64* %1
br label %2
2: ; preds = %0, %8
%3 = load i64, i64* %1
%4 = add i64 %3, -1
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %9
8: ; preds = %2
br label %2
9: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @delay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gethostbyname;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)gethostbyname;
  exit(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   1030 <exit@plt>

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

LLVM IR (-O0):
@gethostbyname = global i32 0
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = load i32, i32* @gethostbyname
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@gethostbyname = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ADC_DelSig_AMux_DisconnectAll();
void ADC_DelSig_AMux_Stop(void) { ADC_DelSig_AMux_DisconnectAll(); }


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

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

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

LLVM IR (-O2):
define void @ADC_DelSig_AMux_Stop() {
%1 = tail call i32 (...) @ADC_DelSig_AMux_DisconnectAll()
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
int get_path(char *pathname) {
  char *c;
  if (!pathname)
    return 0;
  c = strrchr(pathname, '/');
  if (!c)
    return 0;
  return c - pathname + 1;
}


x86 assembly (clang, -O0):
<get_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <get_path+0x23>
movl   $0x0,-0x4(%rbp)
jmp    116e <get_path+0x5e>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <get_path+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    116e <get_path+0x5e>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_path>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1133 <get_path+0x23>
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1133 <get_path+0x23>
sub    %ebx,%eax
add    $0x1,%eax
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_path(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
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
%9 = load i8*, i8** %3
%10 = call i8* @strrchr(i8* %9, i8 signext 47)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %8
store i32 0, i32* %2
br label %22
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = load i8*, i8** %3
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
%20 = add nsw i64 %19, 1
%21 = trunc i64 %20 to i32
store i32 %21, i32* %2
br label %22
22: ; preds = %14, %13, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_path(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = ptrtoint i8* %4 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = add i32 %10, 1
br label %12
12: ; preds = %3, %1, %6
%13 = phi i32 [ %11, %6 ], [ 0, %1 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_and_exit() {
  fprintf(stderr, "Memory allocation error\n\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_and_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Memory allocation error\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_and_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void EC_GROUP_get_basis_type(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_get_basis_type() {
ret void
}
/* Variables and functions */
int M_PI;
double deg2rad(double deg) { return deg * (M_PI / 180); }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @deg2rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 180
%6 = sitofp i32 %5 to double
%7 = fmul double %3, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @deg2rad(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 180
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
ret double %5
}
int ConvertStrToInt(char *pStr, int Init, int Factor) {
  while (*pStr) {
    Init *= Factor;
    Init += *pStr++;
  }
  return Init;
}


x86 assembly (clang, -O0):
<ConvertStrToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <ConvertStrToInt+0x42>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110e <ConvertStrToInt+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertStrToInt>:
mov    %esi,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <ConvertStrToInt+0x23>
add    $0x1,%rdi
nopl   0x0(%rax)
imul   %edx,%eax
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ConvertStrToInt+0x10>
ret

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

LLVM IR (-O2):
define i32 @ConvertStrToInt(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = phi i32 [ %13, %6 ], [ %1, %3 ]
%10 = mul nsw i32 %9, %2
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = sext i8 %7 to i32
%13 = add nsw i32 %10, %12
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3
%17 = phi i32 [ %1, %3 ], [ %13, %6 ]
ret i32 %17
}
int process_msyn_fin() { return 0; }


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

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

LLVM IR (-O0):
define i32 @process_msyn_fin() {
ret i32 0
}

LLVM IR (-O2):
define i32 @process_msyn_fin() {
ret i32 0
}
/* Type definitions */
struct Foo {
  int dummy;
};
struct Bar {
  int dummy;
};

/* Variables and functions */
struct Foo *alloc_foo();
struct Foo *alloc_void();
void call_alloc() {
  struct Foo *p = alloc_void();
  struct Foo *w = alloc_foo();
  struct Foo *q = (struct Foo *)alloc_void();
  struct Foo *r = (struct Foo *)(struct Bar *)alloc_void();
}


x86 assembly (clang, -O0):
<call_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <alloc_void@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <alloc_foo@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <alloc_void@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <alloc_void@plt>
mov    %rax,-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_alloc>:
push   %rax
xor    %eax,%eax
call   1040 <alloc_void@plt>
xor    %eax,%eax
call   1030 <alloc_foo@plt>
xor    %eax,%eax
call   1040 <alloc_void@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <alloc_void@plt>

LLVM IR (-O0):
%struct.Foo = type { i32 }
%struct.Bar = type { i32 }
define void @call_alloc() {
%1 = alloca %struct.Foo*
%2 = alloca %struct.Foo*
%3 = alloca %struct.Foo*
%4 = alloca %struct.Foo*
%5 = call %struct.Foo* (...) @alloc_void()
store %struct.Foo* %5, %struct.Foo** %1
%6 = call %struct.Foo* (...) @alloc_foo()
store %struct.Foo* %6, %struct.Foo** %2
%7 = call %struct.Foo* (...) @alloc_void()
store %struct.Foo* %7, %struct.Foo** %3
%8 = call %struct.Foo* (...) @alloc_void()
%9 = bitcast %struct.Foo* %8 to %struct.Bar*
%10 = bitcast %struct.Bar* %9 to %struct.Foo*
store %struct.Foo* %10, %struct.Foo** %4
ret void
}

LLVM IR (-O2):
%struct.Foo = type { i32 }
define void @call_alloc() {
%1 = tail call %struct.Foo* (...) @alloc_void()
%2 = tail call %struct.Foo* (...) @alloc_foo()
%3 = tail call %struct.Foo* (...) @alloc_void()
%4 = tail call %struct.Foo* (...) @alloc_void()
ret void
}