xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M400_f(char *s) {
  debug("M400_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M400_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M400_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M400_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M400_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
char *mqc_GetMatrixFile(char *, char *, int);
int /*<<< orphan*/ mqc_Global_init();
void mqc_get_MatrixFile_Names(char *FileName, char *Program, int iout) {
  static int mqc_first_call = 0;
  char *MatFileName;
  if (mqc_first_call == 0) {
    mqc_Global_init();
    mqc_first_call = 1;
  }
  MatFileName = mqc_GetMatrixFile(FileName, Program, iout);
}


x86 assembly (clang, -O0):
<mqc_get_MatrixFile_Names>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,0x2efa(%rip)
jne    1151 <mqc_get_MatrixFile_Names+0x31>
mov    $0x0,%al
call   1030 <mqc_Global_init@plt>
movl   $0x1,0x2ee3(%rip)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <mqc_GetMatrixFile@plt>
mov    %rax,-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mqc_get_MatrixFile_Names>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
cmpb   $0x0,0x2f00(%rip)
jne    1144 <mqc_get_MatrixFile_Names+0x24>
xor    %eax,%eax
call   1030 <mqc_Global_init@plt>
movb   $0x1,0x2ef0(%rip)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mqc_GetMatrixFile@plt>

LLVM IR (-O0):
@mqc_get_MatrixFile_Names.mqc_first_call = internal global i32 0
define void @mqc_get_MatrixFile_Names(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* @mqc_get_MatrixFile_Names.mqc_first_call
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (...) @mqc_Global_init()
store i32 1, i32* @mqc_get_MatrixFile_Names.mqc_first_call
br label %12
12: ; preds = %10, %3
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i8* @mqc_GetMatrixFile(i8* %13, i8* %14, i32 %15)
store i8* %16, i8** %7
ret void
}

LLVM IR (-O2):
@mqc_get_MatrixFile_Names.mqc_first_call = internal unnamed_addr global i1 false
define void @mqc_get_MatrixFile_Names(i8* %0, i8* %1, i32 %2) {
%4 = load i1, i1* @mqc_get_MatrixFile_Names.mqc_first_call
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (...) @mqc_Global_init()
store i1 true, i1* @mqc_get_MatrixFile_Names.mqc_first_call
br label %7
7: ; preds = %5, %3
%8 = tail call i8* @mqc_GetMatrixFile(i8* %0, i8* %1, i32 %2)
ret void
}
float test_huge_valf(void) { return __builtin_huge_valf(); }


x86 assembly (clang, -O0):
<test_huge_valf>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_huge_valf>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @test_huge_valf() {
ret float 0x7FF0000000000000
}

LLVM IR (-O2):
define float @test_huge_valf() {
ret float 0x7FF0000000000000
}
/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_W(int, int);
int CMP_HOST_REG_W(int dst_reg, int src_reg) {
  SUB_HOST_REG_W(dst_reg, src_reg);
  return dst_reg;
}


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

x86 assembly (clang, -O2):
<CMP_HOST_REG_W>:
push   %rbx
mov    %edi,%ebx
call   1030 <SUB_HOST_REG_W@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CMP_HOST_REG_W(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 = call i32 @SUB_HOST_REG_W(i32 %5, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @CMP_HOST_REG_W(i32 returned %0, i32 %1) {
%3 = tail call i32 @SUB_HOST_REG_W(i32 %0, i32 %1)
ret i32 %0
}
/* Variables and functions */
scalar_t__ fabs(float);
int compare_ff(float a, float b, const float max_diff) {
  return ((float)fabs(a - b)) <= max_diff;
}


x86 assembly (clang, -O0):
<compare_ff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ff>:
push   %rax
movss  %xmm2,0x4(%rsp)
subss  %xmm1,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
xor    %eax,%eax
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
setae  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @compare_ff(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = call i64 @fabs(float %9)
%11 = sitofp i64 %10 to float
%12 = load float, float* %6
%13 = fcmp ole float %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @compare_ff(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call i64 @fabs(float %4)
%6 = sitofp i64 %5 to float
%7 = fcmp ole float %6, %2
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_clear_multprec_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(577, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_clear_multprec_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x241,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_clear_multprec_Laurent_system>:
mov    $0x241,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_clear_multprec_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 577, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_clear_multprec_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 577, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
scalar_t__ printf(char *, int, double, char *, char);
int main(void) {
  int ret = 0;
  while (1)
    ret += printf("hello world: %d %f %s %c\n", ret, 4.5, "string", 'x');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed8(%rip),%rdi
movsd  0xec8(%rip),%xmm0
lea    0xee3(%rip),%rdx
mov    $0x78,%ecx
call   1030 <printf@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
lea    0xeeb(%rip),%r14
lea    0xefe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
movsd  0xec3(%rip),%xmm0
mov    %rbx,%rdx
mov    $0x78,%ecx
call   1030 <printf@plt>
add    %ebp,%eax
mov    %eax,%ebp
jmp    1130 <main+0x20>

LLVM IR (-O0):
@.str = [26 x i8] c"hello world: %d %f %s %c\0A\00"
@.str.1 = [7 x i8] c"string\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = call i64 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4, double 4.500000e+00, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext 120)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
br label %3
}

LLVM IR (-O2):
@.str = [26 x i8] c"hello world: %d %f %s %c\0A\00"
@.str.1 = [7 x i8] c"string\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i64 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2, double 4.500000e+00, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext 120)
%4 = trunc i64 %3 to i32
%5 = add i32 %2, %4
br label %1
}
int test_imm_5Aint16_reg(short val) {
  return ((val) & (0x5A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Aint16_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, 90
%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_5Aint16_reg(i16 signext %0) {
%2 = and i16 %0, 90
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
const char *get_perf_dir(void) { return "."; }


x86 assembly (clang, -O0):
<get_perf_dir>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_perf_dir>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i8* @get_perf_dir() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @get_perf_dir() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_draw_char() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_draw_char>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_draw_char>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_draw_char() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_draw_char() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  char *str;
  if (!b)
    return (NULL);
  str = b;
  while (len-- > 0)
    *(str++) = (unsigned char)c;
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1127 <ft_memset+0x27>
movq   $0x0,-0x8(%rbp)
jmp    116b <ft_memset+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
jbe    1163 <ft_memset+0x63>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    112f <ft_memset+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1126 <ft_memset+0x16>
test   %rdx,%rdx
je     1126 <ft_memset+0x16>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i64 %2, 0
%6 = or i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = trunc i32 %1 to i8
br label %9
9: ; preds = %7, %3
ret i8* %0
}
void jmp() {
  asm volatile("popq %%rax\n\t"
               "jmp *%%rax\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<jmp>:
pop    %rax
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @jmp() {
tail call void asm sideeffect "popq %rax\0A\09jmp *%rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ ceil(float);
scalar_t__ floor(float);
__attribute__((always_)) __attribute__((const)) float roundf(float x) {
  return (float)((x > 0) ? floor(x + 0.5) : ceil(x - 0.5));
}


x86 assembly (clang, -O0):
<roundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1165 <roundf+0x45>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
jmp    1187 <roundf+0x67>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8a(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1138 <roundf+0x18>
addss  0xed3(%rip),%xmm0
call   1040 <floor@plt>
jmp    1145 <roundf+0x25>
addss  0xec0(%rip),%xmm0
call   1030 <ceil@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @roundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fadd double %7, 5.000000e-01
%9 = fptrunc double %8 to float
%10 = call i64 @floor(float %9)
br label %17
11: ; preds = %1
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fsub double %13, 5.000000e-01
%15 = fptrunc double %14 to float
%16 = call i64 @ceil(float %15)
br label %17
17: ; preds = %11, %5
%18 = phi i64 [ %10, %5 ], [ %16, %11 ]
%19 = sitofp i64 %18 to float
ret float %19
}

LLVM IR (-O2):
define float @roundf(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd float %0, 5.000000e-01
%5 = tail call i64 @floor(float %4)
br label %9
6: ; preds = %1
%7 = fadd float %0, -5.000000e-01
%8 = tail call i64 @ceil(float %7)
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %5, %3 ], [ %8, %6 ]
%11 = sitofp i64 %10 to float
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ ls();
int /*<<< orphan*/ ls_l();
int main(int argc, char *argv[]) {
  if (argc == 1)
    ls();
  else if (argc == 2)
    ls_l();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114c <main+0x2c>
mov    $0x0,%al
call   1030 <ls@plt>
jmp    1162 <main+0x42>
cmpl   $0x2,-0x8(%rbp)
jne    115d <main+0x3d>
mov    $0x0,%al
call   1040 <ls_l@plt>
jmp    1162 <main+0x42>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
je     1134 <main+0x14>
cmp    $0x1,%edi
jne    113b <main+0x1b>
xor    %eax,%eax
call   1030 <ls@plt>
jmp    113b <main+0x1b>
xor    %eax,%eax
call   1040 <ls_l@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @ls()
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @ls_l()
br label %15
15: ; preds = %13, %10
br label %16
16: ; preds = %15, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
switch i32 %0, label %7 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = tail call i32 (...) @ls()
br label %7
5: ; preds = %2
%6 = tail call i32 (...) @ls_l()
br label %7
7: ; preds = %2, %5, %3
ret i32 0
}
void armada_msi_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @armada_msi_init() {
ret void
}
/* Variables and functions */
float __ieee754_scalbf(float, float);
scalar_t__ ilogbf(float);
float significandf(float x) { return __ieee754_scalbf(x, (float)-ilogbf(x)); }


x86 assembly (clang, -O0):
<significandf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <ilogbf@plt>
movss  -0x8(%rbp),%xmm0
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
cvtsi2ss %rax,%xmm1
call   1040 <__ieee754_scalbf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<significandf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <ilogbf@plt>
neg    %rax
cvtsi2ss %rax,%xmm1
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <__ieee754_scalbf@plt>

LLVM IR (-O0):
define float @significandf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call i64 @ilogbf(float %4)
%6 = sub nsw i64 0, %5
%7 = sitofp i64 %6 to float
%8 = call float @__ieee754_scalbf(float %3, float %7)
ret float %8
}

LLVM IR (-O2):
define float @significandf(float %0) {
%2 = tail call i64 @ilogbf(float %0)
%3 = sub nsw i64 0, %2
%4 = sitofp i64 %3 to float
%5 = tail call float @__ieee754_scalbf(float %0, float %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, unsigned char,
                           unsigned char, unsigned char);
char *ipv4addr_tostr(char *s, void *addr) {
  unsigned char *x = addr;
  sprintf(s, "%u.%u.%u.%u", x[0], x[1], x[2], x[3]);
  return s;
}


x86 assembly (clang, -O0):
<ipv4addr_tostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x18(%rbp),%rax
lea    0xeb4(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl 0x3(%rax),%r9d
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4addr_tostr>:
push   %rbx
mov    %rdi,%rbx
movzbl (%rsi),%edx
movzbl 0x1(%rsi),%ecx
movzbl 0x2(%rsi),%r8d
movzbl 0x3(%rsi),%r9d
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i8* @ipv4addr_tostr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = load i8, i8* %18
%20 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %10, i8 zeroext %13, i8 zeroext %16, i8 zeroext %19)
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [12 x i8] c"%u.%u.%u.%u\00"
define i8* @ipv4addr_tostr(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 3
%9 = load i8, i8* %8
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %5, i8 zeroext %7, i8 zeroext %9)
ret i8* %0
}
long int strtol(const char *nptr __attribute__((unused)),
                char **endptr __attribute__((unused)),
                int base __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @strtol(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2) {
ret i64 0
}
unsigned normal2x_width_generic_output_fmts(unsigned input_fmts) {
  return input_fmts;
}


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

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

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

LLVM IR (-O2):
define i32 @normal2x_width_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;
struct fb_bitfield {
  int offset;
  int length;
};

/* Variables and functions */
uint8_t getfbcolor(uint32_t pixel, const struct fb_bitfield *bitfield,
                   const uint16_t *colormap) {
  return ((pixel >> bitfield->offset) & ((1 << bitfield->length) - 1))
         << (8 - bitfield->length);
  return colormap[(pixel >> bitfield->offset) &
                  ((1 << bitfield->length) - 1)] >>
         8;
}


x86 assembly (clang, -O0):
<getfbcolor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sar    %cl,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%rdx
mov    $0x8,%ecx
sub    0x4(%rdx),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfbcolor>:
mov    (%rsi),%cl
sar    %cl,%edi
mov    $0x8,%cl
sub    0x4(%rsi),%cl
shl    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
%struct.fb_bitfield = type { i32, i32 }
define i32 @getfbcolor(i32 %0, %struct.fb_bitfield* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.fb_bitfield*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.fb_bitfield* %1, %struct.fb_bitfield** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.fb_bitfield*, %struct.fb_bitfield** %5
%9 = getelementptr inbounds %struct.fb_bitfield, %struct.fb_bitfield* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = ashr i32 %7, %10
%12 = load %struct.fb_bitfield*, %struct.fb_bitfield** %5
%13 = getelementptr inbounds %struct.fb_bitfield, %struct.fb_bitfield* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = shl i32 1, %14
%16 = sub nsw i32 %15, 1
%17 = and i32 %11, %16
%18 = load %struct.fb_bitfield*, %struct.fb_bitfield** %5
%19 = getelementptr inbounds %struct.fb_bitfield, %struct.fb_bitfield* %18, i32 0, i32 1
%20 = load i32, i32* %19
%21 = sub nsw i32 8, %20
%22 = shl i32 %17, %21
ret i32 %22
}

LLVM IR (-O2):
%struct.fb_bitfield = type { i32, i32 }
define i32 @getfbcolor(i32 %0, %struct.fb_bitfield* nocapture %1, i32* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.fb_bitfield, %struct.fb_bitfield* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = ashr i32 %0, %5
%7 = getelementptr inbounds %struct.fb_bitfield, %struct.fb_bitfield* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sub nsw i32 8, %8
%10 = shl i32 %6, %9
%11 = and i32 %10, 255
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sys_futex0(int *, int /*<<< orphan*/, int);
void futex_wait(int *addr, int val) { sys_futex0(addr, 0, val); }


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

x86 assembly (clang, -O2):
<futex_wait>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <sys_futex0@plt>

LLVM IR (-O0):
define void @futex_wait(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 = call i32 @sys_futex0(i32* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @futex_wait(i32* %0, i32 %1) {
%3 = tail call i32 @sys_futex0(i32* %0, i32 0, i32 %1)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *new_) {
  list_replace(old, new_);
  INIT_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
void bar_long(long *x) { *x = __real foo_long(5); }


x86 assembly (clang, -O0):
<bar_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <foo_long@plt>
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_long>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_long@plt>
cltq
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @bar_long(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo_long to i32 (i32, ...)*)(i32 5)
%4 = sext i32 %3 to i64
%5 = load i64*, i64** %2
store i64 %4, i64* %5
ret void
}

LLVM IR (-O2):
define void @bar_long(i64* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_long to i32 (i32, ...)*)(i32 5)
%3 = sext i32 %2 to i64
store i64 %3, i64* %0
ret void
}
int isPlainInt(char *input) {
  int r = 1;
  int i;
  for (i = 0; *(input + i) != 0; i++) {
    if (!(*(input + i) > 47 && *(input + i) < 58)) {
      r = 0;
    }
  }
  return r;
}


x86 assembly (clang, -O0):
<isPlainInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116f <isPlainInt+0x6f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jle    1155 <isPlainInt+0x55>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jl     115c <isPlainInt+0x5c>
movl   $0x0,-0xc(%rbp)
jmp    1161 <isPlainInt+0x61>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <isPlainInt+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPlainInt>:
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <isPlainInt+0x35>
add    $0x1,%rdi
mov    $0x1,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xd0,%cl
cmp    $0xa,%cl
cmovae %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <isPlainInt+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isPlainInt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 1, %1 ]
%8 = add i8 %6, -48
%9 = icmp ult i8 %8, 10
%10 = select i1 %9, i32 %7, i32 0
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 1, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
void *malloc(int);
void *alloc5(void) { return malloc(1); }


x86 assembly (clang, -O0):
<alloc5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc5>:
mov    $0x1,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @alloc5() {
%1 = call i8* @malloc(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @alloc5() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
ret i8* %1
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_grow(struct buffer *, char *, int);
void buffer_grow_char(struct buffer *buffer, char c) {
  buffer_grow(buffer, &c, 1);
}


x86 assembly (clang, -O0):
<buffer_grow_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <buffer_grow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_grow_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <buffer_grow@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_grow_char(%struct.buffer* %0, i8 signext %1) {
%3 = alloca %struct.buffer*
%4 = alloca i8
store %struct.buffer* %0, %struct.buffer** %3
store i8 %1, i8* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = call i32 @buffer_grow(%struct.buffer* %5, i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_grow_char(%struct.buffer* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @buffer_grow(%struct.buffer* %0, i8* %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct int96_num {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ int96_get_low64bit(struct int96_num const *);
int /*<<< orphan*/ int96_is_uint64(struct int96_num const *);
uint64_t int96_extract_uint64(const struct int96_num *num) {
  assert(int96_is_uint64(num));
  return int96_get_low64bit(num);
}


x86 assembly (clang, -O0):
<int96_extract_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <int96_is_uint64@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <int96_get_low64bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int96_extract_uint64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <int96_is_uint64@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <int96_get_low64bit@plt>

LLVM IR (-O0):
%struct.int96_num = type { i32 }
define i32 @int96_extract_uint64(%struct.int96_num* %0) {
%2 = alloca %struct.int96_num*
store %struct.int96_num* %0, %struct.int96_num** %2
%3 = load %struct.int96_num*, %struct.int96_num** %2
%4 = call i32 @int96_is_uint64(%struct.int96_num* %3)
%5 = call i32 @assert(i32 %4)
%6 = load %struct.int96_num*, %struct.int96_num** %2
%7 = call i32 @int96_get_low64bit(%struct.int96_num* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.int96_num = type { i32 }
define i32 @int96_extract_uint64(%struct.int96_num* %0) {
%2 = tail call i32 @int96_is_uint64(%struct.int96_num* %0)
%3 = tail call i32 @assert(i32 %2)
%4 = tail call i32 @int96_get_low64bit(%struct.int96_num* %0)
ret i32 %4
}
int charactor_to_digit(char x) {
  if ('0' <= x && x <= '9') {
    return x - '0';
  }
  return -1;
}


x86 assembly (clang, -O0):
<charactor_to_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1137 <charactor_to_digit+0x37>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1137 <charactor_to_digit+0x37>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113e <charactor_to_digit+0x3e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charactor_to_digit>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @charactor_to_digit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 48, %5
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %16
15: ; preds = %7, %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @charactor_to_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *remove_leading_zero(char *s) {
  if (s[0] != '0') {
    return s;
  }
  char *buf = malloc(sizeof(s) - sizeof(char));
  strcpy(buf, s + sizeof(char));
  return buf;
}


x86 assembly (clang, -O0):
<remove_leading_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
je     1149 <remove_leading_zero+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <remove_leading_zero+0x50>
mov    $0x7,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_leading_zero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmpb   $0x30,(%rdi)
jne    114b <remove_leading_zero+0x2b>
mov    $0x7,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
add    $0x1,%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @remove_leading_zero(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, 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 ne i32 %8, 48
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i8*, i8** %3
store i8* %11, i8** %2
br label %19
12: ; preds = %1
%13 = call i8* @malloc(i32 7)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 @strcpy(i8* %14, i8* %16)
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %12, %10
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @remove_leading_zero(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call dereferenceable_or_null(7) i8* @malloc(i32 7)
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i32 @strcpy(i8* %5, i8* %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %5, %4 ], [ %0, %1 ]
ret i8* %9
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  char c;
  char d;
  char m;
  c = getchar();
  m = c - 'a';
  d = 'z' - m;
  printf("%c\n", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x7(%rbp)
movsbl -0x7(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xea8(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0xdb,%cl
sub    %al,%cl
movsbl %cl,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 97
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = sub nsw i32 122, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = load i8, i8* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = sub i8 -37, %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
void SelectIstpMod(unsigned char UcSelRange) {
  switch (UcSelRange) {
  case 0x00:
    RamWrite32A(0x1083, 0x00000000);
    RamWrite32A(0x1183, 0x00000000);
    break;
  }
}


x86 assembly (clang, -O0):
<SelectIstpMod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
test   %al,%al
jne    1146 <SelectIstpMod+0x36>
jmp    112e <SelectIstpMod+0x1e>
mov    $0x1083,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x1183,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SelectIstpMod>:
test   %edi,%edi
je     1115 <SelectIstpMod+0x5>
ret
push   %rax
mov    $0x1083,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x1183,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <RamWrite32A@plt>

LLVM IR (-O0):
define void @SelectIstpMod(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %8 [
i32 0, label %5
]
5: ; preds = %1
%6 = call i32 @RamWrite32A(i32 4227, i32 0)
%7 = call i32 @RamWrite32A(i32 4483, i32 0)
br label %8
8: ; preds = %1, %5
ret void
}

LLVM IR (-O2):
define void @SelectIstpMod(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @RamWrite32A(i32 4227, i32 0)
%5 = tail call i32 @RamWrite32A(i32 4483, i32 0)
br label %6
6: ; preds = %1, %3
ret void
}
char *FS_SkipPath(char *pathname) {
  char *last;
  last = pathname;
  while (*pathname) {
    if (*pathname == '/') {
      last = pathname + 1;
    }
    pathname++;
  }
  return last;
}


x86 assembly (clang, -O0):
<FS_SkipPath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <FS_SkipPath+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <FS_SkipPath+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <FS_SkipPath+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FS_SkipPath>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <FS_SkipPath+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <FS_SkipPath+0x10>
test   %dl,%dl
jne    1113 <FS_SkipPath+0x13>
ret

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

LLVM IR (-O2):
define i8* @FS_SkipPath(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *maFonction(void *data) {
  int i;
  for (i = 0; i < 50; i++)
    printf("2");
  return NULL;
}


x86 assembly (clang, -O0):
<maFonction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1147 <maFonction+0x37>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <maFonction+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maFonction>:
push   %rbx
mov    $0x32,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x32,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <maFonction+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @maFonction(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @putchar(i32 50)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 50
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* null
}
/* Type definitions */
struct token {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_token_type(struct token *);
int get_token_type_size(int /*<<< orphan*/);
int get_token_size(struct token *tok) {
  return get_token_type_size(get_token_type(tok));
}


x86 assembly (clang, -O0):
<get_token_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_token_type@plt>
mov    %eax,%edi
call   1030 <get_token_type_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_token_size>:
push   %rax
call   1040 <get_token_type@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <get_token_type_size@plt>

LLVM IR (-O0):
%struct.token = type { i32 }
define i32 @get_token_size(%struct.token* %0) {
%2 = alloca %struct.token*
store %struct.token* %0, %struct.token** %2
%3 = load %struct.token*, %struct.token** %2
%4 = call i32 @get_token_type(%struct.token* %3)
%5 = call i32 @get_token_type_size(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.token = type { i32 }
define i32 @get_token_size(%struct.token* %0) {
%2 = tail call i32 @get_token_type(%struct.token* %0)
%3 = tail call i32 @get_token_type_size(i32 %2)
ret i32 %3
}
void foo_1_1_2_1_1_2_1_2_1() {}


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

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

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

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