xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ err(int /*<<< orphan*/, int /*<<< orphan*/ *);
scalar_t__ posix_memalign(void **, size_t, size_t const);
void *memalloc(const size_t size) {
  void *p;
  if (posix_memalign(&p, (size_t)64, size))
    err(EX_OSERR, NULL);
  return p;
}


x86 assembly (clang, -O0):
<memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1040 <posix_memalign@plt>
cmp    $0x0,%rax
je     115a <memalloc+0x3a>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalloc>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x40,%esi
call   1040 <posix_memalign@plt>
test   %rax,%rax
je     1146 <memalloc+0x26>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <err@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@EX_OSERR = global i32 0
define i8* @memalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @posix_memalign(i8** %3, i64 64, i64 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EX_OSERR
%9 = call i32 @err(i32 %8, i32* null)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@EX_OSERR = global i32 0
define i8* @memalloc(i64 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @posix_memalign(i8** %2, i64 64, i64 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @EX_OSERR
%8 = call i32 @err(i32 %7, i32* null)
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
ret i8* %10
}
/* Variables and functions */
int rom_present(char *);
int s3_orchid_86c911_available(void) {
  return rom_present(L"roms/video/s3/BIOS.BIN");
}


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

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

LLVM IR (-O0):
@.str = [23 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 66, i32 73, i32 79, i32 83, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @s3_orchid_86c911_available() {
%1 = call i32 @rom_present(i8* bitcast ([23 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [23 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 115, i32 51, i32 47, i32 66, i32 73, i32 79, i32 83, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @s3_orchid_86c911_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([23 x i32]* @.str to i8*))
ret i32 %1
}
int f4(int x) {
  int y;
  if (x)
    y = 1;
  return y;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1118 <f4+0x18>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f4(i32 %0) {
ret i32 1
}
/* Variables and functions */
char *calloc(int, int);
int rand();
int /*<<< orphan*/ strcpy(char *, char *);
char *fn103() {
  char *result;
  result = calloc(5 + rand() % 5, 4);
  strcpy((char *)result, "fn103");
  return result;
}


x86 assembly (clang, -O0):
<fn103>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn103>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0xe93(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"fn103\00"
define i8* @fn103() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 5
%4 = add nsw i32 5, %3
%5 = call i8* @calloc(i32 %4, i32 4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"fn103\00"
define i8* @fn103() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 5
%3 = add nsw i32 %2, 5
%4 = tail call i8* @calloc(i32 %3, i32 4)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
short *BGBMID_LoadWAV_RateStereo16(char const *, int *, int);
short *BGBMID_LoadWAV_22Stereo16(const char *name, int *rlen) {
  return (BGBMID_LoadWAV_RateStereo16(name, rlen, 22050));
}


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

x86 assembly (clang, -O2):
<BGBMID_LoadWAV_22Stereo16>:
mov    $0x5622,%edx
jmp    1030 <BGBMID_LoadWAV_RateStereo16@plt>

LLVM IR (-O0):
define i16* @BGBMID_LoadWAV_22Stereo16(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 i16* @BGBMID_LoadWAV_RateStereo16(i8* %5, i32* %6, i32 22050)
ret i16* %7
}

LLVM IR (-O2):
define i16* @BGBMID_LoadWAV_22Stereo16(i8* %0, i32* %1) {
%3 = tail call i16* @BGBMID_LoadWAV_RateStereo16(i8* %0, i32* %1, i32 22050)
ret i16* %3
}
/* Variables and functions */
int /*<<< orphan*/ render_lineto_pts(double, double);
int /*<<< orphan*/ render_moveto_pts(double, double);
void render_line_pts(double x1, double y1, double x2, double y2) {
  render_moveto_pts(x1, y1);
  render_lineto_pts(x2, y2);
}


x86 assembly (clang, -O0):
<render_line_pts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <render_moveto_pts@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <render_lineto_pts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<render_line_pts>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1040 <render_moveto_pts@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <render_lineto_pts@plt>

LLVM IR (-O0):
define void @render_line_pts(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call i32 @render_moveto_pts(double %9, double %10)
%12 = load double, double* %7
%13 = load double, double* %8
%14 = call i32 @render_lineto_pts(double %12, double %13)
ret void
}

LLVM IR (-O2):
define void @render_line_pts(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @render_moveto_pts(double %0, double %1)
%6 = tail call i32 @render_lineto_pts(double %2, double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
extern void Blue1(int one) { printf(" Hello from Blue1: one = %d!\n ", one); }


x86 assembly (clang, -O0):
<Blue1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Blue1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c" Hello from Blue1: one = %d!\0A \00"
define void @Blue1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c" Hello from Blue1: one = %d!\0A \00"
define void @Blue1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void foo381(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo381(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *test(void *arg) {
  sleep(10);
  return arg;
}


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

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <sleep@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @test(i8* readnone returned %0) {
%2 = tail call i32 @sleep(i32 10)
ret i8* %0
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_53(uint64_t x) {
  __asm__("rolq $53, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_53>:
mov    %rdi,%rax
rol    $0x35,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_53(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$53, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_53(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$53, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void QEIIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000020))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<QEIIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x20(%rcx)
ret

LLVM IR (-O0):
define void @QEIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 32
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @QEIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 32
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
int test_imm_91int16_mem(short *val) {
  return ((*val) & (-0x91 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_91int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -145
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int nearbyint(double);
int get_x(double x) { return nearbyint(x); }


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

x86 assembly (clang, -O2):
<get_x>:
jmp    1030 <nearbyint@plt>

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

LLVM IR (-O2):
define i32 @get_x(double %0) {
%2 = tail call i32 @nearbyint(double %0)
ret i32 %2
}
double __attribute__((nomips16)) f1(int i, float f, double d) {
  return i + f + d;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cvtsi2ss %edi,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f1(i32 %0, float %1, double %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca double
store i32 %0, i32* %4
store float %1, float* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load float, float* %5
%10 = fadd float %8, %9
%11 = fpext float %10 to double
%12 = load double, double* %6
%13 = fadd double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @f1(i32 %0, float %1, double %2) {
%4 = sitofp i32 %0 to float
%5 = fadd float %4, %1
%6 = fpext float %5 to double
%7 = fadd double %6, %2
ret double %7
}
/* Variables and functions */
int _ispunct(int);
int ispunct(int c) { return _ispunct(c); }


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

x86 assembly (clang, -O2):
<ispunct>:
jmp    1030 <_ispunct@plt>

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i32 @_ispunct(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pf5() { printf("Function Test 5\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Function Test 5\00"
define void @pf5() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: mkbootdisk BOOTSECTORFILE [FILE | @SECNUM]...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: mkbootdisk BOOTSECTORFILE [FILE | @SECNUM]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Usage: mkbootdisk BOOTSECTORFILE [FILE | @SECNUM]...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ local_assert(int);
void os_error(int line) { local_assert(line); }


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

x86 assembly (clang, -O2):
<os_error>:
jmp    1030 <local_assert@plt>

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

LLVM IR (-O2):
define void @os_error(i32 %0) {
%2 = tail call i32 @local_assert(i32 %0)
ret void
}
/* Variables and functions */
char *in_words(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < 1000; i++)
    printf("%s\n", in_words(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    116f <main+0x4f>
mov    -0x14(%rbp),%edi
call   1040 <in_words@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <in_words@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 1, %2 ], [ %7, %3 ]
%5 = tail call i8* @in_words(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 1000
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int symstrcomp(struct object *, char const *);
int strsymcomp(const char *left, struct object *right) {
  return -1 * symstrcomp(right, left);
}


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

x86 assembly (clang, -O2):
<strsymcomp>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <symstrcomp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.object = type { i32 }
define i32 @strsymcomp(i8* %0, %struct.object* %1) {
%3 = alloca i8*
%4 = alloca %struct.object*
store i8* %0, i8** %3
store %struct.object* %1, %struct.object** %4
%5 = load %struct.object*, %struct.object** %4
%6 = load i8*, i8** %3
%7 = call i32 @symstrcomp(%struct.object* %5, i8* %6)
%8 = mul nsw i32 -1, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.object = type { i32 }
define i32 @strsymcomp(i8* %0, %struct.object* %1) {
%3 = tail call i32 @symstrcomp(%struct.object* %1, i8* %0)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ string_permutation(char *, int /*<<< orphan*/, int);
int strlen(char *);
void main() {
  char str[] = "aba";
  int len = strlen(str);
  string_permutation(str, 0, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1040 <string_permutation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x616261,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1040 <string_permutation@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6382177, i32* %1
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @string_permutation(i8* %2, i32 0, i32 %3)
ret void
}
int do_main_process() {}


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

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

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

LLVM IR (-O2):
define i32 @do_main_process() {
ret i32 undef
}
int isLittleEndian() {
  int i = 1;
  char *p = (char *)&i;
  if (p[0] == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isLittleEndian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <isLittleEndian+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <isLittleEndian+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isLittleEndian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @isLittleEndian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ jsexport2_qsort(void *);
scalar_t__ qsort;
void jsexport_qsort(void) { jsexport2_qsort((void *)qsort); }


x86 assembly (clang, -O0):
<jsexport_qsort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%rdi
call   1030 <jsexport2_qsort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsexport_qsort>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rdi
jmp    1030 <jsexport2_qsort@plt>

LLVM IR (-O0):
@qsort = global i64 0
define void @jsexport_qsort() {
%1 = load i64, i64* @qsort
%2 = inttoptr i64 %1 to i8*
%3 = call i32 @jsexport2_qsort(i8* %2)
ret void
}

LLVM IR (-O2):
@qsort = global i64 0
define void @jsexport_qsort() {
%1 = load i64, i64* @qsort
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @jsexport2_qsort(i8* %2)
ret void
}
f(struct A *p) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type opaque
define i32 @f(%struct.A* %0) {
%2 = alloca i32
%3 = alloca %struct.A*
store %struct.A* %0, %struct.A** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.A = type opaque
define i32 @f(%struct.A* nocapture readnone %0) {
ret i32 undef
}
void ff_hevc_put_hevc_bi_w_pel_pixels6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels6_10_sse4() {
ret void
}
int thermal_notify_tz_gov_change(int tz_id, const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @thermal_notify_tz_gov_change(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
int main(void) {
  int *const *b;
  int **c;
  c = b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
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**
store i32 0, i32* %1
%4 = load i32**, i32*** %2
store i32** %4, i32*** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void on_error(char *msg) {
  (void)fprintf(stderr, "Error code: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<on_error>:
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
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<on_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Error code: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @on_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int est_base64_contains_nl(const char *src, int len) {
  int i;
  if (len < 64) {
    return 0;
  }
  for (i = 63; i < len - 1; i++) {
    if (src[i] == 0xA) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<est_base64_contains_nl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1121 <est_base64_contains_nl+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1174 <est_base64_contains_nl+0x74>
movl   $0x3f,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116d <est_base64_contains_nl+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115a <est_base64_contains_nl+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1174 <est_base64_contains_nl+0x74>
jmp    115f <est_base64_contains_nl+0x5f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <est_base64_contains_nl+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<est_base64_contains_nl>:
xor    %eax,%eax
cmp    $0x41,%esi
jl     111f <est_base64_contains_nl+0x1f>
add    $0xffffffff,%esi
mov    $0x3f,%ecx
nop
cmpb   $0xa,(%rdi,%rcx,1)
je     1120 <est_base64_contains_nl+0x20>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <est_base64_contains_nl+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @est_base64_contains_nl(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 65
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %4, %7
%10 = phi i64 [ 63, %4 ], [ %14, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 10
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %2
%16 = phi i32 [ 0, %2 ], [ 1, %9 ], [ 0, %7 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int SIGALRM;
int sigdelset(int /*<<< orphan*/ *, int);
int test(void) {
  sigset_t signal_set;
  int signal_number;
  int result;
  signal_number = SIGALRM;
  result = sigdelset(&signal_set, signal_number);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    -0x4(%rbp),%rdi
call   1030 <sigdelset@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1030 <sigdelset@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* @SIGALRM
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @sigdelset(i32* %1, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define i32 @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @SIGALRM
%4 = call i32 @sigdelset(i32* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ file_type(char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
ends_in_cgi(char *f) { return (strcmp(file_type(f), "cgi") == 0); }


x86 assembly (clang, -O0):
<ends_in_cgi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <file_type@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_in_cgi>:
push   %rax
call   1040 <file_type@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cgi\00"
define i32 @ends_in_cgi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @file_type(i8* %3)
%5 = call i64 @strcmp(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"cgi\00"
define i32 @ends_in_cgi(i8* %0) {
%2 = tail call i32 @file_type(i8* %0)
%3 = tail call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_5Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x5C << 0)) ? -20 : -40;
}


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

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

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

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

/* Variables and functions */
void free_int8_t(int8_t _val) { return; }


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

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

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

LLVM IR (-O2):
define void @free_int8_t(i32 %0) {
ret void
}
void asn1_enc_restore(void) {}


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

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

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

LLVM IR (-O2):
define void @asn1_enc_restore() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *x) { free(x); }


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

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

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

LLVM IR (-O2):
define void @my_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void __vmalloc(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__vmalloc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vmalloc>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__vmalloc = [10 x i8] c"__vmalloc\00"
define void @__vmalloc() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.__vmalloc, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__vmalloc = [10 x i8] c"__vmalloc\00"
define void @__vmalloc() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.__vmalloc, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test2func1(void) {
  printf("This is a function in the second object\n");
  return (1);
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"This is a function in the second object\0A\00"
define i32 @test2func1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [40 x i8] c"This is a function in the second object\00"
define i32 @test2func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int get_cmd_line_value(char *, int, char *);
int get_bootmode(char *bootmode, int max_len) {
  return get_cmd_line_value(bootmode, max_len, "bootmode=");
}


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

x86 assembly (clang, -O2):
<get_bootmode>:
lea    0xee9(%rip),%rdx
jmp    1030 <get_cmd_line_value@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"bootmode=\00"
define i32 @get_bootmode(i8* %0, i32 %1) {
%3 = tail call i32 @get_cmd_line_value(i8* %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ serial_console_putc(int /*<<< orphan*/, char);
void puts(unsigned char *cp) {
  while (*cp) {
    serial_console_putc(0, *cp);
    *cp++;
  }
  serial_console_putc(0, '\r');
  serial_console_putc(0, '\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <puts+0x38>
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl (%rax),%esi
call   1030 <serial_console_putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <serial_console_putc@plt>
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <serial_console_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <puts+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%esi
xor    %edi,%edi
call   1030 <serial_console_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
xor    %edi,%edi
mov    $0xd,%esi
call   1030 <serial_console_putc@plt>
xor    %edi,%edi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <serial_console_putc@plt>

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @serial_console_putc(i32 0, i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @serial_console_putc(i32 0, i8 signext 13)
%13 = tail call i32 @serial_console_putc(i32 0, i8 signext 10)
ret void
}
void foo653(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo653(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ suggest(char const *);
void missing(const char *prog, const char *arg) {
  fprintf(stderr, "%s: missing option \"-%s\"\n", prog, arg);
  suggest(prog);
}


x86 assembly (clang, -O0):
<missing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <suggest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<missing>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <suggest@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"%s: missing option \22-%s\22\0A\00"
define void @missing(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @suggest(i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"%s: missing option \22-%s\22\0A\00"
define void @missing(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @suggest(i8* %0)
ret void
}
int get_core_id(void) {
  int result;
  __asm__ __volatile__("mov $1, %%eax\n"
                       "cpuid\n"
                       : "=b"(result)
                       :
                       : "eax", "ecx", "edx");
  return (result >> 24) % 8;
}


x86 assembly (clang, -O0):
<get_core_id>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x1,%eax
cpuid
mov    %ebx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_core_id>:
push   %rbx
mov    $0x1,%eax
cpuid
mov    %ebx,%eax
shr    $0x18,%eax
sar    $0x1f,%ebx
shr    $0x5,%bl
add    %al,%bl
and    $0xf8,%bl
sub    %bl,%al
movsbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_core_id() {
%1 = alloca i32
%2 = call i32 asm sideeffect "mov $$1, %eax\0Acpuid\0A", "={bx},~{eax},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 24
%5 = srem i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_core_id() {
%1 = tail call i32 asm sideeffect "mov $$1, %eax\0Acpuid\0A", "={bx},~{eax},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
%2 = lshr i32 %1, 24
%3 = trunc i32 %2 to i8
%4 = srem i8 %3, 8
%5 = sext i8 %4 to i32
ret i32 %5
}
int opcode_is_true_branch(int opcode) {
  switch (opcode) {
  case 281:
  case 282:
  case 285:
  case 286:
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<opcode_is_true_branch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffee7,%eax
sub    $0x2,%eax
jb     1136 <opcode_is_true_branch+0x36>
jmp    1120 <opcode_is_true_branch+0x20>
mov    -0xc(%rbp),%eax
add    $0xfffffee3,%eax
sub    $0x1,%eax
ja     1142 <opcode_is_true_branch+0x42>
jmp    1136 <opcode_is_true_branch+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1149 <opcode_is_true_branch+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcode_is_true_branch>:
add    $0xfffffee7,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     111a <opcode_is_true_branch+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @opcode_is_true_branch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 281, label %5
i32 282, label %5
i32 285, label %5
i32 286, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.opcode_is_true_branch = [6 x i32] [i32 1, i32 1, i32 0, i32 0, i32 1, i32 1]
define i32 @opcode_is_true_branch(i32 %0) {
%2 = add i32 %0, -281
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.opcode_is_true_branch, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
size_t strftime(char *, int, char const *, struct tm *);
size_t my_strftime(char *str, int len, const char *fmt, struct tm *t) {
  return strftime(str, len, fmt, t);
}


x86 assembly (clang, -O0):
<my_strftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strftime>:
jmp    1030 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @my_strftime(i8* %0, i32 %1, i8* %2, %struct.tm* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.tm*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store %struct.tm* %3, %struct.tm** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load %struct.tm*, %struct.tm** %8
%13 = call i64 @strftime(i8* %9, i32 %10, i8* %11, %struct.tm* %12)
ret i64 %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @my_strftime(i8* %0, i32 %1, i8* %2, %struct.tm* %3) {
%5 = tail call i64 @strftime(i8* %0, i32 %1, i8* %2, %struct.tm* %3)
ret i64 %5
}