xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SYS_ioprio_get;
int syscall(int /*<<< orphan*/, int, int);
int ioprio_get(int which, int who) {
  return syscall(SYS_ioprio_get, which, who);
}


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

x86 assembly (clang, -O2):
<ioprio_get>:
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_ioprio_get = global i32 0
define i32 @ioprio_get(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_ioprio_get
%4 = tail call i32 @syscall(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
void termina_jogo() {}


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

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

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

LLVM IR (-O2):
define void @termina_jogo() {
ret void
}
void _MONITOR(void) {}


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

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

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

LLVM IR (-O2):
define void @_MONITOR() {
ret void
}
void irq_lock_sparse(void) {}


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

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

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

LLVM IR (-O2):
define void @irq_lock_sparse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ActUponClientInput(char *, int);
int getLength(char *);
int /*<<< orphan*/ readn(int, char *, int);
void go(int fd) {
  char input[2048];
  int a;
  readn(fd, input, 2);
  a = getLength(input);
  readn(fd, input, a - 2);
  ActUponClientInput(input, fd);
}


x86 assembly (clang, -O0):
<go>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    $0x2,%edx
call   1040 <readn@plt>
lea    -0x810(%rbp),%rdi
call   1050 <getLength@plt>
mov    %eax,-0x814(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    -0x814(%rbp),%edx
sub    $0x2,%edx
call   1040 <readn@plt>
lea    -0x810(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <ActUponClientInput@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<go>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <readn@plt>
mov    %r14,%rdi
call   1050 <getLength@plt>
lea    -0x2(%rax),%edx
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <readn@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <ActUponClientInput@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @go(i32 %0) {
%2 = alloca i32
%3 = alloca [2048 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%7 = call i32 @readn(i32 %5, i8* %6, i32 2)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @getLength(i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 2
%14 = call i32 @readn(i32 %10, i8* %11, i32 %13)
%15 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%16 = load i32, i32* %2
%17 = call i32 @ActUponClientInput(i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @go(i32 %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @readn(i32 %0, i8* %3, i32 2)
%5 = call i32 @getLength(i8* %3)
%6 = add nsw i32 %5, -2
%7 = call i32 @readn(i32 %0, i8* %3, i32 %6)
%8 = call i32 @ActUponClientInput(i8* %3, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int, int, int);
int main() {
  int s1, s2;
  s1 = sum(5, 1, 2, 3, 4, 5);
  printf("%d\n", s1);
  s2 = sum(5, 1, 2, 3, 4, 5);
  printf("%d\n", s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1040 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <sum@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int _creat(char const *, int /*<<< orphan*/);
int creat(const char *path, mode_t mode) { return _creat(path, mode); }


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

x86 assembly (clang, -O2):
<creat>:
jmp    1030 <_creat@plt>

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

LLVM IR (-O2):
define i32 @creat(i8* %0, i32 %1) {
%3 = tail call i32 @_creat(i8* %0, i32 %1)
ret i32 %3
}
void lockdep_init_task(struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @lockdep_init_task(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ cbrt(double);
float cbrtf(float x) { return (float)cbrt((double)x); }


x86 assembly (clang, -O0):
<cbrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <cbrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <cbrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cbrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @cbrt(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @cbrtf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @cbrt(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ print_letters(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char *);
void print_arguments(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    print_letters(strlen(argv[i]), argv[i]);
  }
}


x86 assembly (clang, -O0):
<print_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1174 <print_arguments+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <print_letters@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <print_arguments+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arguments>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    115d <print_arguments+0x3d>
mov    %rsi,%r15
mov    %edi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <strlen@plt>
mov    (%r15,%rbx,8),%rsi
mov    %eax,%edi
call   1040 <print_letters@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <print_arguments+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_arguments(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %14, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @strlen(i8* %10)
%12 = load i8*, i8** %9
%13 = tail call i32 @print_letters(i32 %11, i8* %12)
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ _ripremove(void *);
int /*<<< orphan*/ free(void *);
extern void _VDBG_free(void *ptr, char *file, long line) {
  if (ptr) {
    ptr = (void *)(((char *)ptr) - 64);
    _ripremove(ptr);
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<_VDBG_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115d <_VDBG_free+0x3d>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffc0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_ripremove@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_VDBG_free>:
test   %rdi,%rdi
je     113e <_VDBG_free+0x1e>
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffc0,%rbx
mov    %rbx,%rdi
call   1040 <_ripremove@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @_VDBG_free(i8* %0, i8* nocapture readnone %1, i64 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 -64
%7 = tail call i32 @_ripremove(i8* %6)
%8 = tail call i32 @free(i8* %6)
br label %9
9: ; preds = %5, %3
ret void
}
unsigned long IPCMtoCSharedRamConvert(unsigned long ulShareAddress) {
  unsigned long returnStatus;
  if (ulShareAddress >= 0x2007F000) {
    returnStatus = ((ulShareAddress - 0x20000000) >> 1);
  } else {
    returnStatus = ((ulShareAddress - 0x1FFF0000) >> 1);
  }
  return returnStatus;
}


x86 assembly (clang, -O0):
<IPCMtoCSharedRamConvert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x2007f000,-0x8(%rbp)
20
jb     112d <IPCMtoCSharedRamConvert+0x2d>
mov    -0x8(%rbp),%rax
sub    $0x20000000,%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113f <IPCMtoCSharedRamConvert+0x3f>
mov    -0x8(%rbp),%rax
sub    $0x1fff0000,%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPCMtoCSharedRamConvert>:
xor    %eax,%eax
cmp    $0x2007f000,%rdi
setb   %al
shl    $0x10,%rax
add    %rdi,%rax
add    $0xffffffffe0000000,%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @IPCMtoCSharedRamConvert(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp uge i64 %4, 537391104
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sub i64 %7, 536870912
%9 = lshr i64 %8, 1
store i64 %9, i64* %3
br label %14
10: ; preds = %1
%11 = load i64, i64* %2
%12 = sub i64 %11, 536805376
%13 = lshr i64 %12, 1
store i64 %13, i64* %3
br label %14
14: ; preds = %10, %6
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @IPCMtoCSharedRamConvert(i64 %0) {
%2 = icmp ugt i64 %0, 537391103
%3 = select i1 %2, i64 -536870912, i64 -536805376
%4 = add i64 %3, %0
%5 = lshr i64 %4, 1
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ SwapTile(int, int);
void SwapTileRow(int first, int second, int length) {
  for (int i = 0; i < length; i++)
    SwapTile(first + i, second + i);
}


x86 assembly (clang, -O0):
<SwapTileRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1153 <SwapTileRow+0x43>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x10(%rbp),%esi
call   1030 <SwapTile@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <SwapTileRow+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapTileRow>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1135 <SwapTileRow+0x25>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <SwapTile@plt>
add    $0x1,%ebp
add    $0x1,%ebx
add    $0xffffffff,%r14d
jne    1120 <SwapTileRow+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @SwapTileRow(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %11, %6 ], [ 0, %3 ]
%8 = add nsw i32 %7, %0
%9 = add nsw i32 %7, %1
%10 = tail call i32 @SwapTile(i32 %8, i32 %9)
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %2
br i1 %12, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned int plusccib(unsigned int a, unsigned int b) {
  unsigned int sum = a + b;
  if (sum < b)
    abort();
  return sum;
}


x86 assembly (clang, -O0):
<plusccib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    113a <plusccib+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plusccib>:
add    %esi,%edi
jb     1117 <plusccib+0x7>
mov    %edi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @plusccib(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 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @plusccib(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ult i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Delay(int);
int /*<<< orphan*/ RegisterAs(char *);
int /*<<< orphan*/ Send(int, char *, int, int /*<<< orphan*/,
                        int /*<<< orphan*/);
int WhoIs(char *);
main() {
  char sendData = 's';
  int tid_trainCommandSrv;
  RegisterAs("SensorSched");
  Delay(10);
  tid_trainCommandSrv = WhoIs("TrainCommandSrv");
  while (1) {
    Send(tid_trainCommandSrv, &sendData, sizeof(char), 0, 0);
    Delay(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x73,-0x5(%rbp)
lea    0xea6(%rip),%rdi
call   1060 <RegisterAs@plt>
mov    $0xa,%edi
call   1030 <Delay@plt>
lea    0xe9c(%rip),%rdi
call   1040 <WhoIs@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1050 <Send@plt>
mov    $0x2,%edi
call   1030 <Delay@plt>
jmp    1178 <main+0x38>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x73,0x7(%rsp)
lea    0xeb0(%rip),%rdi
call   1060 <RegisterAs@plt>
mov    $0xa,%edi
call   1030 <Delay@plt>
lea    0xea6(%rip),%rdi
call   1040 <WhoIs@plt>
mov    %eax,%ebx
lea    0x7(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1050 <Send@plt>
mov    $0x2,%edi
call   1030 <Delay@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [12 x i8] c"SensorSched\00"
@.str.1 = [16 x i8] c"TrainCommandSrv\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i8 115, i8* %2
%4 = call i32 @RegisterAs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @Delay(i32 10)
%6 = call i32 @WhoIs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 %6, i32* %3
br label %7
7: ; preds = %0, %7
%8 = load i32, i32* %3
%9 = call i32 @Send(i32 %8, i8* %2, i32 1, i32 0, i32 0)
%10 = call i32 @Delay(i32 2)
br label %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"SensorSched\00"
@.str.1 = [16 x i8] c"TrainCommandSrv\00"
define i32 @main() {
%1 = alloca i8
store i8 115, i8* %1
%2 = tail call i32 @RegisterAs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @Delay(i32 10)
%4 = tail call i32 @WhoIs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %5, %0
%6 = call i32 @Send(i32 %4, i8* %1, i32 1, i32 0, i32 0)
%7 = call i32 @Delay(i32 2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_voicetarget_callback(void *user_data) {
  printf("voicetarget_callback\n");
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"voicetarget_callback\00"
define void @mumble_voicetarget_callback(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
char *strchr(const char *string, char ch) {
  while (*string && *string != ch)
    string++;
  if (*string == ch)
    return (string);
  return ((void *)0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1136 <strchr+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1146 <strchr+0x46>
jmp    1157 <strchr+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <strchr+0xe>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1177 <strchr+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <strchr+0x7f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1121 <strchr+0x21>
cmp    %sil,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
cmp    %sil,%cl
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = select i1 %7, i8* %4, i8* null
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f9(unsigned int x, unsigned int y) {
  unsigned int r = x + y;
  if (r >= x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     113a <f9+0x2a>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
push   %rbx
mov    %edi,%ebx
add    %esi,%ebx
jb     111e <f9+0xe>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f9(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 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp uge i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @f9(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ult i32 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
void *reg_get(char *regpath) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @reg_get(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ _ACC_mpool_get_async(void **, int);
void _ACC_mpool_get(void **ptr) { _ACC_mpool_get_async(ptr, (-1)); }


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

x86 assembly (clang, -O2):
<_ACC_mpool_get>:
mov    $0xffffffff,%esi
jmp    1030 <_ACC_mpool_get_async@plt>

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

LLVM IR (-O2):
define void @_ACC_mpool_get(i8** %0) {
%2 = tail call i32 @_ACC_mpool_get_async(i8** %0, i32 -1)
ret void
}
int test_imm_9Bint32_reg(int val) { return ((val) & (0x9B << 0)) ? -20 : -40; }


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

x86 assembly (clang, -O2):
<test_imm_9Bint32_reg>:
test   $0x9b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Bint32_reg(i32 %0) {
%2 = and i32 %0, 155
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strtol(char const *, char **, int);
int parse_int(const char *str, int *ret) {
  char *test;
  int temp;
  temp = strtol(str, &test, 10);
  if (*test != '\0')
    return 0;
  *ret = temp;
  return 1;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <parse_int+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1161 <parse_int+0x51>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x8(%rsp),%rdx
xor    %ecx,%ecx
cmpb   $0x0,(%rdx)
jne    113a <parse_int+0x2a>
mov    %eax,(%rbx)
mov    $0x1,%ecx
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parse_int(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 %5, i32* %1
br label %10
10: ; preds = %2, %9
%11 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %11
}
int _is_sandybridge(int devid) {
  int ret = 0;
  switch (devid) {
  case 0x0102:
  case 0x0112:
  case 0x0122:
  case 0x0106:
  case 0x0116:
  case 0x0126:
  case 0x010A:
    ret = 1;
    break;
  default:
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<_is_sandybridge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x102,%eax
je     1196 <_is_sandybridge+0x96>
jmp    1124 <_is_sandybridge+0x24>
mov    -0xc(%rbp),%eax
sub    $0x106,%eax
je     1196 <_is_sandybridge+0x96>
jmp    1137 <_is_sandybridge+0x37>
mov    -0xc(%rbp),%eax
sub    $0x10a,%eax
je     1196 <_is_sandybridge+0x96>
jmp    114a <_is_sandybridge+0x4a>
mov    -0xc(%rbp),%eax
sub    $0x112,%eax
je     1196 <_is_sandybridge+0x96>
jmp    115d <_is_sandybridge+0x5d>
mov    -0xc(%rbp),%eax
sub    $0x116,%eax
je     1196 <_is_sandybridge+0x96>
jmp    1170 <_is_sandybridge+0x70>
mov    -0xc(%rbp),%eax
sub    $0x122,%eax
je     1196 <_is_sandybridge+0x96>
jmp    1183 <_is_sandybridge+0x83>
mov    -0xc(%rbp),%eax
sub    $0x126,%eax
jne    11a2 <_is_sandybridge+0xa2>
jmp    1196 <_is_sandybridge+0x96>
movl   $0x1,-0x8(%rbp)
jmp    11a7 <_is_sandybridge+0xa7>
jmp    11a7 <_is_sandybridge+0xa7>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_sandybridge>:
add    $0xfffffefe,%edi
rol    $0x1e,%edi
xor    %eax,%eax
cmp    $0x9,%edi
ja     111d <_is_sandybridge+0x1d>
movslq %edi,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @_is_sandybridge(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 258, label %5
i32 274, label %5
i32 290, label %5
i32 262, label %5
i32 278, label %5
i32 294, label %5
i32 266, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@switch.table._is_sandybridge = [10 x i32] [i32 1, i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 1]
define i32 @_is_sandybridge(i32 %0) {
%2 = add i32 %0, -258
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 30)
%4 = icmp ult i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table._is_sandybridge, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ tpchr(char);
main() {
  char *msg;
  char ch;
  while (ch = *msg++) {
    tpchr(ch);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1149 <main+0x39>
movsbl -0x11(%rbp),%edi
call   1030 <tpchr@plt>
jmp    111f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i8, i8* %3
%11 = call i32 @tpchr(i8 signext %10)
br label %4
12: ; preds = %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
/* Type definitions */
struct render_backend {
  int dummy;
};
struct host {
  int dummy;
};

/* Variables and functions */
struct render_backend *video_create_renderer_from(struct host *base,
                                                  struct render_backend *from) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.host = type { i32 }
%struct.render_backend = type { i32 }
define %struct.render_backend* @video_create_renderer_from(%struct.host* %0, %struct.render_backend* %1) {
%3 = alloca %struct.host*
%4 = alloca %struct.render_backend*
store %struct.host* %0, %struct.host** %3
store %struct.render_backend* %1, %struct.render_backend** %4
ret %struct.render_backend* null
}

LLVM IR (-O2):
%struct.host = type { i32 }
%struct.render_backend = type { i32 }
define noalias %struct.render_backend* @video_create_renderer_from(%struct.host* nocapture readnone %0, %struct.render_backend* nocapture readnone %1) {
ret %struct.render_backend* null
}
int g(int a) {
  unsigned int b = __builtin_bswap32(__builtin_bswap32(a));
  return b;
}


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

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

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @llvm.bswap.i32(i32 %4)
%6 = call i32 @llvm.bswap.i32(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @g(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world from C!\n");
  printf("YES!");
  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 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [5 x i8] c"YES!\00"
@str = [20 x i8] c"Hello world from C!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("hello \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
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 = [8 x i8] c"hello \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"hello \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int sys$expreg(unsigned int pagcnt, struct _va_range *retadr,
               unsigned int acmode, char region) {
  return ({
    unsigned long resultvar;
    register long int _a4 asm("r10") = (long)((int)region);
    register long int _a3 asm("rdx") = (long)(acmode);
    register long int _a2 asm("rsi") = (long)(retadr);
    register long int _a1 asm("rdi") = (long)(pagcnt);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(49), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$expreg>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%r10
mov    $0x31,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$expreg>:
movslq %ecx,%r10
mov    %edx,%edx
mov    %edi,%edi
mov    $0x31,%rax
int    $0x81
ret

LLVM IR (-O0):
%struct._va_range = type opaque
define i32 @"sys$expreg"(i32 %0, %struct._va_range* %1, i32 %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca %struct._va_range*
%7 = alloca i32
%8 = alloca i8
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i32 %0, i32* %5
store %struct._va_range* %1, %struct._va_range** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%15 = load i8, i8* %8
%16 = sext i8 %15 to i32
%17 = sext i32 %16 to i64
store i64 %17, i64* %10
%18 = load i32, i32* %7
%19 = zext i32 %18 to i64
store i64 %19, i64* %11
%20 = load %struct._va_range*, %struct._va_range** %6
%21 = ptrtoint %struct._va_range* %20 to i64
store i64 %21, i64* %12
%22 = load i32, i32* %5
%23 = zext i32 %22 to i64
store i64 %23, i64* %13
%24 = load i64, i64* %13
%25 = load i64, i64* %12
%26 = load i64, i64* %11
%27 = load i64, i64* %10
%28 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 49, i64 %24, i64 %25, i64 %26, i64 %27)
store i64 %28, i64* %9
%29 = load i64, i64* %9
store i64 %29, i64* %14
%30 = load i64, i64* %14
%31 = trunc i64 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
%struct._va_range = type opaque
define i32 @"sys$expreg"(i32 %0, %struct._va_range* %1, i32 %2, i8 signext %3) {
%5 = sext i8 %3 to i64
%6 = zext i32 %2 to i64
%7 = ptrtoint %struct._va_range* %1 to i64
%8 = zext i32 %0 to i64
%9 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 49, i64 %8, i64 %7, i64 %6, i64 %5)
%10 = trunc i64 %9 to i32
ret i32 %10
}
void multiplication(unsigned U, signed S) {
  if (S > 5)
    S = U * S;
  if (S < -10)
    S = U * S;
}


x86 assembly (clang, -O0):
<multiplication>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    111e <multiplication+0x1e>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xfffffff6,-0x8(%rbp)
jge    1132 <multiplication+0x32>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @multiplication(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strbuf_cleanup(struct strbuf *);
void strbuf_cleanupp(struct strbuf **p) {
  if (*p)
    strbuf_cleanup(*p);
}


x86 assembly (clang, -O0):
<strbuf_cleanupp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <strbuf_cleanupp+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strbuf_cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_cleanupp>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <strbuf_cleanupp+0xd>
jmp    1030 <strbuf_cleanup@plt>
ret

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define void @strbuf_cleanupp(%struct.strbuf** %0) {
%2 = alloca %struct.strbuf**
store %struct.strbuf** %0, %struct.strbuf*** %2
%3 = load %struct.strbuf**, %struct.strbuf*** %2
%4 = load %struct.strbuf*, %struct.strbuf** %3
%5 = icmp ne %struct.strbuf* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.strbuf**, %struct.strbuf*** %2
%8 = load %struct.strbuf*, %struct.strbuf** %7
%9 = call i32 @strbuf_cleanup(%struct.strbuf* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define void @strbuf_cleanupp(%struct.strbuf** nocapture %0) {
%2 = load %struct.strbuf*, %struct.strbuf** %0
%3 = icmp eq %struct.strbuf* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @strbuf_cleanup(%struct.strbuf* %2)
br label %6
6: ; preds = %4, %1
ret void
}
void ff_hevc_put_hevc_bi_w_epel_h64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h64_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nhapchuoi();
int main() {
  nhapchuoi();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nhapchuoi()
ret i32 0
}
unsigned long test_flag(unsigned long mask,
                        const volatile unsigned long *addr) {
  return ((*addr) & mask) != 0;
}


x86 assembly (clang, -O0):
<test_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_flag>:
xor    %eax,%eax
and    (%rsi),%rdi
setne  %al
ret

LLVM IR (-O0):
define i64 @test_flag(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 volatile i64, i64* %5
%7 = load i64, i64* %3
%8 = and i64 %6, %7
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @test_flag(i64 %0, i64* %1) {
%3 = load volatile i64, i64* %1
%4 = and i64 %3, %0
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
ret i64 %6
}
void display_splash_screen() {}


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

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

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

LLVM IR (-O2):
define void @display_splash_screen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jffs2_lzo_init();
int /*<<< orphan*/ jffs2_rtime_init();
int /*<<< orphan*/ jffs2_zlib_init();
int jffs2_compressors_init(void) {
  jffs2_zlib_init();
  jffs2_rtime_init();
  jffs2_lzo_init();
  return 0;
}


x86 assembly (clang, -O0):
<jffs2_compressors_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <jffs2_zlib_init@plt>
mov    $0x0,%al
call   1050 <jffs2_rtime_init@plt>
mov    $0x0,%al
call   1040 <jffs2_lzo_init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jffs2_compressors_init>:
push   %rax
xor    %eax,%eax
call   1030 <jffs2_zlib_init@plt>
xor    %eax,%eax
call   1050 <jffs2_rtime_init@plt>
xor    %eax,%eax
call   1040 <jffs2_lzo_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @jffs2_compressors_init() {
%1 = call i32 (...) @jffs2_zlib_init()
%2 = call i32 (...) @jffs2_rtime_init()
%3 = call i32 (...) @jffs2_lzo_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @jffs2_compressors_init() {
%1 = tail call i32 (...) @jffs2_zlib_init()
%2 = tail call i32 (...) @jffs2_rtime_init()
%3 = tail call i32 (...) @jffs2_lzo_init()
ret i32 0
}