xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void fatal(const char *message) {
  fprintf(stderr, "FATAL ERROR: %s\n", message);
  fprintf(stderr, "Stopping.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"FATAL ERROR: %s\0A\00"
@.str.1 = [11 x i8] c"Stopping.\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"FATAL ERROR: %s\0A\00"
@.str.1 = [11 x i8] c"Stopping.\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct array {
  int dummy;
};

/* Variables and functions */
int array_map(struct array *, int (*)(void *const));
int stack_map(struct array *st, int(action)(void *const data)) {
  return array_map(st, action);
}


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

x86 assembly (clang, -O2):
<stack_map>:
jmp    1030 <array_map@plt>

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

LLVM IR (-O2):
%struct.array = type { i32 }
define i32 @stack_map(%struct.array* %0, i32 (i8*)* %1) {
%3 = tail call i32 @array_map(%struct.array* %0, i32 (i8*)* %1)
ret i32 %3
}
int tegra_legacy_irq_syscore_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_legacy_irq_syscore_init() {
ret i32 0
}
int sigaltstack(const struct sigaltstack *__restrict ss,
                struct sigaltstack *__restrict oss) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(ss);
  (void)(oss);
  return -1;
}


x86 assembly (clang, -O0):
<sigaltstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigaltstack>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigaltstack = type opaque
@.str = [3 x i8] c"# \00"
@__FUNCTION__.sigaltstack = [12 x i8] c"sigaltstack\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @sigaltstack(%struct.sigaltstack* noalias %0, %struct.sigaltstack* noalias %1) {
%3 = alloca %struct.sigaltstack*
%4 = alloca %struct.sigaltstack*
store %struct.sigaltstack* %0, %struct.sigaltstack** %3
store %struct.sigaltstack* %1, %struct.sigaltstack** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.sigaltstack, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%9 = load %struct.sigaltstack*, %struct.sigaltstack** %3
%10 = load %struct.sigaltstack*, %struct.sigaltstack** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.sigaltstack = type opaque
@.str = [3 x i8] c"# \00"
@__FUNCTION__.sigaltstack = [12 x i8] c"sigaltstack\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @sigaltstack(%struct.sigaltstack* noalias nocapture readnone %0, %struct.sigaltstack* noalias nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.sigaltstack, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i32 -1
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  c = getchar();
  printf("\nyou entered\n");
  putchar(c);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"\0Ayou entered\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 %1)
ret i32 0
}
/* Variables and functions */
unsigned int stb_hashptr(void *);
unsigned int stb__stb_ptrmap_hash(void *k) { return stb_hashptr(k); }


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

x86 assembly (clang, -O2):
<stb__stb_ptrmap_hash>:
jmp    1030 <stb_hashptr@plt>

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

LLVM IR (-O2):
define i32 @stb__stb_ptrmap_hash(i8* %0) {
%2 = tail call i32 @stb_hashptr(i8* %0)
ret i32 %2
}
unsigned int GetSnoopResult(unsigned int Address) {
  unsigned int modRes = 0;
  unsigned int snoopResult = Address >> 30;
  return snoopResult;
}


x86 assembly (clang, -O0):
<GetSnoopResult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1e,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSnoopResult>:
mov    %edi,%eax
shr    $0x1e,%eax
ret

