xunge/DecIR huggingface dataset:
unsigned int getIp4BcastAddr(unsigned int ntwAddr, int cidr) {
  return (4294967295 >> cidr) | ntwAddr;
}


x86 assembly (clang, -O0):
<getIp4BcastAddr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    $0xffffffff,%eax
sar    %cl,%rax
mov    -0x4(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIp4BcastAddr>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shr    %cl,%rax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @getIp4BcastAddr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = zext i32 %5 to i64
%7 = ashr i64 4294967295, %6
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = or i64 %7, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @getIp4BcastAddr(i32 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = lshr i64 4294967295, %3
%5 = trunc i64 %4 to i32
%6 = or i32 %5, %0
ret i32 %6
}
/* Variables and functions */
float sqrt(float const);
float magnitude_3f(const float *x) {
  return sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
}


x86 assembly (clang, -O0):
<magnitude_3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magnitude_3f>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <magnitude_3f+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @magnitude_3f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call float @sqrt(float %23)
ret float %24
}

LLVM IR (-O2):
define float @magnitude_3f(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrt(float %9)
ret float %10
}
/* Type definitions */
typedef int __u8;
typedef int __u32;

/* Variables and functions */
int nvme_get_log(int, int, int, int, void *);
int nvme_log(int fd, __u32 nsid, __u8 log_id, __u32 data_len, void *data) {
  __u32 cdw10 = log_id | ((data_len >> 2) - 1) << 16;
  return nvme_get_log(fd, nsid, cdw10, data_len, data);
}


x86 assembly (clang, -O0):
<nvme_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    $0x2,%ecx
sub    $0x1,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1030 <nvme_get_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_log>:
mov    %ecx,%eax
shl    $0xe,%eax
add    $0xffff0000,%eax
and    $0xffff0000,%eax
or     %eax,%edx
jmp    1030 <nvme_get_log@plt>

