xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
char *strrchr(char const *, char);
int main() {
  char const *hello = "hello, world!";
  char *ind = strrchr(hello, 'w');
  printf("last char is at %li\n", ind - hello);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x77,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world!\00"
@.str.1 = [21 x i8] c"last char is at %li\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 119)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"last char is at %li\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret i32 0
}
/* Variables and functions */
int pow(double, int);
int sin(double);
double f(double x) { return (2 * sin(x) - (pow(x, 2) / 10)); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
cltq
imul   $0xffffffff99999999,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rbx,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @sin(double %3)
%5 = mul nsw i32 2, %4
%6 = load double, double* %2
%7 = call i32 @pow(double %6, i32 2)
%8 = sdiv i32 %7, 10
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call i32 @sin(double %0)
%3 = shl nsw i32 %2, 1
%4 = tail call i32 @pow(double %0, i32 2)
%5 = sdiv i32 %4, -10
%6 = add i32 %5, %3
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
double ceil(double);
unsigned int Base64_EncodeLength(unsigned int length) {
  double temp = (double)length;
  temp = ceil(temp / 3);
  temp *= 4;
  return (unsigned int)temp + 1;
}


x86 assembly (clang, -O0):
<Base64_EncodeLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%rax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base64_EncodeLength>:
push   %rax
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
divsd  0xee0(%rip),%xmm0
call   1030 <ceil@plt>
mulsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%rax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Base64_EncodeLength(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = fdiv double %6, 3.000000e+00
%8 = call double @llvm.ceil.f64(double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = fmul double %9, 4.000000e+00
store double %10, double* %3
%11 = load double, double* %3
%12 = fptoui double %11 to i32
%13 = add i32 %12, 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @Base64_EncodeLength(i32 %0) {
%2 = uitofp i32 %0 to double
%3 = fdiv double %2, 3.000000e+00
%4 = tail call double @llvm.ceil.f64(double %3)
%5 = fmul double %4, 4.000000e+00
%6 = fptoui double %5 to i32
%7 = add i32 %6, 1
ret i32 %7
}
/* Type definitions */
struct nlattr {
  int dummy;
};
typedef int /*<<< orphan*/ __le32;

/* Variables and functions */
scalar_t__ nla_data(struct nlattr const *);
__le32 nla_get_le32(const struct nlattr *nla) {
  return *(__le32 *)nla_data(nla);
}


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

x86 assembly (clang, -O2):
<nla_get_le32>:
push   %rax
call   1030 <nla_data@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_get_le32(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = call i64 @nla_data(%struct.nlattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_get_le32(%struct.nlattr* %0) {
%2 = tail call i64 @nla_data(%struct.nlattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clientf(char *);
void clientfr(char *string) {
  clientf("\33[1;31m"
          "[");
  clientf(string);
  clientf("]\r\n"
          "\33[0;37m");
}


x86 assembly (clang, -O0):
<clientfr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <clientf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clientf@plt>
lea    0xed1(%rip),%rdi
call   1030 <clientf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clientfr>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <clientf@plt>
mov    %rbx,%rdi
call   1030 <clientf@plt>
lea    0xeda(%rip),%rdi
pop    %rbx
jmp    1030 <clientf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[1;31m[\00"
@.str.1 = [11 x i8] c"]\0D\0A\1B[0;37m\00"
define void @clientfr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @clientf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @clientf(i8* %4)
%6 = call i32 @clientf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[1;31m[\00"
@.str.1 = [11 x i8] c"]\0D\0A\1B[0;37m\00"
define void @clientfr(i8* %0) {
%2 = tail call i32 @clientf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @clientf(i8* %0)
%4 = tail call i32 @clientf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_visual_attribs_long_header(void) {
  printf("Vis  Vis   Visual Trans  buff lev render DB ste  r   g   b   a  aux "
         "dep ste  accum buffers  MS   MS\n");
  printf(" ID Depth   Type  parent size el   type     reo sz  sz  sz  sz  buf "
         "th  ncl  r   g   b   a  num bufs\n");
  printf("---------------------------------------------------------------------"
         "-------------------------------\n");
}


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

x86 assembly (clang, -O2):
<print_visual_attribs_long_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
lea    0xf99(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [101 x i8] c"Vis Vis Visual Trans buff lev render DB ste r g b a aux dep ste accum buffers MS MS\0A\00"
@.str.1 = [102 x i8] c" ID Depth Type parent size el type reo sz sz sz sz buf th ncl r g b a num bufs\0A\00"
@.str.2 = [102 x i8] c"----------------------------------------------------------------------------------------------------\0A\00"
define void @print_visual_attribs_long_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [100 x i8] c"Vis Vis Visual Trans buff lev render DB ste r g b a aux dep ste accum buffers MS MS\00"
@str.3 = [101 x i8] c" ID Depth Type parent size el type reo sz sz sz sz buf th ncl r g b a num bufs\00"
@str.4 = [101 x i8] c"----------------------------------------------------------------------------------------------------\00"
define void @print_visual_attribs_long_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str.4, i64 0, i64 0))
ret void
}
config_options() {}


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

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

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

LLVM IR (-O2):
define i32 @config_options() {
ret i32 undef
}
void lis3l02dq_unconfigure_buffer(struct iio_dev *indio_dev) {}


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define void @lis3l02dq_unconfigure_buffer(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret void
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @lis3l02dq_unconfigure_buffer(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void fdmi_sleep(int sec) {
  sleep(sec);
  return;
}


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

x86 assembly (clang, -O2):
<fdmi_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @fdmi_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
float dsign(float val) {
  float sign;
  if (val >= 0.0f) {
    sign = 1.0f;
  } else {
    sign = -1.0f;
  }
  return sign;
}


x86 assembly (clang, -O0):
<dsign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112c <dsign+0x2c>
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1139 <dsign+0x39>
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @dsign(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %3
br label %8
7: ; preds = %1
store float -1.000000e+00, float* %3
br label %8
8: ; preds = %7, %6
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @dsign(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = select i1 %2, float -1.000000e+00, float 1.000000e+00
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void printErrorAndExit(char *str) {
  printf("error:%s\n", str);
  exit(1);
}


x86 assembly (clang, -O0):
<printErrorAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printErrorAndExit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"error:%s\0A\00"
define void @printErrorAndExit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"error:%s\0A\00"
define void @printErrorAndExit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_47int8_mem(signed char *val) {
  return ((*val) & (0x47 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_47int8_mem>:
testb  $0x47,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_47int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 71
%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_47int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 71
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float tanf(float x) {
  float tmp;
  __asm__ __volatile__("flds %0;"
                       "fptan;"
                       "fdivrp;"
                       "fstps %0;"
                       "fstps %1"
                       : "=m"(x), "=m"(tmp)
                       : "m"(x));
  return x;
}


x86 assembly (clang, -O0):
<tanf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
flds   -0x4(%rbp)
fptan
fdivrp %st,%st(1)
fstps  -0x4(%rbp)
fstps  -0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanf>:
movss  %xmm0,-0x8(%rsp)
flds   -0x8(%rsp)
fptan
fdivrp %st,%st(1)
fstps  -0x8(%rsp)
fstps  -0x4(%rsp)
movss  -0x8(%rsp),%xmm0
ret

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

LLVM IR (-O2):
define float @tanf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = bitcast float* %3 to i8*
%5 = load float, float* %2
ret float %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct xc_die {
  int dummy;
};

/* Variables and functions */
scalar_t__ xc6_get_frame_data_len(struct xc_die const *);
scalar_t__ xc6_get_frame_start(struct xc_die const *);
uint32_t xc6_get_bram_start(const struct xc_die *die) {
  return xc6_get_frame_start(die) + xc6_get_frame_data_len(die);
}


x86 assembly (clang, -O0):
<xc6_get_bram_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xc6_get_frame_start@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xc6_get_frame_data_len@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xc6_get_bram_start>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <xc6_get_frame_start@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <xc6_get_frame_data_len@plt>
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.xc_die = type { i32 }
define i64 @xc6_get_bram_start(%struct.xc_die* %0) {
%2 = alloca %struct.xc_die*
store %struct.xc_die* %0, %struct.xc_die** %2
%3 = load %struct.xc_die*, %struct.xc_die** %2
%4 = call i64 @xc6_get_frame_start(%struct.xc_die* %3)
%5 = load %struct.xc_die*, %struct.xc_die** %2
%6 = call i64 @xc6_get_frame_data_len(%struct.xc_die* %5)
%7 = add nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.xc_die = type { i32 }
define i64 @xc6_get_bram_start(%struct.xc_die* %0) {
%2 = tail call i64 @xc6_get_frame_start(%struct.xc_die* %0)
%3 = tail call i64 @xc6_get_frame_data_len(%struct.xc_die* %0)
%4 = add nsw i64 %3, %2
ret i64 %4
}
/* Variables and functions */
long double atan(double);
long double atanl(long double x) { return atan((double)x); }


x86 assembly (clang, -O0):
<atanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <atan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <atan@plt>

LLVM IR (-O0):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @atan(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @atan(double %2)
ret x86_fp80 %3
}
struct device_node *of_get_parent(const struct device_node *node) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define %struct.device_node* @of_get_parent(%struct.device_node* %0) {
%2 = alloca %struct.device_node*
store %struct.device_node* %0, %struct.device_node** %2
ret %struct.device_node* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias %struct.device_node* @of_get_parent(%struct.device_node* nocapture readnone %0) {
ret %struct.device_node* null
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void do_write(int fd, char *buf, int count) { write(fd, buf, count); }


x86 assembly (clang, -O0):
<do_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @do_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @do_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret void
}
void insb(unsigned short port, void *addr, unsigned long count) {
  asm volatile("cld ; rep ; insb"
               : "=D"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
cld
rep insb (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insb>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insb (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; insb", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void cmp_str(char *s1, char *s2, int n) {
  while ((n > 0) && (*s1 == *s2)) {
    s1++;
    s2++;
    n--;
  }
  assert((n <= 0) || (*s1 != *s2));
}


x86 assembly (clang, -O0):
<cmp_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    1148 <cmp_str+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1158 <cmp_str+0x48>
jmp    117e <cmp_str+0x6e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <cmp_str+0x13>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x16(%rbp)
jle    11a3 <cmp_str+0x93>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmp_str(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
br label %7
7: ; preds = %20, %3
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %7
%19 = phi i1 [ false, %7 ], [ %17, %10 ]
br i1 %19, label %20, label %27
20: ; preds = %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
%25 = load i32, i32* %6
%26 = add nsw i32 %25, -1
store i32 %26, i32* %6
br label %7
27: ; preds = %18
%28 = load i32, i32* %6
%29 = icmp sle i32 %28, 0
br i1 %29, label %38, label %30
30: ; preds = %27
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = load i8*, i8** %5
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %33, %36
br label %38
38: ; preds = %30, %27
%39 = phi i1 [ true, %27 ], [ %37, %30 ]
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
ret void
}

LLVM IR (-O2):
define void @cmp_str(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Write7219(int, int);
void Initial(void) {
  Write7219(0x0C, 0x01);
  Write7219(0x0F, 0x00);
  Write7219(0x09, 0xff);
  Write7219(0x0B, 0x07);
  Write7219(0x0A, 0x04);
}


x86 assembly (clang, -O0):
<Initial>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x1,%esi
call   1030 <Write7219@plt>
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <Write7219@plt>
mov    $0x9,%edi
mov    $0xff,%esi
call   1030 <Write7219@plt>
mov    $0xb,%edi
mov    $0x7,%esi
call   1030 <Write7219@plt>
mov    $0xa,%edi
mov    $0x4,%esi
call   1030 <Write7219@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Initial>:
push   %rax
mov    $0xc,%edi
mov    $0x1,%esi
call   1030 <Write7219@plt>
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <Write7219@plt>
mov    $0x9,%edi
mov    $0xff,%esi
call   1030 <Write7219@plt>
mov    $0xb,%edi
mov    $0x7,%esi
call   1030 <Write7219@plt>
mov    $0xa,%edi
mov    $0x4,%esi
pop    %rax
jmp    1030 <Write7219@plt>

LLVM IR (-O0):
define void @Initial() {
%1 = call i32 @Write7219(i32 12, i32 1)
%2 = call i32 @Write7219(i32 15, i32 0)
%3 = call i32 @Write7219(i32 9, i32 255)
%4 = call i32 @Write7219(i32 11, i32 7)
%5 = call i32 @Write7219(i32 10, i32 4)
ret void
}

LLVM IR (-O2):
define void @Initial() {
%1 = tail call i32 @Write7219(i32 12, i32 1)
%2 = tail call i32 @Write7219(i32 15, i32 0)
%3 = tail call i32 @Write7219(i32 9, i32 255)
%4 = tail call i32 @Write7219(i32 11, i32 7)
%5 = tail call i32 @Write7219(i32 10, i32 4)
ret void
}
int rtac_execg(int group) {}


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

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

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

LLVM IR (-O2):
define i32 @rtac_execg(i32 %0) {
ret i32 undef
}
int test_imm_45int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x45 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_45int64_highword_mem>:
testb  $0x45,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_45int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 69
%7 = icmp ne i64 %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_45int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 296352743424
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int abs(int x) { return __builtin_abs(x); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = icmp slt i32 %3, 0
%6 = select i1 %5, i32 %4, i32 %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int __ccaprice_atomic_swap(volatile int *x, int v) {
  __asm__ __volatile__("xchg %0, %1\n\t"
                       : "=r"(v), "=m"(*x)
                       : "0"(v)
                       : "memory");
  return v;
}


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

x86 assembly (clang, -O2):
<__ccaprice_atomic_swap>:
mov    %esi,%eax
xchg   %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @__ccaprice_atomic_swap(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 asm sideeffect "xchg $0, $1\0A\09", "=r,=*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @__ccaprice_atomic_swap(i32* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "xchg $0, $1\0A\09", "=r,=*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1)
ret i32 %3
}
unsigned char inb(unsigned short port) {
  unsigned char _v;
  asm volatile("in"
               "b"
               " %"
               "w"
               "1,%"
               ""
               "0"
               : "=a"(_v)
               : "Nd"(port));
  return _v;
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ num;

/* Variables and functions */
int /*<<< orphan*/ SwapWord(char *, int);
short big2littles(short num) {
  SwapWord((char *)&num, sizeof(num));
  return num;
}


x86 assembly (clang, -O0):
<big2littles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <SwapWord@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big2littles>:
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <SwapWord@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @big2littles(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 2)
%5 = load i16, i16* %2
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @big2littles(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i32 @SwapWord(i8* %3, i32 2)
%5 = load i16, i16* %2
ret i16 %5
}
void exit(int i) {
  while (i < 0 || i == 0 || i > 0)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     112f <exit+0x2f>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <exit+0x2f>
cmpl   $0x0,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    113f <exit+0x3f>
jmp    1144 <_fini>
jmp    1107 <exit+0x7>

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %14, %1
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br label %12
12: ; preds = %9, %6, %3
%13 = phi i1 [ true, %6 ], [ true, %3 ], [ %11, %9 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %3
15: ; preds = %12
unreachable
}

LLVM IR (-O2):
/* Variables and functions */
int Joystick(int);
int AnyJoystick() {
  int i;
  int result = 0;
  for (i = 0; i < 4; i++)
    result |= Joystick(i);
  return result;
}


x86 assembly (clang, -O0):
<AnyJoystick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    114c <AnyJoystick+0x3c>
mov    -0x4(%rbp),%edi
call   1030 <Joystick@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <AnyJoystick+0x16>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AnyJoystick>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <Joystick@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <Joystick@plt>
mov    %eax,%ebp
or     %ebx,%ebp
mov    $0x2,%edi
call   1030 <Joystick@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1030 <Joystick@plt>
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @AnyJoystick() {
%1 = tail call i32 @Joystick(i32 0)
%2 = tail call i32 @Joystick(i32 1)
%3 = or i32 %2, %1
%4 = tail call i32 @Joystick(i32 2)
%5 = or i32 %4, %3
%6 = tail call i32 @Joystick(i32 3)
%7 = or i32 %6, %5
ret i32 %7
}
void log_wakeup_reason(int irq) {}


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

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

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

LLVM IR (-O2):
define void @log_wakeup_reason(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __uportlibc_for_each_stream(int /*<<< orphan*/);
int /*<<< orphan*/ fclose;
void close_all_streams_for_exit(void) { __uportlibc_for_each_stream(fclose); }


x86 assembly (clang, -O0):
<close_all_streams_for_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__uportlibc_for_each_stream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_all_streams_for_exit>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__uportlibc_for_each_stream@plt>

LLVM IR (-O0):
@fclose = global i32 0
define void @close_all_streams_for_exit() {
%1 = load i32, i32* @fclose
%2 = call i32 @__uportlibc_for_each_stream(i32 %1)
ret void
}

LLVM IR (-O2):
@fclose = global i32 0
define void @close_all_streams_for_exit() {
%1 = load i32, i32* @fclose
%2 = tail call i32 @__uportlibc_for_each_stream(i32 %1)
ret void
}
double mstop() { return 0.0; }


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

x86 assembly (clang, -O2):
<mstop>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @mstop() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @mstop() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int my_strlen(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *ptr;
  ptr = (char *)malloc(100 * sizeof(char));
  printf("Enter the String\n");
  scanf("%s", ptr);
  printf("%d\n", my_strlen(ptr));
  free(ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xe92(%rip),%rdi
call   1050 <puts@plt>
lea    0xe7f(%rip),%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
lea    0xe6b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter the String\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @my_strlen(i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %1
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [17 x i8] c"Enter the String\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 100)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = tail call i32 @my_strlen(i8* %2)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Type definitions */
struct vm_area_struct {
  int dummy;
};
struct kobject {
  int dummy;
};
struct file {
  int dummy;
};
struct bin_attribute {
  int dummy;
};

/* Variables and functions */
int pci_mmap_resource(struct kobject *, struct bin_attribute *,
                      struct vm_area_struct *, int);
int pci_mmap_resource_sparse(struct file *filp, struct kobject *kobj,
                             struct bin_attribute *attr,
                             struct vm_area_struct *vma) {
  return pci_mmap_resource(kobj, attr, vma, 1);
}


x86 assembly (clang, -O0):
<pci_mmap_resource_sparse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <pci_mmap_resource@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_mmap_resource_sparse>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    $0x1,%ecx
jmp    1030 <pci_mmap_resource@plt>

LLVM IR (-O0):
%struct.file = type { i32 }
%struct.kobject = type { i32 }
%struct.bin_attribute = type { i32 }
%struct.vm_area_struct = type { i32 }
define i32 @pci_mmap_resource_sparse(%struct.file* %0, %struct.kobject* %1, %struct.bin_attribute* %2, %struct.vm_area_struct* %3) {
%5 = alloca %struct.file*
%6 = alloca %struct.kobject*
%7 = alloca %struct.bin_attribute*
%8 = alloca %struct.vm_area_struct*
store %struct.file* %0, %struct.file** %5
store %struct.kobject* %1, %struct.kobject** %6
store %struct.bin_attribute* %2, %struct.bin_attribute** %7
store %struct.vm_area_struct* %3, %struct.vm_area_struct** %8
%9 = load %struct.kobject*, %struct.kobject** %6
%10 = load %struct.bin_attribute*, %struct.bin_attribute** %7
%11 = load %struct.vm_area_struct*, %struct.vm_area_struct** %8
%12 = call i32 @pci_mmap_resource(%struct.kobject* %9, %struct.bin_attribute* %10, %struct.vm_area_struct* %11, i32 1)
ret i32 %12
}

LLVM IR (-O2):
%struct.file = type { i32 }
%struct.kobject = type { i32 }
%struct.bin_attribute = type { i32 }
%struct.vm_area_struct = type { i32 }
define i32 @pci_mmap_resource_sparse(%struct.file* nocapture readnone %0, %struct.kobject* %1, %struct.bin_attribute* %2, %struct.vm_area_struct* %3) {
%5 = tail call i32 @pci_mmap_resource(%struct.kobject* %1, %struct.bin_attribute* %2, %struct.vm_area_struct* %3, i32 1)
ret i32 %5
}
/* Type definitions */
struct slist_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ enough_mem(char *);
struct slist_t *slist_push(struct slist_t *, char *);
char *strdup(char const *);
struct slist_t *slist_cpush(struct slist_t *sl, const char *s) {
  char *a = strdup(s);
  enough_mem(a);
  return slist_push(sl, a);
}


x86 assembly (clang, -O0):
<slist_cpush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <enough_mem@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <slist_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slist_cpush>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <enough_mem@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <slist_push@plt>

LLVM IR (-O0):
%struct.slist_t = type { i32 }
define %struct.slist_t* @slist_cpush(%struct.slist_t* %0, i8* %1) {
%3 = alloca %struct.slist_t*
%4 = alloca i8*
%5 = alloca i8*
store %struct.slist_t* %0, %struct.slist_t** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @enough_mem(i8* %8)
%10 = load %struct.slist_t*, %struct.slist_t** %3
%11 = load i8*, i8** %5
%12 = call %struct.slist_t* @slist_push(%struct.slist_t* %10, i8* %11)
ret %struct.slist_t* %12
}

LLVM IR (-O2):
%struct.slist_t = type { i32 }
define %struct.slist_t* @slist_cpush(%struct.slist_t* %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %1)
%4 = tail call i32 @enough_mem(i8* %3)
%5 = tail call %struct.slist_t* @slist_push(%struct.slist_t* %0, i8* %3)
ret %struct.slist_t* %5
}
/* Variables and functions */
int /*<<< orphan*/ voltea();
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (*(linea + i) != '\0') {
    *(linea_max + i) = *(linea + i);
    i++;
  }
  voltea();
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ec6(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <copia+0x51>
movslq -0x4(%rbp),%rcx
mov    0x2eae(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e88(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <copia+0xf>
mov    $0x0,%al
call   1030 <voltea@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1140 <copia+0x30>
xor    %edx,%edx
mov    0x2eb2(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %cl,(%rsi,%rdx,1)
movzbl 0x1(%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1130 <copia+0x20>
xor    %eax,%eax
jmp    1030 <voltea@plt>

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i64 %11
%13 = load i8, i8* %12
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), i64 %15
store i8 %13, i8* %16
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %2
19: ; preds = %2
%20 = call i32 (...) @voltea()
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %7, %3 ], [ 0, %0 ]
%5 = phi i8 [ %9, %3 ], [ %1, %0 ]
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %4
store i8 %5, i8* %6
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
%12 = tail call i32 (...) @voltea()
ret void
}
int main() {
  int a = 3;
  int b = 1;
  a = 3 > 5 ? b = 5 : 1;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int isnan(long double);
int __isnanl(long double a1) { return isnan(a1); }


x86 assembly (clang, -O0):
<__isnanl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <isnan@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__isnanl>:
jmp    1030 <isnan@plt>

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

LLVM IR (-O2):
define i32 @__isnanl(x86_fp80 %0) {
%2 = tail call i32 @isnan(x86_fp80 %0)
ret i32 %2
}
int clk_set_parent(struct clk *c, struct clk *parent) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define i32 @clk_set_parent(%struct.clk* nocapture readnone %0, %struct.clk* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int syscall_read(int, char *, int);
int read(int file, char *ptr, int len) { return syscall_read(file, ptr, len); }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <syscall_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
jmp    1030 <syscall_read@plt>

LLVM IR (-O0):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @syscall_read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall_read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}