LLVM IR (-O0):
define i32 @GetSnoopResult(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = lshr i32 %5, 30
store i32 %6, i32* %4
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
define i32 @GetSnoopResult(i32 %0) {
%2 = lshr i32 %0, 30
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ enableparsing_();
void EnableParsing() { enableparsing_(); }


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

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

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

LLVM IR (-O2):
define void @EnableParsing() {
%1 = tail call i32 (...) @enableparsing_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_out8(int, char);
int /*<<< orphan*/ wait_8042();
void write_8042(char b) {
  wait_8042();
  io_out8(0x60, b);
}


x86 assembly (clang, -O0):
<write_8042>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <wait_8042@plt>
mov    $0x60,%edi
movsbl -0x1(%rbp),%esi
call   1040 <io_out8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_8042>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <wait_8042@plt>
mov    $0x60,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <io_out8@plt>

LLVM IR (-O0):
define void @write_8042(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @wait_8042()
%4 = load i8, i8* %2
%5 = call i32 @io_out8(i32 96, i8 signext %4)
ret void
}

LLVM IR (-O2):
define void @write_8042(i8 signext %0) {
%2 = tail call i32 (...) @wait_8042()
%3 = tail call i32 @io_out8(i32 96, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _DMOJ_setbuffer(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void _DMOJ_setbuffersize(void) {
  _DMOJ_setbuffer(stdout, "CPTBOX_STDOUT_BUFFER_SIZE");
  _DMOJ_setbuffer(stderr, "CPTBOX_STDERR_BUFFER_SIZE");
}


x86 assembly (clang, -O0):
<_DMOJ_setbuffersize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <_DMOJ_setbuffer@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee1(%rip),%rsi
call   1030 <_DMOJ_setbuffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DMOJ_setbuffersize>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <_DMOJ_setbuffer@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xee4(%rip),%rsi
pop    %rax
jmp    1030 <_DMOJ_setbuffer@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [26 x i8] c"CPTBOX_STDOUT_BUFFER_SIZE\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"CPTBOX_STDERR_BUFFER_SIZE\00"
define void @_DMOJ_setbuffersize() {
%1 = load i32, i32* @stdout
%2 = call i32 @_DMOJ_setbuffer(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @_DMOJ_setbuffer(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [26 x i8] c"CPTBOX_STDOUT_BUFFER_SIZE\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"CPTBOX_STDERR_BUFFER_SIZE\00"
define void @_DMOJ_setbuffersize() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @_DMOJ_setbuffer(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @_DMOJ_setbuffer(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RamAccFixMod(int);
int /*<<< orphan*/ RamWriteA(int, unsigned short);
int /*<<< orphan*/ RegWriteA(int, int);
int /*<<< orphan*/ StmvFinClAf();
void StmvExeClAf(unsigned short usRamDat) {
  RamAccFixMod(0x01);
  RamWriteA(0x1513, usRamDat);
  RamAccFixMod(0x00);
  RegWriteA(0x01E1, 0x01);
  StmvFinClAf();
}


x86 assembly (clang, -O0):
<StmvExeClAf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1,%edi
call   1040 <RamAccFixMod@plt>
mov    $0x1513,%edi
movzwl -0x2(%rbp),%esi
call   1030 <RamWriteA@plt>
xor    %edi,%edi
call   1040 <RamAccFixMod@plt>
mov    $0x1e1,%edi
mov    $0x1,%esi
call   1050 <RegWriteA@plt>
mov    $0x0,%al
call   1060 <StmvFinClAf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StmvExeClAf>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1040 <RamAccFixMod@plt>
mov    $0x1513,%edi
mov    %ebx,%esi
call   1030 <RamWriteA@plt>
xor    %edi,%edi
call   1040 <RamAccFixMod@plt>
mov    $0x1e1,%edi
mov    $0x1,%esi
call   1050 <RegWriteA@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <StmvFinClAf@plt>

LLVM IR (-O0):
define void @StmvExeClAf(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @RamAccFixMod(i32 1)
%4 = load i16, i16* %2
%5 = call i32 @RamWriteA(i32 5395, i16 zeroext %4)
%6 = call i32 @RamAccFixMod(i32 0)
%7 = call i32 @RegWriteA(i32 481, i32 1)
%8 = call i32 (...) @StmvFinClAf()
ret void
}

LLVM IR (-O2):
define void @StmvExeClAf(i16 zeroext %0) {
%2 = tail call i32 @RamAccFixMod(i32 1)
%3 = tail call i32 @RamWriteA(i32 5395, i16 zeroext %0)
%4 = tail call i32 @RamAccFixMod(i32 0)
%5 = tail call i32 @RegWriteA(i32 481, i32 1)
%6 = tail call i32 (...) @StmvFinClAf()
ret void
}
void gf8mul_01100001(void) {
  __asm__ __volatile__("\tpxor    %xmm7, %xmm6\n"
                       "\tpxor    %xmm7, %xmm3\n"
                       "\tpxor    %xmm6, %xmm5\n"
                       "\tpxor    %xmm6, %xmm2\n"
                       "\tpxor    %xmm5, %xmm4\n"
                       "\tpxor    %xmm5, %xmm1\n"
                       "\tpxor    %xmm4, %xmm3\n"
                       "\tpxor    %xmm4, %xmm0\n"
                       "\tpxor    %xmm3, %xmm7\n"
                       "\tpxor    %xmm3, %xmm1\n"
                       "\tpxor    %xmm3, %xmm0\n"
                       "\tpxor    %xmm2, %xmm7\n"
                       "\tpxor    %xmm2, %xmm6\n"
                       "\tpxor    %xmm2, %xmm5\n"
                       "\tpxor    %xmm2, %xmm4\n"
                       "\tpxor    %xmm2, %xmm3\n"
                       "\tpxor    %xmm2, %xmm0\n"
                       "\tpxor    %xmm3, %xmm2\n"
                       "\tpxor    %xmm1, %xmm7\n"
                       "\tpxor    %xmm1, %xmm6\n"
                       "\tpxor    %xmm0, %xmm6\n"
                       "\tpxor    %xmm0, %xmm5\n");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
pxor   %xmm7,%xmm6
pxor   %xmm7,%xmm3
pxor   %xmm6,%xmm5
pxor   %xmm6,%xmm2
pxor   %xmm5,%xmm4
pxor   %xmm5,%xmm1
pxor   %xmm4,%xmm3
pxor   %xmm4,%xmm0
pxor   %xmm3,%xmm7
pxor   %xmm3,%xmm1
pxor   %xmm3,%xmm0
pxor   %xmm2,%xmm7
pxor   %xmm2,%xmm6
pxor   %xmm2,%xmm5
pxor   %xmm2,%xmm4
pxor   %xmm2,%xmm3
pxor   %xmm2,%xmm0
pxor   %xmm3,%xmm2
pxor   %xmm1,%xmm7
pxor   %xmm1,%xmm6
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm5
pop    %rbp
ret

x86 assembly (clang, -O2):
pxor   %xmm7,%xmm6
pxor   %xmm7,%xmm3
pxor   %xmm6,%xmm5
pxor   %xmm6,%xmm2
pxor   %xmm5,%xmm4
pxor   %xmm5,%xmm1
pxor   %xmm4,%xmm3
pxor   %xmm4,%xmm0
pxor   %xmm3,%xmm7
pxor   %xmm3,%xmm1
pxor   %xmm3,%xmm0
pxor   %xmm2,%xmm7
pxor   %xmm2,%xmm6
pxor   %xmm2,%xmm5
pxor   %xmm2,%xmm4
pxor   %xmm2,%xmm3
pxor   %xmm2,%xmm0
pxor   %xmm3,%xmm2
pxor   %xmm1,%xmm7
pxor   %xmm1,%xmm6
pxor   %xmm0,%xmm6
pxor   %xmm0,%xmm5
ret

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

LLVM IR (-O2):
define void @gf8mul_01100001() {
tail call void asm sideeffect "\09pxor %xmm7, %xmm6\0A\09pxor %xmm7, %xmm3\0A\09pxor %xmm6, %xmm5\0A\09pxor %xmm6, %xmm2\0A\09pxor %xmm5, %xmm4\0A\09pxor %xmm5, %xmm1\0A\09pxor %xmm4, %xmm3\0A\09pxor %xmm4, %xmm0\0A\09pxor %xmm3, %xmm7\0A\09pxor %xmm3, %xmm1\0A\09pxor %xmm3, %xmm0\0A\09pxor %xmm2, %xmm7\0A\09pxor %xmm2, %xmm6\0A\09pxor %xmm2, %xmm5\0A\09pxor %xmm2, %xmm4\0A\09pxor %xmm2, %xmm3\0A\09pxor %xmm2, %xmm0\0A\09pxor %xmm3, %xmm2\0A\09pxor %xmm1, %xmm7\0A\09pxor %xmm1, %xmm6\0A\09pxor %xmm0, %xmm6\0A\09pxor %xmm0, %xmm5\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int max_val(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<max_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <max_val+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max_val+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_val>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max_val(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ shortest(int *, int, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  int visited[] = {-1, -1, -1, -1, -1};
  printf("%ld\n", shortest(visited, 5, 0, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <shortest@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,(%rsp)
movl   $0xffffffff,0x10(%rsp)
ff
mov    %rsp,%rdi
mov    $0x5,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <shortest@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @shortest(i32* %5, i32 5, i32 0, i32 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
void XQueryBestSize() {}


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

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

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

LLVM IR (-O2):
define void @XQueryBestSize() {
ret void
}
int main(void) {
  unsigned i, j, k, result;
start:
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 20; j++) {
      for (k = 0; k < 30; k++) {
        result = i * j * k;
        if ((result % 13) == 0)
          goto end_of_fors;
      }
    }
  }
end_of_fors:
  if ((i + j + k) % 2 == 1)
    goto start;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    119f <main+0x9f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jae    118c <main+0x8c>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jae    1179 <main+0x79>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xd,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1166 <main+0x66>
jmp    11a4 <main+0xa4>
jmp    116b <main+0x6b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x34>
jmp    117e <main+0x7e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1191 <main+0x91>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    11a4 <main+0xa4>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    11be <main+0xbe>
jmp    110b <main+0xb>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %49, %0
store i32 0, i32* %2
br label %7
7: ; preds = %37, %6
%8 = load i32, i32* %2
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %40
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %33, %10
%12 = load i32, i32* %3
%13 = icmp ult i32 %12, 20
br i1 %13, label %14, label %36
14: ; preds = %11
store i32 0, i32* %4
br label %15
15: ; preds = %29, %14
%16 = load i32, i32* %4
%17 = icmp ult i32 %16, 30
br i1 %17, label %18, label %32
18: ; preds = %15
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = mul i32 %19, %20
%22 = load i32, i32* %4
%23 = mul i32 %21, %22
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = urem i32 %24, 13
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %18
br label %41
28: ; preds = %18
br label %29
29: ; preds = %28
%30 = load i32, i32* %4
%31 = add i32 %30, 1
store i32 %31, i32* %4
br label %15
32: ; preds = %15
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add i32 %34, 1
store i32 %35, i32* %3
br label %11
36: ; preds = %11
br label %37
37: ; preds = %36
%38 = load i32, i32* %2
%39 = add i32 %38, 1
store i32 %39, i32* %2
br label %7
40: ; preds = %7
br label %41
41: ; preds = %40, %27
%42 = load i32, i32* %2
%43 = load i32, i32* %3
%44 = add i32 %42, %43
%45 = load i32, i32* %4
%46 = add i32 %44, %45
%47 = urem i32 %46, 2
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %50
49: ; preds = %41
br label %6
50: ; preds = %41
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_cmd_spoilers();
void death_spoilers(void *unused, const char *title) {
  (void)unused;
  (void)title;
  do_cmd_spoilers();
}


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

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

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

LLVM IR (-O2):
define void @death_spoilers(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @do_cmd_spoilers()
ret void
}
/* Variables and functions */
long atoi(char const *);
long atol(const char *nptr) { return atoi(nptr); }


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

x86 assembly (clang, -O2):
<atol>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void move_file(char *source_file, char *destination_file) {
  char command[200];
  snprintf(command, 200, "mv %s %s", source_file, destination_file);
  system(command);
}


x86 assembly (clang, -O0):
<move_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0xc8,%esi
lea    0xeb2(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <system@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_file>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"mv %s %s\00"
define void @move_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [200 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mv %s %s\00"
define void @move_file(i8* %0, i8* %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ilogb(double);
int /*<<< orphan*/ ilogbf(float);
int /*<<< orphan*/ ilogbl(long double);
void uninitvar_ilogb(void) {
  float f;
  (void)ilogbf(f);
  double d;
  (void)ilogb(d);
  long double ld;
  (void)ilogbl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_ilogb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <ilogbf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <ilogb@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ilogbl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_ilogb>:
sub    $0x18,%rsp
call   1040 <ilogbf@plt>
call   1050 <ilogb@plt>
call   1030 <ilogbl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_ilogb() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @ilogbf(float %4)
%6 = load double, double* %2
%7 = call i32 @ilogb(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @ilogbl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ilogb() {
%1 = tail call i32 @ilogbf(float undef)
%2 = tail call i32 @ilogb(double undef)
%3 = tail call i32 @ilogbl(x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void Print(char *msg) {
  assert(msg != NULL);
  puts(msg);
}


x86 assembly (clang, -O0):
<Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @Print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @puts(i8* %7)
ret void
}

LLVM IR (-O2):
define void @Print(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
void SystraceInit() {}


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

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

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

LLVM IR (-O2):
define void @SystraceInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ repipe(int, char **);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc <= 2) {
    fprintf(stderr, "cmds must be more than one!\n");
    exit(EXIT_FAILURE);
  }
  repipe(2, argv);
  return EXIT_SUCCESS;
}


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)
cmpl   $0x2,-0x8(%rbp)
jg     1173 <main+0x43>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1040 <repipe@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jle    114b <main+0x1b>
mov    $0x2,%edi
call   1040 <repipe@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"cmds must be more than one!\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = call i32 @repipe(i32 2, i8** %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"cmds must be more than one!\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = tail call i32 @repipe(i32 2, i8** %1)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void havemeal(void) { printf("I'm having my dinner.\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"I'm having my dinner.\0A\00"
define void @havemeal() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"I'm having my dinner.\00"
define void @havemeal() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_extract_ps(int /*<<< orphan*/, int);
int __mm_extract_ps(__m128 A, int const I) { return _mm_extract_ps(A, 1); }


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

x86 assembly (clang, -O2):
<__mm_extract_ps>:
mov    $0x1,%esi
jmp    1030 <_mm_extract_ps@plt>

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

LLVM IR (-O2):
define i32 @__mm_extract_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_extract_ps(i32 %0, i32 1)
ret i32 %3
}
void __attribute__((stdcall)) GetSystemTimeAsFileTime(void *sys_time) {
  sys_time = sys_time;
  return;
}


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

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

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

LLVM IR (-O2):
define void @GetSystemTimeAsFileTime(i8* nocapture %0) {
ret void
}
int foo() { return 12; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 12
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 12
}
/* Variables and functions */
float sinf(float);
float test(float f) { return sinf(f); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @test(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ rand();
uint tkGetRandom() { return rand(); }


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

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

LLVM IR (-O0):
define i32 @tkGetRandom() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @tkGetRandom() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
int Base64_Length(int bCount) {
  int QuadCount = (bCount / 3);
  if ((bCount % 3) != 0)
    QuadCount++;
  QuadCount *= 4;
  return (QuadCount);
}


x86 assembly (clang, -O0):
<Base64_Length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1132 <Base64_Length+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base64_Length>:
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
imul   $0xaaaaaaab,%ecx,%ecx
add    $0x2aaaaaaa,%ecx
cmp    $0x55555555,%ecx
sbb    $0xffffffff,%eax
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @Base64_Length(i32 %0) {
%2 = sdiv i32 %0, 3
%3 = srem i32 %0, 3
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
%7 = shl nsw i32 %6, 2
ret i32 %7
}
/* Type definitions */
struct Screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_open_buffer_prompt(struct Screen *);
void cb_open(struct Screen *scrn) { screen_open_buffer_prompt(scrn); }


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

x86 assembly (clang, -O2):
<cb_open>:
jmp    1030 <screen_open_buffer_prompt@plt>

LLVM IR (-O0):
%struct.Screen = type { i32 }
define void @cb_open(%struct.Screen* %0) {
%2 = alloca %struct.Screen*
store %struct.Screen* %0, %struct.Screen** %2
%3 = load %struct.Screen*, %struct.Screen** %2
%4 = call i32 @screen_open_buffer_prompt(%struct.Screen* %3)
ret void
}

LLVM IR (-O2):
%struct.Screen = type { i32 }
define void @cb_open(%struct.Screen* %0) {
%2 = tail call i32 @screen_open_buffer_prompt(%struct.Screen* %0)
ret void
}
void incompatible_assign(struct S1 *s1, struct S2 *s2) {
  void *p1, *p2;
  p1 = s1, p2 = s2;
}


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

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

LLVM IR (-O0):
%struct.S1 = type opaque
%struct.S2 = type opaque
define void @incompatible_assign(%struct.S1* %0, %struct.S2* %1) {
%3 = alloca %struct.S1*
%4 = alloca %struct.S2*
%5 = alloca i8*
%6 = alloca i8*
store %struct.S1* %0, %struct.S1** %3
store %struct.S2* %1, %struct.S2** %4
%7 = load %struct.S1*, %struct.S1** %3
%8 = bitcast %struct.S1* %7 to i8*
store i8* %8, i8** %5
%9 = load %struct.S2*, %struct.S2** %4
%10 = bitcast %struct.S2* %9 to i8*
store i8* %10, i8** %6
ret void
}

LLVM IR (-O2):
%struct.S1 = type opaque
%struct.S2 = type opaque
define void @incompatible_assign(%struct.S1* nocapture %0, %struct.S2* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __expand(char *, char const *, char, char *);
void expand1(char *str, const char *fmt, char **args, char out) {
  __expand(str, fmt, out, args[0]);
}


x86 assembly (clang, -O0):
<expand1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
movsbl %al,%edx
call   1030 <__expand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand1>:
mov    (%rdx),%rax
mov    %ecx,%edx
mov    %rax,%rcx
jmp    1030 <__expand@plt>

LLVM IR (-O0):
define void @expand1(i8* %0, i8* %1, i8** %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i8 %3, i8* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8, i8* %8
%12 = load i8**, i8*** %7
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @__expand(i8* %9, i8* %10, i8 signext %11, i8* %14)
ret void
}

LLVM IR (-O2):
define void @expand1(i8* %0, i8* %1, i8** nocapture %2, i8 signext %3) {
%5 = load i8*, i8** %2
%6 = tail call i32 @__expand(i8* %0, i8* %1, i8 signext %3, i8* %5)
ret void
}
/* Variables and functions */
void start_timer_internal(long, unsigned long);
void start_timer(long timer_id, unsigned int sec, unsigned int msec) {
  unsigned long expires;
  expires = (sec * 1000 + msec) / 100;
  return start_timer_internal(timer_id, expires);
}


x86 assembly (clang, -O0):
<start_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
imul   $0x3e8,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <start_timer_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_timer>:
imul   $0x3e8,%esi,%eax
add    %edx,%eax
imul   $0x51eb851f,%rax,%rsi
shr    $0x25,%rsi
jmp    1030 <start_timer_internal@plt>

LLVM IR (-O0):
define void @start_timer(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = mul i32 %8, 1000
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = udiv i32 %11, 100
%13 = zext i32 %12 to i64
store i64 %13, i64* %7
%14 = load i64, i64* %4
%15 = load i64, i64* %7
ret void
}

LLVM IR (-O2):
define void @start_timer(i64 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 1000
%5 = add i32 %4, %2
%6 = udiv i32 %5, 100
%7 = zext i32 %6 to i64
tail call void @start_timer_internal(i64 %0, i64 %7)
ret void
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_packing(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_packing>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_packing(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_packing(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void task() {
  while (1) {
    __asm __volatile("mov $2, %%eax" ::: "eax");
  }
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <task+0x9>
mov    $0x2,%eax
jmp    1109 <task+0x9>

x86 assembly (clang, -O2):
<task>:
mov    $0x2,%eax
jmp    1100 <task>

LLVM IR (-O0):
define void @task() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @task() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "mov $$2, %eax", "~{eax},~{dirflag},~{fpsr},~{flags}"()
br label %1
}
int add() {
  int i;
  int sum = 0;
  for (i = 1; i * i < 81; i++) {
    sum += i;
  }
  if (sum > 10000)
    return 10000;
  return sum;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x51,%eax
jge    1139 <add+0x39>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <add+0x12>
cmpl   $0x2710,-0xc(%rbp)
jle    1152 <add+0x52>
movl   $0x2710,-0x4(%rbp)
jmp    1158 <add+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @add() {
ret i32 36
}
int call(int value) { return value + value; }


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

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

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

LLVM IR (-O2):
define i32 @call(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int recursionPlus(int number) {
  if (number < 0) {
    return 0;
  }
  return recursionPlus(number - 1) + number;
}


x86 assembly (clang, -O0):
<recursionPlus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <recursionPlus+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1142 <recursionPlus+0x32>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <recursionPlus@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursionPlus>:
test   %edi,%edi
js     1118 <recursionPlus+0x18>
mov    %edi,%eax
mov    %edi,%ecx
lea    -0x1(%rax),%edx
imul   %rcx,%rdx
shr    %rdx
imul   %eax,%eax
sub    %edx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @recursionPlus(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = zext i32 %0 to i33
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = mul i33 %4, %6
%8 = lshr i33 %7, 1
%9 = trunc i33 %8 to i32
%10 = mul i32 %0, %0
%11 = sub i32 %10, %9
br label %12
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %13
}