LLVM IR (-O0):
define i32 @nvme_log(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = ashr i32 %13, 2
%15 = sub nsw i32 %14, 1
%16 = shl i32 %15, 16
%17 = or i32 %12, %16
store i32 %17, i32* %11
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i32, i32* %11
%21 = load i32, i32* %9
%22 = load i8*, i8** %10
%23 = call i32 @nvme_get_log(i32 %18, i32 %19, i32 %20, i32 %21, i8* %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @nvme_log(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = shl i32 %3, 14
%7 = add i32 %6, -65536
%8 = and i32 %7, -65536
%9 = or i32 %8, %2
%10 = tail call i32 @nvme_get_log(i32 %0, i32 %1, i32 %9, i32 %3, i8* %4)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ genExtra3(char *);
void __FOO_FOO() { genExtra3("#define FSUB1(name) PREFIX2(UPCASE(name))"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"#define FSUB1(name) PREFIX2(UPCASE(name))\00"
define void @__FOO_FOO() {
%1 = call i32 @genExtra3(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"#define FSUB1(name) PREFIX2(UPCASE(name))\00"
define void @__FOO_FOO() {
%1 = tail call i32 @genExtra3(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned short getushort(unsigned short x) {
  char *p1, *p2;
  unsigned short y;
  p1 = (char *)(&x);
  p2 = (char *)(&y);
  p2[1] = p1[0];
  p2[0] = p1[1];
  return (y);
}


x86 assembly (clang, -O0):
<getushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1a(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x1a(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getushort>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @getushort(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
store i16 %0, i16* %2
%6 = bitcast i16* %2 to i8*
store i8* %6, i8** %3
%7 = bitcast i16* %5 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
%18 = load i16, i16* %5
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @getushort(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x0c() {
  Assert_real((iscntrl(12)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              65, ("iscntrl should be 1 for 0x0c"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x0c>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x41,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x0c>:
push   %rax
mov    $0xc,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x41,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x0c\00"
define void @t_iscntrl_0x0c() {
%1 = call i32 @iscntrl(i32 12)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x0c\00"
define void @t_iscntrl_0x0c() {
%1 = tail call i32 @iscntrl(i32 12)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *rte_version(void) {
  static char version[32];
  if (version[0] != 0)
    return version;
  if (strlen("") == 0)
    snprintf(version, sizeof(version), "%s %d.%02d.%d", "DPDK", 17, 11, 0);
  else
    snprintf(version, sizeof(version), "%s %d.%02d.%d%s%d", "DPDK", 17, 11, 0,
             "", 16 < 16 ? 16 : 16 - 16);
  return version;
}


x86 assembly (clang, -O0):
<rte_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsbl 0x2f21(%rip),%eax
cmp    $0x0,%eax
je     1138 <rte_version+0x28>
lea    0x2f11(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <rte_version+0x69>
lea    0x2f01(%rip),%rdi
mov    $0x20,%esi
lea    0xeb5(%rip),%rdx
lea    0xebc(%rip),%rcx
mov    $0x11,%r8d
mov    $0xb,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    0x2ecb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_version>:
push   %rax
cmpb   $0x0,0x2f28(%rip)
jne    114e <rte_version+0x3e>
movl   $0x0,(%rsp)
lea    0x2f18(%rip),%rdi
lea    0xed1(%rip),%rdx
lea    0xed8(%rip),%rcx
mov    $0x20,%esi
mov    $0x11,%r8d
mov    $0xb,%r9d
xor    %eax,%eax
call   1030 <snprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@rte_version.version = internal global [32 x i8] zeroinitializer
@.str = [14 x i8] c"%s %d.%02d.%d\00"
@.str.1 = [5 x i8] c"DPDK\00"
define i8* @rte_version() {
%1 = alloca i8*
%2 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0)
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %0
%7 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i64 32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 17, i32 11, i32 0)
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i8** %1
br label %8
8: ; preds = %6, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@rte_version.version = internal global [32 x i8] zeroinitializer
@.str = [14 x i8] c"%s %d.%02d.%d\00"
@.str.1 = [5 x i8] c"DPDK\00"
define i8* @rte_version() {
%1 = load i8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0), i64 32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 17, i32 11, i32 0)
br label %5
5: ; preds = %0, %3
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @rte_version.version, i64 0, i64 0)
}
/* Variables and functions */
int doit(int);
int trych(void) { return doit(1); }


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

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

LLVM IR (-O0):
define i32 @trych() {
%1 = call i32 @doit(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @trych() {
%1 = tail call i32 @doit(i32 1)
ret i32 %1
}
int msm8937_unclamp_secondary_arm_cpu(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm8937_unclamp_secondary_arm_cpu(i32 %0) {
ret i32 0
}
/* Variables and functions */
long internal__syscall4(long, long, long, long, long);
long __syscall4(long n, long a1, long a2, long a3, long a4) {
  return internal__syscall4(n, a1, a2, a3, a4);
}


x86 assembly (clang, -O0):
<__syscall4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <internal__syscall4@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall4>:
jmp    1030 <internal__syscall4@plt>

LLVM IR (-O0):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i64 @internal__syscall4(i64 %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret i64 %16
}

LLVM IR (-O2):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 @internal__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void increment(void) {
  static int static_var = 0;
  printf("%d\n", static_var);
  ++static_var;
  return;
}


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2f00(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef7(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
push   %rax
mov    0x2f15(%rip),%esi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2f02(%rip)
pop    %rax
ret

LLVM IR (-O0):
@increment.static_var = internal global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @increment() {
%1 = load i32, i32* @increment.static_var
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @increment.static_var
%4 = add nsw i32 %3, 1
store i32 %4, i32* @increment.static_var
ret void
}

LLVM IR (-O2):
@increment.static_var = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @increment() {
%1 = load i32, i32* @increment.static_var
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @increment.static_var
%4 = add nsw i32 %3, 1
store i32 %4, i32* @increment.static_var
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout_init();
int main(void) {
  stdout_init();
  puts("Hello world!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <stdout_init@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = call i32 (...) @stdout_init()
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @stdout_init()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned char si475xAMRX_seek(unsigned char, unsigned char);
unsigned char si47xxAMRX_seek(int upDown, int stopFlag) {
  return si475xAMRX_seek((unsigned char)(upDown), (unsigned char)stopFlag);
}


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

x86 assembly (clang, -O2):
<si47xxAMRX_seek>:
movzbl %dil,%edi
movzbl %sil,%esi
jmp    1030 <si475xAMRX_seek@plt>

LLVM IR (-O0):
define zeroext i8 @si47xxAMRX_seek(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 = trunc i32 %5 to i8
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = call zeroext i8 @si475xAMRX_seek(i8 zeroext %6, i8 zeroext %8)
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @si47xxAMRX_seek(i32 %0, i32 %1) {
%3 = trunc i32 %0 to i8
%4 = trunc i32 %1 to i8
%5 = tail call zeroext i8 @si475xAMRX_seek(i8 zeroext %3, i8 zeroext %4)
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i, n, sum;
  for (i = 100, n = 0, sum = 0; i <= 200; i++) {
    if (i % 7 == 0) {
      sum += i;
      n++;
    }
  }
  printf("SUM:%d N:%d \n", sum, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jg     117a <main+0x6a>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <main+0x57>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116c <main+0x5c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"SUM:%d N:%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 200
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 7
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %5
22: ; preds = %5
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"SUM:%d N:%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2107, i32 14)
ret i32 0
}
unsigned int shift_log2(unsigned int x) {
  unsigned int n;
  for (n = 1; x > 2; n++) {
    x = x >> 1;
  }
  return n;
}


x86 assembly (clang, -O0):
<shift_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jbe    112f <shift_log2+0x2f>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <shift_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_log2>:
mov    $0x1,%eax
cmp    $0x3,%edi
jb     112c <shift_log2+0x2c>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x5,%edi
mov    %ecx,%edi
ja     1120 <shift_log2+0x20>
ret

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

LLVM IR (-O2):
define i32 @shift_log2(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 5
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t le_to_h_u32(const uint8_t *buf) {
  return (uint32_t)(buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24);
}


x86 assembly (clang, -O0):
<le_to_h_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_h_u32>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le_to_h_u32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = shl i32 %18, 24
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @le_to_h_u32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
/* Type definitions */
struct ptr_region {
  int dummy;
};

/* Variables and functions */
struct ptr_region **__dl_fpp_region_list();
struct ptr_region **region_list_addr(void) {
  return __dl_fpp_region_list();
}


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

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

LLVM IR (-O0):
%struct.ptr_region = type { i32 }
define %struct.ptr_region** @region_list_addr() {
%1 = call %struct.ptr_region** (...) @__dl_fpp_region_list()
ret %struct.ptr_region** %1
}

LLVM IR (-O2):
%struct.ptr_region = type { i32 }
define %struct.ptr_region** @region_list_addr() {
%1 = tail call %struct.ptr_region** (...) @__dl_fpp_region_list()
ret %struct.ptr_region** %1
}
/* Variables and functions */
int /*<<< orphan*/ _nop_();
void Delay5us() {
  unsigned char i, j;
  _nop_();
  _nop_();
  i = 1;
  j = 145;
  do {
    while (--j)
      ;
  } while (--i);
}


x86 assembly (clang, -O0):
<Delay5us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_nop_@plt>
mov    $0x0,%al
call   1030 <_nop_@plt>
movb   $0x1,-0x1(%rbp)
movb   $0x91,-0x2(%rbp)
jmp    1133 <Delay5us+0x23>
mov    -0x2(%rbp),%al
add    $0xff,%al
mov    %al,-0x2(%rbp)
cmp    $0x0,%al
je     1148 <Delay5us+0x38>
jmp    1133 <Delay5us+0x23>
jmp    114d <Delay5us+0x3d>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
cmp    $0x0,%al
jne    112e <Delay5us+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay5us>:
push   %rax
xor    %eax,%eax
call   1030 <_nop_@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <_nop_@plt>

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

LLVM IR (-O2):
define void @Delay5us() {
%1 = tail call i32 (...) @_nop_()
%2 = tail call i32 (...) @_nop_()
ret void
}
/* Variables and functions */
int get_cmd_line_value(char *, int, char *);
int get_bootreason(char *bootreason, int max_len) {
  return get_cmd_line_value(bootreason, max_len, "bootreason=");
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"bootreason=\00"
define i32 @get_bootreason(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @get_cmd_line_value(i8* %5, i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [12 x i8] c"bootreason=\00"
define i32 @get_bootreason(i8* %0, i32 %1) {
%3 = tail call i32 @get_cmd_line_value(i8* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handle_sigterm(int sig) { printf("blocking SIGTERM %d\n", sig); }


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"blocking SIGTERM %d\0A\00"
define void @handle_sigterm(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxpat1s(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x34));
}


x86 assembly (clang, -O0):
<write_pxpat1s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
add    $0x34,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxpat1s>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010034,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxpat1s(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 52
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxpat1s(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = getelementptr i8, i8* %5, i64 52
%7 = tail call i32 @writel(i32 %1, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("x: ");
  scanf("%d", &x);
  assert(x >= 0);
  printf("x = %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    0x4(%rsp),%esi
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mem(void) { printf("In the mem\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"In the mem\00"
define void @mem() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned long SysCtlSRAMSizeGet(void) {
  unsigned long ulTemp;
  unsigned long ulSize;
  unsigned char i;
  ulTemp = (*((volatile unsigned long *)(0x400FB930)));
  for (i = 0; i < 32; i++) {
    if (ulTemp & 0x01)
      ulSize += 0x2000;
    ulTemp = ulTemp >> 1;
  }
  return ulSize;
}


x86 assembly (clang, -O0):
<SysCtlSRAMSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb930,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movb   $0x0,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x20,%eax
jge    115a <SysCtlSRAMSizeGet+0x5a>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1141 <SysCtlSRAMSizeGet+0x41>
mov    -0x10(%rbp),%rax
add    $0x2000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    1114 <SysCtlSRAMSizeGet+0x14>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlSRAMSizeGet>:
mov    $0x20,%cl
mov    0x400fb930,%rsi
40
mov    %rsi,%rdx
nopl   (%rax)
lea    0x2000(%rax),%rdi
test   $0x1,%sil
cmove  %rax,%rdi
shr    $0x4,%rdx
lea    0x2000(%rdi),%rax
test   $0x2,%sil
cmove  %rdi,%rax
lea    0x2000(%rax),%rdi
test   $0x4,%sil
cmove  %rax,%rdi
lea    0x2000(%rdi),%rax
test   $0x8,%sil
cmove  %rdi,%rax
mov    %rdx,%rsi
add    $0xfc,%cl
jne    1110 <SysCtlSRAMSizeGet+0x10>
ret

LLVM IR (-O0):
define i64 @SysCtlSRAMSizeGet() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i8
%4 = load volatile i64, i64* inttoptr (i64 1074772272 to i64*)
store i64 %4, i64* %1
store i8 0, i8* %3
br label %5
5: ; preds = %19, %0
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp slt i32 %7, 32
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i64, i64* %1
%11 = and i64 %10, 1
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i64, i64* %2
%15 = add i64 %14, 8192
store i64 %15, i64* %2
br label %16
16: ; preds = %13, %9
%17 = load i64, i64* %1
%18 = lshr i64 %17, 1
store i64 %18, i64* %1
br label %19
19: ; preds = %16
%20 = load i8, i8* %3
%21 = add i8 %20, 1
store i8 %21, i8* %3
br label %5
22: ; preds = %5
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @SysCtlSRAMSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074772272 to i64*)
br label %2
2: ; preds = %2, %0
%3 = phi i8 [ 0, %0 ], [ %23, %2 ]
%4 = phi i64 [ undef, %0 ], [ %22, %2 ]
%5 = phi i64 [ %1, %0 ], [ %10, %2 ]
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
%8 = add i64 %4, 8192
%9 = select i1 %7, i64 %4, i64 %8
%10 = lshr i64 %5, 4
%11 = and i64 %5, 2
%12 = icmp eq i64 %11, 0
%13 = add i64 %9, 8192
%14 = select i1 %12, i64 %9, i64 %13
%15 = and i64 %5, 4
%16 = icmp eq i64 %15, 0
%17 = add i64 %14, 8192
%18 = select i1 %16, i64 %14, i64 %17
%19 = and i64 %5, 8
%20 = icmp eq i64 %19, 0
%21 = add i64 %18, 8192
%22 = select i1 %20, i64 %18, i64 %21
%23 = add nuw nsw i8 %3, 4
%24 = icmp eq i8 %23, 32
br i1 %24, label %25, label %2
25: ; preds = %2
ret i64 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hell(int argc, char *argv[]) {
  printf("welcom to hell!!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"welcom to hell!!\0A\00"
define i32 @hell(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"welcom to hell!!\00"
define i32 @hell(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sqrt(int /*<<< orphan*/);
uint32_t sqrti(uint32_t x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<sqrti>:
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define i32 @sqrti(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
ret i32 %2
}
/* Variables and functions */
double pow(double, double);
double fun(double x, double n, double c) { return (pow(x, n) - c); }


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

x86 assembly (clang, -O2):
<fun>:
push   %rax
movsd  %xmm2,(%rsp)
call   1030 <pow@plt>
subsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fun(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call double @pow(double %7, double %8)
%10 = load double, double* %6
%11 = fsub double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @fun(double %0, double %1, double %2) {
%4 = tail call double @pow(double %0, double %1)
%5 = fsub double %4, %2
ret double %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SASX(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = ((((int32_t)x << 16) >> 16) - (((int32_t)y) >> 16)) & (int32_t)0x0000FFFF;
  s = ((((int32_t)x) >> 16) + (((int32_t)y << 16) >> 16)) & (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SASX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
sub    %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SASX>:
mov    %esi,%eax
shr    $0x10,%eax
shl    $0x10,%esi
add    %edi,%esi
mov    %edi,%ecx
sub    %eax,%ecx
movzwl %cx,%eax
and    $0xffff0000,%esi
or     %eax,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @__SASX(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = ashr i32 %12, 16
%14 = sub nsw i32 %10, %13
%15 = and i32 %14, 65535
store i32 %15, i32* %5
%16 = load i64, i64* %3
%17 = trunc i64 %16 to i32
%18 = ashr i32 %17, 16
%19 = load i64, i64* %4
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 16
%22 = ashr i32 %21, 16
%23 = add nsw i32 %18, %22
%24 = and i32 %23, 65535
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = shl i32 %25, 16
%27 = load i32, i32* %5
%28 = or i32 %26, %27
%29 = sext i32 %28 to i64
ret i64 %29
}

LLVM IR (-O2):
define i64 @__SASX(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = lshr i32 %4, 16
%6 = sub i32 %3, %5
%7 = and i32 %6, 65535
%8 = shl i32 %4, 16
%9 = add i32 %8, %3
%10 = and i32 %9, -65536
%11 = or i32 %10, %7
%12 = sext i32 %11 to i64
ret i64 %12
}
unsigned int getuid() {}


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

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

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

LLVM IR (-O2):
define i32 @getuid() {
ret i32 undef
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double acosh(double x) { return log(x + sqrt(x * x - 1.)); }


x86 assembly (clang, -O0):
<acosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosh>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xece(%rip),%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @acosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -1.000000e+00)
%7 = call i64 @sqrt(double %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %3, %8
%10 = fptosi double %9 to i64
%11 = call double @log(i64 %10)
ret double %11
}

LLVM IR (-O2):
define double @acosh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -1.000000e+00)
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, %0
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
ret double %7
}
int f(int x) {
  int retval = 0;
  if (x % 2 == 1) {
    static int staticInt;
    retval = ++staticInt;
  } else {
    retval = 2;
  }
  return retval;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1139 <f+0x39>
mov    0x2efc(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef3(%rip)
mov    %eax,-0x8(%rbp)
jmp    1140 <f+0x40>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
mov    $0x2,%eax
cmp    $0x1,%edi
jne    1125 <f+0x25>
mov    0x2f08(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eff(%rip)
ret

LLVM IR (-O0):
@f.staticInt = internal global i32 0
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @f.staticInt
%9 = add nsw i32 %8, 1
store i32 %9, i32* @f.staticInt
store i32 %9, i32* %3
br label %11
10: ; preds = %1
store i32 2, i32* %3
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@f.staticInt = internal unnamed_addr global i32 0
define i32 @f(i32 %0) {
%2 = srem i32 %0, 2
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @f.staticInt
%6 = add nsw i32 %5, 1
store i32 %6, i32* @f.staticInt
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 2, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct entity_t {
  int dummy;
};

/* Variables and functions */
void write_rails_data_to_net(uint32_t conn, struct entity_t *rails) { ; }


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

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

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

LLVM IR (-O2):
%struct.entity_t = type { i32 }
define void @write_rails_data_to_net(i32 %0, %struct.entity_t* nocapture %1) {
ret void
}
/* Type definitions */
struct f32_to_i32 {
  int i;
  float f;
};
typedef int int32_t;

/* Variables and functions */
float Q_rsqrt(float number) {
  float x2;
  const float threehalfs = 1.5F;
  union f32_to_i32 {
    int32_t i;
    float f;
  } u;
  x2 = number * 0.5F;
  u.f = number;
  u.i = 0x5f3759df - (u.i >> 1);
  u.f = u.f * (threehalfs - (x2 * u.f * u.f));
  return u.f;
}


x86 assembly (clang, -O0):
<Q_rsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe91(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_rsqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
%union.f32_to_i32 = type { i32 }
define float @Q_rsqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca %union.f32_to_i32
store float %0, float* %2
store float 1.500000e+00, float* %4
%6 = load float, float* %2
%7 = fmul float %6, 5.000000e-01
store float %7, float* %3
%8 = load float, float* %2
%9 = bitcast %union.f32_to_i32* %5 to float*
store float %8, float* %9
%10 = bitcast %union.f32_to_i32* %5 to i32*
%11 = load i32, i32* %10
%12 = ashr i32 %11, 1
%13 = sub nsw i32 1597463007, %12
%14 = bitcast %union.f32_to_i32* %5 to i32*
store i32 %13, i32* %14
%15 = bitcast %union.f32_to_i32* %5 to float*
%16 = load float, float* %15
%17 = load float, float* %3
%18 = bitcast %union.f32_to_i32* %5 to float*
%19 = load float, float* %18
%20 = fmul float %17, %19
%21 = bitcast %union.f32_to_i32* %5 to float*
%22 = load float, float* %21
%23 = fneg float %20
%24 = call float @llvm.fmuladd.f32(float %23, float %22, float 1.500000e+00)
%25 = fmul float %16, %24
%26 = bitcast %union.f32_to_i32* %5 to float*
store float %25, float* %26
%27 = bitcast %union.f32_to_i32* %5 to float*
%28 = load float, float* %27
ret float %28
}

LLVM IR (-O2):
define float @Q_rsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}