xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t retro_serialize_size() { return 2; }


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

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

LLVM IR (-O0):
define i64 @retro_serialize_size() {
ret i64 2
}

LLVM IR (-O2):
define i64 @retro_serialize_size() {
ret i64 2
}
int c063(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c063() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ ft_vprintf_fd(int, char const *, int /*<<< orphan*/);
void ft_vprintf(const char *str, va_list ap) { ft_vprintf_fd(1, str, ap); }


x86 assembly (clang, -O0):
<ft_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <ft_vprintf_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <ft_vprintf_fd@plt>

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

LLVM IR (-O2):
define void @ft_vprintf(i8* %0, i32 %1) {
%3 = tail call i32 @ft_vprintf_fd(i32 1, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void die_exec(const char *arg) {
  fprintf(stderr, "exec %s: %s\n", arg, strerror(errno));
  exit(255);
}


x86 assembly (clang, -O0):
<die_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_exec>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"exec %s: %s\0A\00"
@errno = global i32 0
define void @die_exec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"exec %s: %s\0A\00"
@errno = global i32 0
define void @die_exec(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 255)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __run_test_strcat__();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void run_test_strcat(void) {
  fprintf(stderr, "Running %s...", "run_test_strcat");
  __run_test_strcat__();
  fprintf(stderr, "OK\n");
}


x86 assembly (clang, -O0):
<run_test_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed3(%rip),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <__run_test_strcat__@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test_strcat>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
lea    0xed6(%rip),%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <__run_test_strcat__@plt>
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Running %s...\00"
@.str.1 = [16 x i8] c"run_test_strcat\00"
@.str.2 = [4 x i8] c"OK\0A\00"
define void @run_test_strcat() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @__run_test_strcat__()
%4 = load i32, i32* @stderr
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Running %s...\00"
@.str.1 = [16 x i8] c"run_test_strcat\00"
@.str.2 = [4 x i8] c"OK\0A\00"
define void @run_test_strcat() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @__run_test_strcat__()
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglPrimitiveRestartNV();
void _Lazy_glPrimitiveRestartNV(void) {
  if (GLeeInit())
    pglPrimitiveRestartNV();
}


x86 assembly (clang, -O0):
<_Lazy_glPrimitiveRestartNV>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glPrimitiveRestartNV+0x1c>
mov    $0x0,%al
call   1040 <pglPrimitiveRestartNV@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glPrimitiveRestartNV>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glPrimitiveRestartNV+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglPrimitiveRestartNV@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glPrimitiveRestartNV() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglPrimitiveRestartNV()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glPrimitiveRestartNV() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglPrimitiveRestartNV()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asinh(double);
int /*<<< orphan*/ asinhf(float);
int /*<<< orphan*/ asinhl(long double);
void uninitvar_asinh(void) {
  float f;
  (void)asinhf(f);
  double d;
  (void)asinh(d);
  long double ld;
  (void)asinhl(ld);
}


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

x86 assembly (clang, -O2):
<uninitvar_asinh>:
sub    $0x18,%rsp
call   1030 <asinhf@plt>
call   1050 <asinh@plt>
call   1040 <asinhl@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @uninitvar_asinh() {
%1 = tail call i32 @asinhf(float undef)
%2 = tail call i32 @asinh(double undef)
%3 = tail call i32 @asinhl(x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UNUSED(unsigned long);
void Zip_Interrupt_Enable(unsigned long irq) {
  UNUSED(irq);
  return;
}


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

x86 assembly (clang, -O2):
<Zip_Interrupt_Enable>:
jmp    1030 <UNUSED@plt>

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

LLVM IR (-O2):
define void @Zip_Interrupt_Enable(i64 %0) {
%2 = tail call i32 @UNUSED(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_tex_comment_entities();
int /*<<< orphan*/ test_tex_comments();
void all_tex_tests() {
  test_tex_comments();
  test_tex_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_tex_tests() {
%1 = call i32 (...) @test_tex_comments()
%2 = call i32 (...) @test_tex_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_tex_tests() {
%1 = tail call i32 (...) @test_tex_comments()
%2 = tail call i32 (...) @test_tex_comment_entities()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ read_serial_port(unsigned char *, int);
uint8_t serial_read_byte() {
  unsigned char c;
  read_serial_port(&c, 1);
  return (uint8_t)c;
}


x86 assembly (clang, -O0):
<serial_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <read_serial_port@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_read_byte>:
push   %rax
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <read_serial_port@plt>
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_read_byte() {
%1 = alloca i8
%2 = call i32 @read_serial_port(i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @serial_read_byte() {
%1 = alloca i8
%2 = call i32 @read_serial_port(i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}
__attribute__((always_)) unsigned char inb(unsigned short port) {
  unsigned char _v;
  asm volatile("in"
               "b"
               " %"
               "w"
               "1,%"
               ""
               "0"
               : "=a"(_v)
               : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
unsigned char is_zero_eth_addr(unsigned char *addr) {
  return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
}


x86 assembly (clang, -O0):
<is_zero_eth_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
or     %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero_eth_addr>:
movd   (%rdi),%xmm0
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
por    %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrlw  $0x8,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%eax
or     0x4(%rdi),%al
or     0x5(%rdi),%al
sete   %al
ret

LLVM IR (-O0):
define zeroext i8 @is_zero_eth_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %6, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = or i32 %11, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %16, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %21, %25
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 5
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = or i32 %26, %30
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
%35 = trunc i32 %34 to i8
ret i8 %35
}

LLVM IR (-O2):
define zeroext i8 @is_zero_eth_addr(i8* nocapture %0) {
%2 = bitcast i8* %0 to <4 x i8>*
%3 = load <4 x i8>, <4 x i8>* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 5
%7 = load i8, i8* %6
%8 = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> %3)
%9 = or i8 %8, %5
%10 = or i8 %9, %7
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i8
ret i8 %12
}
/* Variables and functions */
double irnd();
double rnd() { return irnd() / 32767.1; }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <irnd@plt>
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
xor    %eax,%eax
call   1030 <irnd@plt>
divsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rnd() {
%1 = call double (...) @irnd()
%2 = fdiv double %1, 3.276710e+04
ret double %2
}

LLVM IR (-O2):
define double @rnd() {
%1 = tail call double (...) @irnd()
%2 = fdiv double %1, 3.276710e+04
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void rstofill(void) { printf(".%d\n", 35); }


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

x86 assembly (clang, -O2):
<rstofill>:
lea    0xee9(%rip),%rdi
mov    $0x23,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c".%d\0A\00"
define void @rstofill() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 35)
ret void
}
long ctol(unsigned char *buffer) {
  long temp = 0;
  temp += buffer[0];
  temp += buffer[1] << 8;
  temp += buffer[2] << 16;
  temp += buffer[3] << 24;
  return temp;
}


x86 assembly (clang, -O0):
<ctol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctol>:
movzwl (%rdi),%eax
movzbl 0x2(%rdi),%ecx
shl    $0x10,%rcx
or     %rax,%rcx
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
cltq
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @ctol(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = load i64, i64* %3
%9 = add nsw i64 %8, %7
store i64 %9, i64* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = sext i32 %14 to i64
%16 = load i64, i64* %3
%17 = add nsw i64 %16, %15
store i64 %17, i64* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = shl i32 %21, 16
%23 = sext i32 %22 to i64
%24 = load i64, i64* %3
%25 = add nsw i64 %24, %23
store i64 %25, i64* %3
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = shl i32 %29, 24
%31 = sext i32 %30 to i64
%32 = load i64, i64* %3
%33 = add nsw i64 %32, %31
store i64 %33, i64* %3
%34 = load i64, i64* %3
ret i64 %34
}

LLVM IR (-O2):
define i64 @ctol(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = sext i32 %17 to i64
%19 = or i64 %13, %18
ret i64 %19
}
int main() { return sizeof(signed short int); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
int main() {
  int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  printf("%d\n", 2 [a]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_a();
int /*<<< orphan*/ do_b();
int /*<<< orphan*/ do_c();
scalar_t__ test_condition();
void test_if() {
  do_a();
  if (test_condition())
    do_b();
  do_c();
}


x86 assembly (clang, -O0):
<test_if>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <do_a@plt>
mov    $0x0,%al
call   1030 <test_condition@plt>
cmp    $0x0,%rax
je     1163 <test_if+0x23>
mov    $0x0,%al
call   1040 <do_b@plt>
mov    $0x0,%al
call   1060 <do_c@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_if>:
push   %rax
xor    %eax,%eax
call   1050 <do_a@plt>
xor    %eax,%eax
call   1030 <test_condition@plt>
test   %rax,%rax
je     115b <test_if+0x1b>
xor    %eax,%eax
call   1040 <do_b@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <do_c@plt>

LLVM IR (-O0):
define void @test_if() {
%1 = call i32 (...) @do_a()
%2 = call i64 (...) @test_condition()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @do_b()
br label %6
6: ; preds = %4, %0
%7 = call i32 (...) @do_c()
ret void
}

LLVM IR (-O2):
define void @test_if() {
%1 = tail call i32 (...) @do_a()
%2 = tail call i64 (...) @test_condition()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @do_b()
br label %6
6: ; preds = %4, %0
%7 = tail call i32 (...) @do_c()
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getpgid(int);
int getpgrp();
int getpid();
int /*<<< orphan*/ setpgid(int, int);
int main() {
  pid_t pgid;
  pid_t pid = getpid();
  pgid = getpgrp();
  pgid = getpgid(0);
  (void)getpgid(-1);
  setpgid(0, 0);
  setpgid(pid, -1);
  setpgid(-1, pgid);
  pgid = getpgrp();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getpgrp@plt>
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1050 <getpgid@plt>
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%edi
call   1050 <getpgid@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <setpgid@plt>
mov    -0xc(%rbp),%edi
mov    $0xffffffff,%esi
call   1060 <setpgid@plt>
mov    -0x8(%rbp),%esi
mov    $0xffffffff,%edi
call   1060 <setpgid@plt>
mov    $0x0,%al
call   1040 <getpgrp@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getpgrp@plt>
xor    %edi,%edi
call   1050 <getpgid@plt>
mov    %eax,%ebp
mov    $0xffffffff,%edi
call   1050 <getpgid@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <setpgid@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
call   1060 <setpgid@plt>
mov    $0xffffffff,%edi
mov    %ebp,%esi
call   1060 <setpgid@plt>
xor    %eax,%eax
call   1040 <getpgrp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getpid()
store i32 %4, i32* %3
%5 = call i32 (...) @getpgrp()
store i32 %5, i32* %2
%6 = call i32 @getpgid(i32 0)
store i32 %6, i32* %2
%7 = call i32 @getpgid(i32 -1)
%8 = call i32 @setpgid(i32 0, i32 0)
%9 = load i32, i32* %3
%10 = call i32 @setpgid(i32 %9, i32 -1)
%11 = load i32, i32* %2
%12 = call i32 @setpgid(i32 -1, i32 %11)
%13 = call i32 (...) @getpgrp()
store i32 %13, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getpgrp()
%3 = tail call i32 @getpgid(i32 0)
%4 = tail call i32 @getpgid(i32 -1)
%5 = tail call i32 @setpgid(i32 0, i32 0)
%6 = tail call i32 @setpgid(i32 %1, i32 -1)
%7 = tail call i32 @setpgid(i32 -1, i32 %3)
%8 = tail call i32 (...) @getpgrp()
ret i32 0
}
void drawscreen(void) {}


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

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

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

LLVM IR (-O2):
define void @drawscreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n\nHola a Todos los que nos Leen\n\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"\0A\0AHola a Todos los que nos Leen\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"\0A\0AHola a Todos los que nos Leen\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void mfree(p, n) register char *p;
{ free(p); }


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

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

LLVM IR (-O0):
define void @mfree(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
ret void
}

LLVM IR (-O2):
define void @mfree(i8* nocapture %0, i32 %1) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inplace_swap(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 10;
  int y = 99999;
  printf("x=%d,y=%d\n", x, y);
  inplace_swap(&x, &y);
  printf("x=%d,y=%d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x1869f,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <inplace_swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x1869f,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1869f,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <inplace_swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"x=%d,y=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 99999, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10, i32 99999)
%6 = call i32 @inplace_swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
double I_zero(double x) {
  int n = 0;
  double u = 1.0, s = 1.0, t;
  do {
    n += 2;
    t = x / n;
    u *= t * t;
    s += u;
  } while (u > 1e-21 * s);
  return s;
}


x86 assembly (clang, -O0):
<I_zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
ja     112a <I_zero+0x2a>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<I_zero>:
movsd  0xef8(%rip),%xmm2
mov    $0x2,%eax
movsd  0xef3(%rip),%xmm3
movapd %xmm2,%xmm1
nopl   0x0(%rax)
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
movapd %xmm0,%xmm5
divsd  %xmm4,%xmm5
mulsd  %xmm5,%xmm5
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
add    $0x2,%eax
ucomisd %xmm4,%xmm2
ja     1120 <I_zero+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @I_zero(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %2
store i32 0, i32* %3
store double 1.000000e+00, double* %4
store double 1.000000e+00, double* %5
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 2
store i32 %9, i32* %3
%10 = load double, double* %2
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to double
%13 = fdiv double %10, %12
store double %13, double* %6
%14 = load double, double* %6
%15 = load double, double* %6
%16 = fmul double %14, %15
%17 = load double, double* %4
%18 = fmul double %17, %16
store double %18, double* %4
%19 = load double, double* %4
%20 = load double, double* %5
%21 = fadd double %20, %19
store double %21, double* %5
br label %22
22: ; preds = %7
%23 = load double, double* %4
%24 = load double, double* %5
%25 = fmul double 0x3B92E3B40A0E9B4F, %24
%26 = fcmp ogt double %23, %25
br i1 %26, label %7, label %27
27: ; preds = %22
%28 = load double, double* %5
ret double %28
}

LLVM IR (-O2):
define double @I_zero(double %0) {
br label %2
2: ; preds = %2, %1
%3 = phi double [ 1.000000e+00, %1 ], [ %10, %2 ]
%4 = phi double [ 1.000000e+00, %1 ], [ %11, %2 ]
%5 = phi i32 [ 0, %1 ], [ %6, %2 ]
%6 = add nuw nsw i32 %5, 2
%7 = sitofp i32 %6 to double
%8 = fdiv double %0, %7
%9 = fmul double %8, %8
%10 = fmul double %3, %9
%11 = fadd double %4, %10
%12 = fmul double %11, 0x3B92E3B40A0E9B4F
%13 = fcmp ogt double %10, %12
br i1 %13, label %2, label %14
14: ; preds = %2
ret double %11
}
/* Type definitions */
struct set {
  int dummy;
};

/* Variables and functions */
int set_contains(struct set *, void *, scalar_t__);
scalar_t__ strlen(char *);
bool set_contains_string(struct set *t, char *s) {
  return set_contains(t, (void *)s, strlen(s) + 1);
}


x86 assembly (clang, -O0):
<set_contains_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <set_contains@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_contains_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <set_contains@plt>

LLVM IR (-O0):
%struct.set = type { i32 }
define i32 @set_contains_string(%struct.set* %0, i8* %1) {
%3 = alloca %struct.set*
%4 = alloca i8*
store %struct.set* %0, %struct.set** %3
store i8* %1, i8** %4
%5 = load %struct.set*, %struct.set** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @set_contains(%struct.set* %5, i8* %6, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.set = type { i32 }
define i32 @set_contains_string(%struct.set* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @set_contains(%struct.set* %0, i8* %1, i64 %4)
ret i32 %5
}
void caller_2_1_2_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_2_1_2_1_2() {
ret void
}
int fun(int x, int *p) { return x + *p; }


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

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

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

LLVM IR (-O2):
define i32 @fun(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
unsigned char SD_sendCommand(unsigned char, unsigned char *);
unsigned char SD_sendSingleCommand(unsigned char cmd) {
  unsigned char para[4] = {0, 0, 0, 0};
  return SD_sendCommand(cmd, para);
}


x86 assembly (clang, -O0):
<SD_sendSingleCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x1(%rbp),%al
lea    -0x5(%rbp),%rsi
movzbl %al,%edi
call   1030 <SD_sendCommand@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SD_sendSingleCommand>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <SD_sendCommand@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @SD_sendSingleCommand(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [4 x i8]
store i8 %0, i8* %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = call zeroext i8 @SD_sendCommand(i8 zeroext %5, i8* %6)
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @SD_sendSingleCommand(i8 zeroext %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call zeroext i8 @SD_sendCommand(i8 zeroext %0, i8* %3)
ret i8 %4
}
void hiroko_ism(int *height) {
  if (*height < 180)
    *height = 180;
}


x86 assembly (clang, -O0):
<hiroko_ism>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xb4,(%rax)
jge    1122 <hiroko_ism+0x22>
mov    -0x8(%rbp),%rax
movl   $0xb4,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hiroko_ism>:
cmpl   $0xb3,(%rdi)
jg     110e <hiroko_ism+0xe>
movl   $0xb4,(%rdi)
ret

LLVM IR (-O0):
define void @hiroko_ism(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 180
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32*, i32** %2
store i32 180, i32* %7
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @hiroko_ism(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, 180
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 180, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
void cli(void) { __asm__ __volatile__("cli"); }


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

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

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

LLVM IR (-O2):
define void @cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int BL(int, int);
unsigned char RD(int i, int j) { return (i + j) ? 256 - (BL(i, j)) / 2 : 0; }


x86 assembly (clang, -O0):
<RD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1151 <RD+0x41>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <BL@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x100,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <RD+0x4b>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <RD+0x4b>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RD>:
mov    %esi,%eax
add    %edi,%eax
jne    1119 <RD+0x9>
xor    %eax,%eax
ret
push   %rax
call   1030 <BL@plt>
mov    %eax,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
shr    %eax
neg    %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define zeroext i8 @RD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @BL(i32 %10, i32 %11)
%13 = sdiv i32 %12, 2
%14 = sub nsw i32 256, %13
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %9
%17 = phi i32 [ %14, %9 ], [ 0, %15 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @RD(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = icmp eq i32 %3, %0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @BL(i32 %0, i32 %1)
%7 = sdiv i32 %6, -2
%8 = trunc i32 %7 to i8
br label %9
9: ; preds = %2, %5
%10 = phi i8 [ %8, %5 ], [ 0, %2 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ non_module_test();
int /*<<< orphan*/ syscall_test();
void run_some_again(void) {
  syscall_test();
  non_module_test();
}


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

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

LLVM IR (-O0):
define void @run_some_again() {
%1 = call i32 (...) @syscall_test()
%2 = call i32 (...) @non_module_test()
ret void
}

LLVM IR (-O2):
define void @run_some_again() {
%1 = tail call i32 (...) @syscall_test()
%2 = tail call i32 (...) @non_module_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ unlink(char *);
int closesocket(int sockfd, char *name) {
  char sockname[64];
  if (sockfd)
    close(sockfd);
  sprintf(sockname, "/tmp/%s", name);
  unlink(sockname);
  shutdown(sockfd, 2);
  return 0;
}


x86 assembly (clang, -O0):
<closesocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1161 <closesocket+0x21>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1040 <shutdown@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closesocket>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
test   %edi,%edi
je     1159 <closesocket+0x19>
mov    %ebx,%edi
call   1050 <close@plt>
lea    0xea0(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %r15,%rdi
call   1030 <unlink@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <shutdown@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/tmp/%s\00"
define i32 @closesocket(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = call i32 @close(i32 %9)
br label %11
11: ; preds = %8, %2
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%13 = load i8*, i8** %4
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%16 = call i32 @unlink(i8* %15)
%17 = load i32, i32* %3
%18 = call i32 @shutdown(i32 %17, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/tmp/%s\00"
define i32 @closesocket(i32 %0, i8* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @close(i32 %0)
br label %8
8: ; preds = %6, %2
%9 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
%10 = call i32 @unlink(i8* %4)
%11 = tail call i32 @shutdown(i32 %0, i32 2)
ret i32 0
}
int test_imm_0Dint16_reg(short val) {
  return ((val) & (0x0D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_0Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 13
%6 = icmp ne i32 %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_0Dint16_reg(i16 signext %0) {
%2 = and i16 %0, 13
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkfifo(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ umask(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char const *);
int createfifo(const char *path, mode_t mode) {
  int ret;
  mode_t m = umask(0);
  unlink(path);
  ret = mkfifo(path, mode);
  umask(m);
  return ret;
}


x86 assembly (clang, -O0):
<createfifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
call   1050 <umask@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <mkfifo@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <umask@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createfifo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %edi,%edi
call   1050 <umask@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <mkfifo@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1050 <umask@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @createfifo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @umask(i32 0)
store i32 %7, i32* %6
%8 = load i8*, i8** %3
%9 = call i32 @unlink(i8* %8)
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @mkfifo(i8* %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @umask(i32 %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @createfifo(i8* %0, i32 %1) {
%3 = tail call i32 @umask(i32 0)
%4 = tail call i32 @unlink(i8* %0)
%5 = tail call i32 @mkfifo(i8* %0, i32 %1)
%6 = tail call i32 @umask(i32 %3)
ret i32 %5
}
/* Variables and functions */
int a_to_i(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *number = "  +348";
  printf("%d\n", a_to_i(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <a_to_i@plt>
mov    %eax,%esi
lea    0xebb(%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
call   1040 <a_to_i@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c" +348\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @a_to_i(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct Collector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ collector_collect(struct Collector *);
int /*<<< orphan*/ memory_destroy(struct Collector *);
void collector_destroy(struct Collector *collector) {
  assert(collector != NULL);
  collector_collect(collector);
  memory_destroy(collector);
}


x86 assembly (clang, -O0):
<collector_destroy>:
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   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <collector_collect@plt>
mov    -0x8(%rbp),%rdi
call   1040 <memory_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Collector = type { i32 }
define void @collector_destroy(%struct.Collector* %0) {
%2 = alloca %struct.Collector*
store %struct.Collector* %0, %struct.Collector** %2
%3 = load %struct.Collector*, %struct.Collector** %2
%4 = icmp ne %struct.Collector* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.Collector*, %struct.Collector** %2
%8 = call i32 @collector_collect(%struct.Collector* %7)
%9 = load %struct.Collector*, %struct.Collector** %2
%10 = call i32 @memory_destroy(%struct.Collector* %9)
ret void
}

LLVM IR (-O2):
%struct.Collector = type { i32 }
define void @collector_destroy(%struct.Collector* %0) {
%2 = icmp ne %struct.Collector* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @collector_collect(%struct.Collector* %0)
%6 = tail call i32 @memory_destroy(%struct.Collector* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/ const, int, unsigned long *,
            unsigned long *);
int migrate_pages(const pid_t pid, int count, unsigned long *old_nodes,
                  unsigned long *new_nodes) {
  int ret;
  ret = syscall(256, pid, count, old_nodes, new_nodes);
  return ret;
}


x86 assembly (clang, -O0):
<migrate_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x100,%edi
call   1030 <syscall@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<migrate_pages>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x100,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @migrate_pages(i32 %0, i32 %1, i64* %2, i64* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i64*, i64** %7
%13 = load i64*, i64** %8
%14 = call i32 @syscall(i32 256, i32 %10, i32 %11, i64* %12, i64* %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @migrate_pages(i32 %0, i32 %1, i64* %2, i64* %3) {
%5 = tail call i32 @syscall(i32 256, i32 %0, i32 %1, i64* %2, i64* %3)
ret i32 %5
}