xunge/DecIR huggingface dataset:
int SteamAPI_ISteamFriends_GetCoplayFriendCount(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
  return 0;
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamFriends_GetCoplayFriendCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamFriends_GetCoplayFriendCount>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
call   1030 <xlogf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_GetCoplayFriendCount = [44 x i8] c"SteamAPI_ISteamFriends_GetCoplayFriendCount\00"
define i32 @SteamAPI_ISteamFriends_GetCoplayFriendCount(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @__func__.SteamAPI_ISteamFriends_GetCoplayFriendCount, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_GetCoplayFriendCount = [44 x i8] c"SteamAPI_ISteamFriends_GetCoplayFriendCount\00"
define i32 @SteamAPI_ISteamFriends_GetCoplayFriendCount(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @__func__.SteamAPI_ISteamFriends_GetCoplayFriendCount, i64 0, i64 0), i8* %0)
ret i32 0
}
void a_store(volatile int *p, int x) {
  while (((int (*)(int, int, volatile int *))0xffff0fc0)(*p, x, p))
    ;
}


x86 assembly (clang, -O0):
<a_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    $0xffff0fc0,%eax
call   *%rax
cmp    $0x0,%eax
je     1131 <a_store+0x31>
jmp    110f <a_store+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_store>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xffff0fc0,%r14d
nop
mov    (%rbx),%edi
mov    %ebp,%esi
mov    %rbx,%rdx
call   *%r14
test   %eax,%eax
jne    1110 <a_store+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @a_store(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %12, %2
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32*, i32** %3
%10 = call i32 inttoptr (i64 4294905792 to i32 (i32, i32, i32*)*)(i32 %7, i32 %8, i32* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @a_store(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = tail call i32 inttoptr (i64 4294905792 to i32 (i32, i32, i32*)*)(i32 %4, i32 %1, i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
char dir_id(char *id, char *s) {
  char dir_s[42];
  sprintf(dir_s, "%s/%s", id, s);
  return dir_s;
}


x86 assembly (clang, -O0):
<dir_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    -0x40(%rbp),%rax
movsbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_id>:
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xede(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define signext i8 @dir_id(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [42 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [42 x i8], [42 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [42 x i8], [42 x i8]* %5, i64 0, i64 0
%11 = ptrtoint i8* %10 to i8
ret i8 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define signext i8 @dir_id(i8* %0, i8* %1) {
%3 = alloca [42 x i8]
%4 = getelementptr inbounds [42 x i8], [42 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = ptrtoint [42 x i8]* %3 to i64
%7 = trunc i64 %6 to i8
ret i8 %7
}
void arm_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @arm_iomux_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rtc_restore();
int rtc_exit(void) {
  rtc_restore();
  return 0;
}


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

x86 assembly (clang, -O2):
<rtc_exit>:
push   %rax
xor    %eax,%eax
call   1030 <rtc_restore@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rtc_exit() {
%1 = call i32 (...) @rtc_restore()
ret i32 0
}

LLVM IR (-O2):
define i32 @rtc_exit() {
%1 = tail call i32 (...) @rtc_restore()
ret i32 0
}
/* Variables and functions */
double drand48();
double uniform(double min, double max) {
  double retval;
  double __cil_tmp4;
  {
    {
      retval = drand48();
      __cil_tmp4 = max - min;
      retval = retval * __cil_tmp4;
    }
    return (retval + min);
  }
}


x86 assembly (clang, -O0):
<uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <drand48@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @uniform(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = call double (...) @drand48()
store double %7, double* %5
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fsub double %8, %9
store double %10, double* %6
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fmul double %11, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = load double, double* %3
%16 = fadd double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @uniform(double %0, double %1) {
%3 = tail call double (...) @drand48()
%4 = fsub double %1, %0
%5 = fmul double %4, %3
%6 = fadd double %5, %0
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void xxxx_extinct() {
  printf("%Attempt to use non-existant Sharable Function\n");
  printf("%You need to update program to current revision\n");
  exit(0);
}


x86 assembly (clang, -O0):
<xxxx_extinct>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xxxx_extinct>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"%Attempt to use non-existant Sharable Function\0A\00"
@.str.1 = [49 x i8] c"%You need to update program to current revision\0A\00"
define void @xxxx_extinct() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [48 x i8] c"%Attempt to use non-existant Sharable Function\0A\00"
@.str.1 = [49 x i8] c"%You need to update program to current revision\0A\00"
define void @xxxx_extinct() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
__float128 from_sign_long_load_4(long *a) { return (__float128)a[4]; }


x86 assembly (clang, -O0):
<from_sign_long_load_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rdi
call   1120 <__floatditf>
add    $0x10,%rsp
pop    %rbp
ret
nop

x86 assembly (clang, -O2):
<from_sign_long_load_4>:
push   %rax
mov    0x20(%rdi),%rdi
call   1110 <__floatditf>
pop    %rax
ret
nopl   0x0(%rax)

LLVM IR (-O0):
define fp128 @from_sign_long_load_4(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 4
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to fp128
ret fp128 %6
}

LLVM IR (-O2):
define fp128 @from_sign_long_load_4(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 4
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to fp128
ret fp128 %4
}
short endian_short(const short x) { return x; }


x86 assembly (clang, -O0):
<endian_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @endian_short(i16 returned signext %0) {
ret i16 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ __jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
void __longjmp(__jmp_buf env, int val) {
  if (val == 0)
    val = 1;
  __set_errno(ENOSYS);
}


x86 assembly (clang, -O0):
<__longjmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <__longjmp+0x1f>
movl   $0x1,-0x8(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define void @__longjmp(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 1, i32* %4
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret void
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define void @__longjmp(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret void
}
__attribute__((noipa, optimize("Ofast"))) int f10(float x) {
  return __builtin_sqrtf(x) < 0x1.001002p+0f;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <f10+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <f10+0x14>
call   1030 <sqrtf@plt>
movss  0xed4(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fcmp olt float %4, 0x3FF0010020000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f10(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fcmp olt float %2, 0x3FF0010020000000
%4 = zext i1 %3 to i32
ret i32 %4
}
extern void flush_cache_range(struct mm_struct *mm, unsigned long start,
                              unsigned long end) {}


x86 assembly (clang, -O0):
<flush_cache_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mm_struct = type opaque
define void @flush_cache_range(%struct.mm_struct* %0, i64 %1, i64 %2) {
%4 = alloca %struct.mm_struct*
%5 = alloca i64
%6 = alloca i64
store %struct.mm_struct* %0, %struct.mm_struct** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @flush_cache_range(%struct.mm_struct* nocapture %0, i64 %1, i64 %2) {
ret void
}
/* Type definitions */
struct rhtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rhtable *);
void rhtable_destroy(struct rhtable *t) { free(t); }


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

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

LLVM IR (-O0):
%struct.rhtable = type { i32 }
define void @rhtable_destroy(%struct.rhtable* %0) {
%2 = alloca %struct.rhtable*
store %struct.rhtable* %0, %struct.rhtable** %2
%3 = load %struct.rhtable*, %struct.rhtable** %2
%4 = call i32 @free(%struct.rhtable* %3)
ret void
}

LLVM IR (-O2):
%struct.rhtable = type { i32 }
define void @rhtable_destroy(%struct.rhtable* nocapture %0) {
%2 = tail call i32 @free(%struct.rhtable* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int maddu_variants(int, int, int);
int main() {
  assert(maddu_variants(13, 17, 19) == 336);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xd,%edi
mov    $0x11,%esi
mov    $0x13,%edx
call   1040 <maddu_variants@plt>
cmp    $0x150,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xd,%edi
mov    $0x11,%esi
mov    $0x13,%edx
call   1040 <maddu_variants@plt>
xor    %edi,%edi
cmp    $0x150,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @maddu_variants(i32 13, i32 17, i32 19)
%3 = icmp eq i32 %2, 336
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @maddu_variants(i32 13, i32 17, i32 19)
%2 = icmp eq i32 %1, 336
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, struct perf_event_attr *, int /*<<< orphan*/, int, int,
            unsigned long);
int pf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu,
                  int group_fd, unsigned long flags) {
  return (syscall(298, attr, pid, cpu, group_fd, flags));
}


x86 assembly (clang, -O0):
<pf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    $0x12a,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x12a,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
define i32 @pf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i64, i64* %10
%16 = call i32 @syscall(i32 298, %struct.perf_event_attr* %11, i32 %12, i32 %13, i32 %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
define i32 @pf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = tail call i32 @syscall(i32 298, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %6
}
void init_dev_array(int **ptty) {
  int i;
  int *tty = *ptty;
  for (i = 0; i < 256; i++)
    tty[i] = -1;
}


x86 assembly (clang, -O0):
<init_dev_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    1144 <init_dev_array+0x44>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <init_dev_array+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_dev_array>:
push   %rax
mov    (%rdi),%rdi
mov    $0x400,%edx
mov    $0xff,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @init_dev_array(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
%4 = alloca i32*
store i32** %0, i32*** %2
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
store i32* %6, i32** %4
store i32 0, i32* %3
br label %7
7: ; preds = %15, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 -1, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @init_dev_array(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
ret void
}
int class_num(const char c) { return ((c >= '0') && (c <= '9')); }


x86 assembly (clang, -O0):
<class_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <class_num+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_num>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @class_num(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @class_num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void f1(int x) { return; }


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

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

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

LLVM IR (-O2):
define void @f1(i32 %0) {
ret void
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int _assert_strncmp_(const char *p1, const char *p2, size_t n) {
  if (!p1 || !p2)
    return p1 != p2;
  return strncmp(p1, p2, n);
}


x86 assembly (clang, -O0):
<_assert_strncmp_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <_assert_strncmp_+0x2a>
cmpq   $0x0,-0x18(%rbp)
jne    1152 <_assert_strncmp_+0x42>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <_assert_strncmp_+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_strncmp_>:
test   %rdi,%rdi
je     111f <_assert_strncmp_+0xf>
test   %rsi,%rsi
je     111f <_assert_strncmp_+0xf>
jmp    1030 <strncmp@plt>
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @_assert_strncmp_(i8* %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = icmp ne i8* %0, %1
%9 = zext i1 %8 to i32
br label %12
10: ; preds = %3
%11 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %11, %10 ], [ %9, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ rev(int *, int, int);
void rotate(int *arr, int size, int k) {
  int i = 0;
  int j = k;
  rev(arr, j, size - 1);
  rev(arr, i, j - 1);
  rev(arr, i, size - 1);
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <rev@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <rev@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <rev@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rdi,%r14
lea    -0x1(%rsi),%ebp
mov    %edx,%esi
mov    %ebp,%edx
call   1030 <rev@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <rev@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <rev@plt>

LLVM IR (-O0):
define void @rotate(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%9 = load i32, i32* %6
store i32 %9, i32* %8
%10 = load i32*, i32** %4
%11 = load i32, i32* %8
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = call i32 @rev(i32* %10, i32 %11, i32 %13)
%15 = load i32*, i32** %4
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = sub nsw i32 %17, 1
%19 = call i32 @rev(i32* %15, i32 %16, i32 %18)
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
%24 = call i32 @rev(i32* %20, i32 %21, i32 %23)
ret void
}

LLVM IR (-O2):
define void @rotate(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @rev(i32* %0, i32 %2, i32 %4)
%6 = add nsw i32 %2, -1
%7 = tail call i32 @rev(i32* %0, i32 0, i32 %6)
%8 = tail call i32 @rev(i32* %0, i32 0, i32 %4)
ret void
}
void g_list_nth() {}


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

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

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

LLVM IR (-O2):
define void @g_list_nth() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ByteSwap32(int /*<<< orphan*/);
uint32_t FromBE32(uint32_t value) { return ByteSwap32(value); }


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

x86 assembly (clang, -O2):
<FromBE32>:
jmp    1030 <ByteSwap32@plt>

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

LLVM IR (-O2):
define i32 @FromBE32(i32 %0) {
%2 = tail call i32 @ByteSwap32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ perror(char *);
void std_gettimeofday(struct timeval *tv, struct timezone *tz) {
  if (gettimeofday(tv, tz) == -1) {
    perror("gettimeofday");
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<std_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gettimeofday@plt>
cmp    $0xffffffff,%eax
jne    116c <std_gettimeofday+0x3c>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_gettimeofday>:
push   %rax
call   1030 <gettimeofday@plt>
cmp    $0xffffffff,%eax
je     113d <std_gettimeofday+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define void @std_gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load %struct.timezone*, %struct.timezone** %4
%7 = call i32 @gettimeofday(%struct.timeval* %5, %struct.timezone* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define void @std_gettimeofday(%struct.timeval* nocapture %0, %struct.timezone* nocapture %1) {
%3 = tail call i32 @gettimeofday(%struct.timeval* %0, %struct.timezone* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
void *(Memento_reference)(void *a) { return a; }


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

x86 assembly (clang, -O2):
<Memento_reference>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @Memento_reference(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
char GetCharUART1();
int /*<<< orphan*/ SendByteUART1(char);
char ReceiveByte() {
  char value = GetCharUART1();
  SendByteUART1(value);
  return value;
}


x86 assembly (clang, -O0):
<ReceiveByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <GetCharUART1@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <SendByteUART1@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReceiveByte>:
push   %rbx
xor    %eax,%eax
call   1040 <GetCharUART1@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <SendByteUART1@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @ReceiveByte() {
%1 = alloca i8
%2 = call signext i8 (...) @GetCharUART1()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call i32 @SendByteUART1(i8 signext %3)
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @ReceiveByte() {
%1 = tail call signext i8 (...) @GetCharUART1()
%2 = tail call i32 @SendByteUART1(i8 signext %1)
ret i8 %1
}
void delay_nus(unsigned long n) {
  unsigned long j;
  while (n--) {
    j = 8;
    while (j--)
      ;
  }
}


x86 assembly (clang, -O0):
<delay_nus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     114c <delay_nus+0x4c>
movq   $0x8,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1147 <delay_nus+0x47>
jmp    1129 <delay_nus+0x29>
jmp    1108 <delay_nus+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_nus(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ base64_encode_padded(char *, int, unsigned long);
const char *unum2str(unsigned long unum) {
  static char buf[5 + 1];
  base64_encode_padded(buf, sizeof(buf), unum);
  return buf;
}


x86 assembly (clang, -O0):
<unum2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f02(%rip),%rdi
mov    $0x6,%esi
call   1030 <base64_encode_padded@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unum2str>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f0e(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <base64_encode_padded@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@unum2str.buf = internal global [6 x i8] zeroinitializer
define i8* @unum2str(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @base64_encode_padded(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @unum2str.buf, i64 0, i64 0), i32 6, i64 %3)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @unum2str.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@unum2str.buf = internal global [6 x i8] zeroinitializer
define i8* @unum2str(i64 %0) {
%2 = tail call i32 @base64_encode_padded(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @unum2str.buf, i64 0, i64 0), i32 6, i64 %0)
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @unum2str.buf, i64 0, i64 0)
}
/* Variables and functions */
char **split_string_c(char const *, char const, char const *, char const *,
                      int /*<<< orphan*/ *);
char **split_string(const char *str, const char separator, const char *quotes,
                    const char *whitespace) {
  return split_string_c(str, separator, quotes, whitespace, NULL);
}


x86 assembly (clang, -O0):
<split_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %esi,%esi
mov    %esi,%r8d
movsbl %al,%esi
call   1030 <split_string_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_string>:
xor    %r8d,%r8d
jmp    1030 <split_string_c@plt>

LLVM IR (-O0):
define i8** @split_string(i8* %0, i8 signext %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8, i8* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8** @split_string_c(i8* %9, i8 signext %10, i8* %11, i8* %12, i32* null)
ret i8** %13
}

LLVM IR (-O2):
define i8** @split_string(i8* %0, i8 signext %1, i8* %2, i8* %3) {
%5 = tail call i8** @split_string_c(i8* %0, i8 signext %1, i8* %2, i8* %3, i32* null)
ret i8** %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void xmlClose(void) { printf("</control>\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"</control>\0A\00"
define void @xmlClose() {
%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"</control>\00"
define void @xmlClose() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_example1();
int /*<<< orphan*/ test_example2();
int /*<<< orphan*/ test_station_data();
void avr_sha1_test(void) {
  test_example1();
  test_example2();
  test_station_data();
}


x86 assembly (clang, -O0):
<avr_sha1_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_example1@plt>
mov    $0x0,%al
call   1050 <test_example2@plt>
mov    $0x0,%al
call   1040 <test_station_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<avr_sha1_test>:
push   %rax
xor    %eax,%eax
call   1030 <test_example1@plt>
xor    %eax,%eax
call   1050 <test_example2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_station_data@plt>

LLVM IR (-O0):
define void @avr_sha1_test() {
%1 = call i32 (...) @test_example1()
%2 = call i32 (...) @test_example2()
%3 = call i32 (...) @test_station_data()
ret void
}

LLVM IR (-O2):
define void @avr_sha1_test() {
%1 = tail call i32 (...) @test_example1()
%2 = tail call i32 (...) @test_example2()
%3 = tail call i32 (...) @test_station_data()
ret void
}
int main(void) {
  int counter = 0;
  while (counter < 5) {
    counter++;
    if (4 == counter) {
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    113d <main+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jne    1138 <main+0x38>
jmp    113d <main+0x3d>
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_to_eos();
int /*<<< orphan*/ place_cursor(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ refresh(int);
int /*<<< orphan*/ screen_erase();
void redraw(int full_screen) {
  place_cursor(0, 0, ((int)0));
  clear_to_eos();
  screen_erase();
  refresh(full_screen);
}


x86 assembly (clang, -O0):
<redraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <place_cursor@plt>
mov    $0x0,%al
call   1030 <clear_to_eos@plt>
mov    $0x0,%al
call   1040 <screen_erase@plt>
mov    -0x4(%rbp),%edi
call   1060 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <place_cursor@plt>
xor    %eax,%eax
call   1030 <clear_to_eos@plt>
xor    %eax,%eax
call   1040 <screen_erase@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <refresh@plt>

LLVM IR (-O0):
define void @redraw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @place_cursor(i32 0, i32 0, i32 0)
%4 = call i32 (...) @clear_to_eos()
%5 = call i32 (...) @screen_erase()
%6 = load i32, i32* %2
%7 = call i32 @refresh(i32 %6)
ret void
}

LLVM IR (-O2):
define void @redraw(i32 %0) {
%2 = tail call i32 @place_cursor(i32 0, i32 0, i32 0)
%3 = tail call i32 (...) @clear_to_eos()
%4 = tail call i32 (...) @screen_erase()
%5 = tail call i32 @refresh(i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateLowBatSet(uint32_t ui32LowBatFlags) {

  ;
  (*((volatile uint32_t *)(0x400FC010))) =
      (ui32LowBatFlags |
       ((*((volatile uint32_t *)(0x400FC010))) & ~(0x00006000 | 0x000000A0)));
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateLowBatSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x400fc010,%eax
mov    (%rax),%eax
and    $0xffff9f5f,%eax
or     %eax,%ecx
mov    $0x400fc010,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateLowBatSet>:
mov    $0xffff9f5f,%eax
and    0x400fc010,%eax
or     %edi,%eax
mov    %eax,0x400fc010
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateLowBatSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%5 = and i32 %4, -24737
%6 = or i32 %3, %5
store volatile i32 %6, i32* inttoptr (i64 1074774032 to i32*)
%7 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateLowBatSet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%3 = and i32 %2, -24737
%4 = or i32 %3, %0
store volatile i32 %4, i32* inttoptr (i64 1074774032 to i32*)
%5 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void eat(int eatPosition) {
  printf("philosopher %d is eating...\n", eatPosition);
}


x86 assembly (clang, -O0):
<eat>:
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):
<eat>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [29 x i8] c"philosopher %d is eating...\0A\00"
define void @eat(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int first_larger_prime(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number, difference;
  scanf("%d", &number);
  difference = first_larger_prime(number) - number;
  printf("%d - %d : %d\n", first_larger_prime(number), number, difference);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <first_larger_prime@plt>
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <first_larger_prime@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <first_larger_prime@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
sub    %edi,%ebx
call   1040 <first_larger_prime@plt>
mov    0xc(%rsp),%edx
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"%d - %d : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @first_larger_prime(i32 %4)
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
%8 = call i32 @first_larger_prime(i32 %6)
%9 = load i32, i32* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printChar(char);
void hey(char a) { printChar(a); }


x86 assembly (clang, -O0):
<hey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <printChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hey>:
jmp    1030 <printChar@plt>

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

LLVM IR (-O2):
define void @hey(i8 signext %0) {
%2 = tail call i32 @printChar(i8 signext %0)
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_hv12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv12_10_sse4() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_orl_to_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "ORL   "
          "0x%02X"
          ", A                   ",
          direct);
}


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

x86 assembly (clang, -O2):
<fprint_orl_to_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ORL 0x%02X, A \00"
define void @fprint_orl_to_direct(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 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ORL 0x%02X, A \00"
define void @fprint_orl_to_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct b_programme {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct b_programme *);
void freeProgs(struct b_programme *p) { free(p); }


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

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

LLVM IR (-O0):
%struct.b_programme = type { i32 }
define void @freeProgs(%struct.b_programme* %0) {
%2 = alloca %struct.b_programme*
store %struct.b_programme* %0, %struct.b_programme** %2
%3 = load %struct.b_programme*, %struct.b_programme** %2
%4 = call i32 @free(%struct.b_programme* %3)
ret void
}

LLVM IR (-O2):
%struct.b_programme = type { i32 }
define void @freeProgs(%struct.b_programme* nocapture %0) {
%2 = tail call i32 @free(%struct.b_programme* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mcfioC_Close(int);
void mcfio_close_(int *stream) { mcfioC_Close(*stream); }


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

x86 assembly (clang, -O2):
<mcfio_close_>:
mov    (%rdi),%edi
jmp    1030 <mcfioC_Close@plt>

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

LLVM IR (-O2):
define void @mcfio_close_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mcfioC_Close(i32 %2)
ret void
}