xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _tty_error(char const *message, int ret) {
  fputs("tty"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_tty_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tty_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"tty: \00"
@stderr = global i32 0
define i32 @_tty_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"tty: \00"
@stderr = global i32 0
define i32 @_tty_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
struct object *read_exp(void *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
struct object *prim_read(void *workspace, struct object *args) {
  return read_exp(workspace, stdin);
}


x86 assembly (clang, -O0):
<prim_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1030 <read_exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim_read>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <read_exp@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
@stdin = global i32 0
define %struct.object* @prim_read(i8* %0, %struct.object* %1) {
%3 = alloca i8*
%4 = alloca %struct.object*
store i8* %0, i8** %3
store %struct.object* %1, %struct.object** %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @stdin
%7 = call %struct.object* @read_exp(i8* %5, i32 %6)
ret %struct.object* %7
}

LLVM IR (-O2):
%struct.object = type { i32 }
@stdin = global i32 0
define %struct.object* @prim_read(i8* %0, %struct.object* nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call %struct.object* @read_exp(i8* %0, i32 %3)
ret %struct.object* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_short_usage(FILE *stream) {
  (void)fputs("Usage: fnv [-a] [-h] [-u] [-X] [-1] [-32] [STRINGS]\n", stream);
}


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

x86 assembly (clang, -O2):
<print_short_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x34,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Usage: fnv [-a] [-h] [-u] [-X] [-1] [-32] [STRINGS]\0A\00"
define void @print_short_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Usage: fnv [-a] [-h] [-u] [-X] [-1] [-32] [STRINGS]\0A\00"
define void @print_short_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 52, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d %d\n", a * b, 2 * (a + b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
shl    $0x1,%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
mov    %edx,%esi
imul   %eax,%esi
add    %eax,%edx
add    %edx,%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %7, %6
%10 = shl nsw i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char MapsWithMe_Base64Char(int x) {
  assert(x >= 0 && x < 64);
  return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[x];
}


x86 assembly (clang, -O0):
<MapsWithMe_Base64Char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <MapsWithMe_Base64Char+0x24>
cmpl   $0x40,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0x4(%rbp),%rcx
lea    0xeb4(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MapsWithMe_Base64Char>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
setb   %dil
call   1030 <assert@plt>
movslq %ebx,%rax
lea    0xed5(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\00"
define signext i8 @MapsWithMe_Base64Char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 64
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [65 x i8], [65 x i8]* @.str, i64 0, i64 %13
%15 = load i8, i8* %14
ret i8 %15
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\00"
define signext i8 @MapsWithMe_Base64Char(i32 %0) {
%2 = icmp ult i32 %0, 64
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [65 x i8], [65 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
int recomputeImgSz(int x) { return ((x / 16) + 1) * 16; }


x86 assembly (clang, -O0):
<recomputeImgSz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
shl    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<recomputeImgSz>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @recomputeImgSz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 16
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @recomputeImgSz(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = shl nsw i32 %2, 4
%4 = add i32 %3, 16
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_mday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int get_mday_today() {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  return timeinfo->tm_mday;
}


x86 assembly (clang, -O0):
<get_mday_today>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mday_today>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @get_mday_today() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @get_mday_today() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void f2(void f_p(int *), int *p2) {
  printf("\nin f2 getted pointer p2 = %p, and * p2 = %d;\n", p2, *p2);
  f_p(p2);
  printf("end of f2;\n\n");
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edx
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   *%r14
lea    0xee8(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\0Ain f2 getted pointer p2 = %p, and * p2 = %d;\0A\00"
@.str.1 = [13 x i8] c"end of f2;\0A\0A\00"
define void @f2(void (i32*)* %0, i32* %1) {
%3 = alloca void (i32*)*
%4 = alloca i32*
store void (i32*)* %0, void (i32*)** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32* %5, i32 %7)
%9 = load void (i32*)*, void (i32*)** %3
%10 = load i32*, i32** %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0Ain f2 getted pointer p2 = %p, and * p2 = %d;\0A\00"
@str = [12 x i8] c"end of f2;\0A\00"
define void @f2(void (i32*)* nocapture %0, i32* %1) {
%3 = load i32, i32* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32* %1, i32 %3)
tail call void %0(i32* %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HandleAnimation(int /*<<< orphan*/);
void InitAnimation() { HandleAnimation(0); }


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

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

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

LLVM IR (-O2):
define void @InitAnimation() {
%1 = tail call i32 @HandleAnimation(i32 0)
ret void
}
int matchdot(char c) {
  (void)c;
  return 1;
}


x86 assembly (clang, -O0):
<matchdot>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @matchdot(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i32 1
}

LLVM IR (-O2):
define i32 @matchdot(i8 signext %0) {
ret i32 1
}
void initTLSAndUpdateStatus() {}


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

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

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

LLVM IR (-O2):
define void @initTLSAndUpdateStatus() {
ret void
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int __syscall_ret(int /*<<< orphan*/);
int sched_setscheduler(pid_t pid, int sched, const struct sched_param *param) {
  return __syscall_ret(-ENOSYS);
}


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

x86 assembly (clang, -O2):
<sched_setscheduler>:
mov    0x2ed1(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
jmp    1030 <__syscall_ret@plt>

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@ENOSYS = global i32 0
define i32 @sched_setscheduler(i32 %0, i32 %1, %struct.sched_param* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sched_param*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.sched_param* %2, %struct.sched_param** %6
%7 = load i32, i32* @ENOSYS
%8 = sub nsw i32 0, %7
%9 = call i32 @__syscall_ret(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@ENOSYS = global i32 0
define i32 @sched_setscheduler(i32 %0, i32 %1, %struct.sched_param* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = sub nsw i32 0, %4
%6 = tail call i32 @__syscall_ret(i32 %5)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
FILE *sys_tmpfile(void) { return NULL; }


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

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

LLVM IR (-O0):
define i32* @sys_tmpfile() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @sys_tmpfile() {
ret i32* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *makename(char *, char const *, int /*<<< orphan*/);
char *xcb_atom_name_by_screen(const char *base, uint8_t screen) {
  return makename("%s_S%u", base, screen);
}


x86 assembly (clang, -O0):
<xcb_atom_name_by_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <makename@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_atom_name_by_screen>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <makename@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s_S%u\00"
define i8* @xcb_atom_name_by_screen(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 i8* @makename(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s_S%u\00"
define i8* @xcb_atom_name_by_screen(i8* %0, i32 %1) {
%3 = tail call i8* @makename(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i8* %3
}
void b(int i) { ; }


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

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

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

LLVM IR (-O2):
define void @b(i32 %0) {
ret void
}
double max2(double a, double b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <max2+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max2+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max2(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
double div_by(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<div_by>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_by>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @div_by(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @div_by(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
short horiz_mode_code_white(short runlen) {
  return (runlen < 64 ? runlen + 2 : (runlen / 64) + 65);
}


x86 assembly (clang, -O0):
<horiz_mode_code_white>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x40,%eax
jge    1127 <horiz_mode_code_white+0x27>
movswl -0x2(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <horiz_mode_code_white+0x39>
movswl -0x2(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<horiz_mode_code_white>:
movzwl %di,%ecx
lea    0x2(%rdi),%edx
mov    %ecx,%eax
shr    $0x6,%eax
add    $0x41,%eax
cmp    $0x40,%cx
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define signext i16 @horiz_mode_code_white(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp slt i32 %4, 64
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = add nsw i32 %8, 2
br label %15
10: ; preds = %1
%11 = load i16, i16* %2
%12 = sext i16 %11 to i32
%13 = sdiv i32 %12, 64
%14 = add nsw i32 %13, 65
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @horiz_mode_code_white(i16 signext %0) {
%2 = icmp slt i16 %0, 64
%3 = add nsw i16 %0, 2
%4 = lshr i16 %0, 6
%5 = add nuw nsw i16 %4, 65
%6 = select i1 %2, i16 %3, i16 %5
ret i16 %6
}
void pal_dma_scsi_get_dma_addr(void *port, void *dma_addr,
                               unsigned int *dma_len) {}


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

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

LLVM IR (-O0):
define void @pal_dma_scsi_get_dma_addr(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
define void @pal_dma_scsi_get_dma_addr(i8* nocapture %0, i8* nocapture %1, i32* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct can_frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ usbcan_send_n(int /*<<< orphan*/, int /*<<< orphan*/,
                                 struct can_frame *, int);
uint32_t usbcan_send(uint32_t dev, uint32_t bus, struct can_frame *frame) {
  return usbcan_send_n(dev, bus, frame, 1);
}


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

x86 assembly (clang, -O2):
<usbcan_send>:
mov    $0x1,%ecx
jmp    1030 <usbcan_send_n@plt>

LLVM IR (-O0):
%struct.can_frame = type { i32 }
define i32 @usbcan_send(i32 %0, i32 %1, %struct.can_frame* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.can_frame*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.can_frame* %2, %struct.can_frame** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.can_frame*, %struct.can_frame** %6
%10 = call i32 @usbcan_send_n(i32 %7, i32 %8, %struct.can_frame* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.can_frame = type { i32 }
define i32 @usbcan_send(i32 %0, i32 %1, %struct.can_frame* %2) {
%4 = tail call i32 @usbcan_send_n(i32 %0, i32 %1, %struct.can_frame* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
main() { f(5); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void tv_add(struct timeval *time, uint32_t offset) {
  time->tv_usec += offset;
  if (time->tv_usec > 1000000) {
    time->tv_sec++;
    time->tv_usec -= 1000000;
  }
}


x86 assembly (clang, -O0):
<tv_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0xf4240,(%rax)
jle    1147 <tv_add+0x47>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0xf4240,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv_add>:
add    (%rdi),%esi
mov    %esi,(%rdi)
cmp    $0xf4241,%esi
jl     1118 <tv_add+0x18>
addl   $0x1,0x4(%rdi)
add    $0xfff0bdc0,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @tv_add(%struct.timeval* %0, i64 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %5
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load %struct.timeval*, %struct.timeval** %3
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = icmp sgt i32 %14, 1000000
br i1 %15, label %16, label %25
16: ; preds = %2
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
%21 = load %struct.timeval*, %struct.timeval** %3
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %21, i32 0, i32 0
%23 = load i32, i32* %22
%24 = sub nsw i32 %23, 1000000
store i32 %24, i32* %22
br label %25
25: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @tv_add(%struct.timeval* nocapture %0, i64 %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = trunc i64 %1 to i32
%6 = add i32 %4, %5
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 1000000
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
%12 = add nsw i32 %6, -1000000
store i32 %12, i32* %3
br label %13
13: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alist_save(struct hle_t *, int, int, int);
void SAVEBUFF(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  uint16_t count = (w1 >> 12) & 0xfff;
  uint16_t dmem = (w1 & 0xfff);
  uint32_t address = (w2 & 0xffffff);
  alist_save(hle, dmem, address, count);
}


x86 assembly (clang, -O0):
<SAVEBUFF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0xc,%eax
and    $0xfff,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <alist_save@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAVEBUFF>:
mov    %esi,%ecx
shr    $0xc,%ecx
and    $0xfff,%ecx
and    $0xfff,%esi
and    $0xffffff,%edx
jmp    1030 <alist_save@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @SAVEBUFF(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = ashr i32 %10, 12
%12 = and i32 %11, 4095
store i32 %12, i32* %7
%13 = load i32, i32* %5
%14 = and i32 %13, 4095
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = and i32 %15, 16777215
store i32 %16, i32* %9
%17 = load %struct.hle_t*, %struct.hle_t** %4
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = load i32, i32* %7
%21 = call i32 @alist_save(%struct.hle_t* %17, i32 %18, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @SAVEBUFF(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 12
%5 = and i32 %4, 4095
%6 = and i32 %1, 4095
%7 = and i32 %2, 16777215
%8 = tail call i32 @alist_save(%struct.hle_t* %0, i32 %6, i32 %7, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f1();
int f2();
int main(void) {
  if (f1() != 17 || f1() != 17 || f2() != 17 || f2() != 17)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <f1@plt>
cmp    $0x11,%eax
jne    117f <main+0x4f>
mov    $0x0,%al
call   1050 <f1@plt>
cmp    $0x11,%eax
jne    117f <main+0x4f>
mov    $0x0,%al
call   1030 <f2@plt>
cmp    $0x11,%eax
jne    117f <main+0x4f>
mov    $0x0,%al
call   1030 <f2@plt>
cmp    $0x11,%eax
je     1186 <main+0x56>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
cmp    $0x11,%eax
jne    1165 <main+0x35>
xor    %eax,%eax
call   1050 <f1@plt>
cmp    $0x11,%eax
jne    1165 <main+0x35>
xor    %eax,%eax
call   1030 <f2@plt>
cmp    $0x11,%eax
jne    1165 <main+0x35>
xor    %eax,%eax
call   1030 <f2@plt>
cmp    $0x11,%eax
jne    1165 <main+0x35>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = icmp ne i32 %2, 17
br i1 %3, label %13, label %4
4: ; preds = %0
%5 = call i32 (...) @f1()
%6 = icmp ne i32 %5, 17
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = call i32 (...) @f2()
%9 = icmp ne i32 %8, 17
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = call i32 (...) @f2()
%12 = icmp ne i32 %11, 17
br i1 %12, label %13, label %15
13: ; preds = %10, %7, %4, %0
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = icmp eq i32 %1, 17
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = tail call i32 (...) @f1()
%5 = icmp eq i32 %4, 17
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = tail call i32 (...) @f2()
%8 = icmp eq i32 %7, 17
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i32 (...) @f2()
%11 = icmp eq i32 %10, 17
br i1 %11, label %14, label %12
12: ; preds = %9, %6, %3, %0
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %9
ret i32 0
}
/* Variables and functions */
int voronoi_F1F2(float, float, float);
float voronoi_Cr(float x, float y, float z) {
  float t = 10 * voronoi_F1F2(x, y, z);
  if (t > 1.f)
    return 1.f;
  return t;
}


x86 assembly (clang, -O0):
<voronoi_Cr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <voronoi_F1F2@plt>
imul   $0xa,%eax,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xeac(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    116f <voronoi_Cr+0x5f>
movss  0xe9b(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1179 <voronoi_Cr+0x69>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voronoi_Cr>:
push   %rax
call   1030 <voronoi_F1F2@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
test   %eax,%eax
mov    $0x1,%ecx
cmovle %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @voronoi_Cr(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = call i32 @voronoi_F1F2(float %9, float %10, float %11)
%13 = mul nsw i32 10, %12
%14 = sitofp i32 %13 to float
store float %14, float* %8
%15 = load float, float* %8
%16 = fcmp ogt float %15, 1.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %3
store float 1.000000e+00, float* %4
br label %20
18: ; preds = %3
%19 = load float, float* %8
store float %19, float* %4
br label %20
20: ; preds = %18, %17
%21 = load float, float* %4
ret float %21
}

LLVM IR (-O2):
define float @voronoi_Cr(float %0, float %1, float %2) {
%4 = tail call i32 @voronoi_F1F2(float %0, float %1, float %2)
%5 = mul nsw i32 %4, 10
%6 = icmp slt i32 %5, 1
%7 = select i1 %6, i32 %5, i32 1
%8 = sitofp i32 %7 to float
ret float %8
}
void foo201() {}


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

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

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

LLVM IR (-O2):
define void @foo201() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, size_t);
void *realloc(void *, size_t);
void *erealloc(void *vp, size_t n) {
  void *p;
  p = realloc(vp, n);
  if (p == NULL) {
    eprintf("Fatal error!  realloc of %u bytes failed:", n);
  }
  return p;
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <erealloc+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <eprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <erealloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Fatal error! realloc of %u bytes failed:\00"
define i8* @erealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @eprintf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [42 x i8] c"Fatal error! realloc of %u bytes failed:\00"
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int test_imm_6Fint64_midword_reg(long long val) {
  return ((val >> 16) & (0x6F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Fint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x6f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Fint64_midword_reg>:
test   $0x6f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Fint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7274496
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test2(void) {
  typedef int A[];
  A a = {1, 2}, b = {3, 4, 5};
  assert(sizeof(a) / sizeof(*a) == 2);
  assert(sizeof(b) / sizeof(*b) == 3);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test2.a = [2 x i32] [i32 1, i32 2]
@__const.test2.b = [3 x i32] [i32 3, i32 4, i32 5]
define void @test2() {
%1 = alloca [2 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [2 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = call i32 @assert(i32 1)
%6 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @test2() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret void
}
int spl_debug_set_mb(int mb) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @spl_debug_set_mb(i32 %0) {
ret i32 0
}
void array_swap(void *array, int a, int b) {
  int **rarray = array;
  int *tmp = rarray[a];
  rarray[a] = rarray[b];
  rarray[b] = tmp;
}


x86 assembly (clang, -O0):
<array_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
define void @array_swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32**
%8 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32**
store i32** %10, i32*** %7
%11 = load i32**, i32*** %7
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
store i32* %15, i32** %8
%16 = load i32**, i32*** %7
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32*, i32** %16, i64 %18
%20 = load i32*, i32** %19
%21 = load i32**, i32*** %7
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32*, i32** %21, i64 %23
store i32* %20, i32** %24
%25 = load i32*, i32** %8
%26 = load i32**, i32*** %7
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32*, i32** %26, i64 %28
store i32* %25, i32** %29
ret void
}

LLVM IR (-O2):
define void @array_swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32**
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32*, i32** %4, i64 %5
%7 = load i32*, i32** %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32*, i32** %4, i64 %8
%10 = load i32*, i32** %9
store i32* %10, i32** %6
store i32* %7, i32** %9
ret void
}
void ajAlignExit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ajAlignExit() {
ret void
}
void wake_lock_timeout(struct wake_lock *lock, long timeout) {}


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

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

LLVM IR (-O0):
%struct.wake_lock = type opaque
define void @wake_lock_timeout(%struct.wake_lock* %0, i64 %1) {
%3 = alloca %struct.wake_lock*
%4 = alloca i64
store %struct.wake_lock* %0, %struct.wake_lock** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
%struct.wake_lock = type opaque
define void @wake_lock_timeout(%struct.wake_lock* nocapture %0, i64 %1) {
ret void
}
int i2s_register_board_info(struct i2s_board_info const *info, unsigned n) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.i2s_board_info = type opaque
define i32 @i2s_register_board_info(%struct.i2s_board_info* nocapture readnone %0, i32 %1) {
ret i32 0
}
int test_imm_F1int16_mem(short *val) {
  return ((*val) & (-0xF1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F1int16_mem>:
movzwl (%rdi),%eax
test   $0xff0f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -241
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(int *a, int n) {
  for (int i = 0; i < n; ++i)
    printf("%d,", a[i]);
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d,\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d,\00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ RS232_SendByte(int, int /*<<< orphan*/);
void RS232_cputs(int comport_number, const char *text) {
  while (*text != 0)
    RS232_SendByte(comport_number, *(text++));
}


x86 assembly (clang, -O0):
<RS232_cputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <RS232_cputs+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <RS232_SendByte@plt>
jmp    111f <RS232_cputs+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RS232_cputs>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1145 <RS232_cputs+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <RS232_SendByte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <RS232_cputs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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

/* Variables and functions */
int __infer_nondet_int();
int ferror(FILE *stream) {
  FILE tmp;
  tmp = *stream;
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<ferror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ferror(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ aes256_gentab();
void xts_init(int hw_crypt) { aes256_gentab(); }


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

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

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

LLVM IR (-O2):
define void @xts_init(i32 %0) {
%2 = tail call i32 (...) @aes256_gentab()
ret void
}
__attribute__((always_)) unsigned short readw(const volatile void *addr) {
  return *(volatile unsigned short *)addr;
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @readw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i16*
%5 = load volatile i16, i16* %4
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @readw(i8* %0) {
%2 = bitcast i8* %0 to i16*
%3 = load volatile i16, i16* %2
ret i16 %3
}