xunge/DecIR huggingface dataset:
/* Variables and functions */
int __get_cpuid(int, unsigned int *, unsigned int *, unsigned int *,
                unsigned int *);
int main(void) {
  unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
  return __get_cpuid(0x15, &eax, &ebx, &ecx, &edx);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x15,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <__get_cpuid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x15,%edi
call   1030 <__get_cpuid@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = call i32 @__get_cpuid(i32 21, i32* %1, i32* %2, i32* %3, i32* %4)
ret i32 %9
}
unsigned char n2c(int i) {
  return (((i) < 'a') ? ('A' + ((i)&0x1f))
                      : (((i) > 'z') ? ('.') : ('a' + ((i)&0x1f))));
}


x86 assembly (clang, -O0):
<n2c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jge    1122 <n2c+0x22>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <n2c+0x4b>
cmpl   $0x7a,-0x4(%rbp)
jle    1139 <n2c+0x39>
mov    $0x2e,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <n2c+0x45>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
add    $0x61,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<n2c>:
mov    %edi,%eax
cmp    $0x60,%edi
jg     110e <n2c+0xe>
and    $0x1f,%eax
add    $0x41,%eax
ret
mov    %eax,%ecx
and    $0x1f,%ecx
add    $0x61,%ecx
cmp    $0x7b,%eax
mov    $0x2e,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @n2c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 97
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = and i32 %6, 31
%8 = add nsw i32 65, %7
br label %19
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 122
br i1 %11, label %12, label %13
12: ; preds = %9
br label %17
13: ; preds = %9
%14 = load i32, i32* %2
%15 = and i32 %14, 31
%16 = add nsw i32 97, %15
br label %17
17: ; preds = %13, %12
%18 = phi i32 [ 46, %12 ], [ %16, %13 ]
br label %19
19: ; preds = %17, %5
%20 = phi i32 [ %8, %5 ], [ %18, %17 ]
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define zeroext i8 @n2c(i32 %0) {
%2 = icmp slt i32 %0, 97
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = and i32 %0, 31
%5 = add nuw nsw i32 %4, 65
br label %11
6: ; preds = %1
%7 = icmp ugt i32 %0, 122
%8 = and i32 %0, 31
%9 = add nuw nsw i32 %8, 97
%10 = select i1 %7, i32 46, i32 %9
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ %5, %3 ], [ %10, %6 ]
%13 = trunc i32 %12 to i8
ret i8 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ add_loop(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sign_of_sum(int /*<<< orphan*/, int /*<<< orphan*/);
int64_t compare_sum(int64_t x, int64_t y, int64_t z) {
  return sign_of_sum(-x, add_loop(y, z));
}


x86 assembly (clang, -O0):
<compare_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <add_loop@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <sign_of_sum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_sum>:
push   %rbx
mov    %edi,%ebx
neg    %ebx
mov    %esi,%edi
mov    %edx,%esi
call   1040 <add_loop@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <sign_of_sum@plt>

LLVM IR (-O0):
define i32 @compare_sum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @add_loop(i32 %9, i32 %10)
%12 = call i32 @sign_of_sum(i32 %8, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare_sum(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 0, %0
%5 = tail call i32 @add_loop(i32 %1, i32 %2)
%6 = tail call i32 @sign_of_sum(i32 %4, i32 %5)
ret i32 %6
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
extern int isdir(const char *fn) {
  struct stat buf;
  return (stat(fn, &buf) ? 0 : S_ISDIR(buf.st_mode));
}


x86 assembly (clang, -O0):
<isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114d <isdir+0x2d>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <isdir+0x38>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <isdir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isdir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISDIR(i32 %10)
br label %12
12: ; preds = %8, %7
%13 = phi i32 [ 0, %7 ], [ %11, %8 ]
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isdir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
bool compareElement(int fstArg, int sndArg) {
  if (fstArg == sndArg)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<compareElement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <compareElement+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <compareElement+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareElement>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @compareElement(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void hal_system_clock_start(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_system_clock_start() {
ret void
}
/* Variables and functions */
scalar_t__ getoloc(int);
int getword(scalar_t__);
int getofield(int obj, int off) { return (getword(getoloc(obj) + off)); }


x86 assembly (clang, -O0):
<getofield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getoloc@plt>
mov    %rax,%rdi
movslq -0x8(%rbp),%rax
add    %rax,%rdi
call   1030 <getword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getofield>:
push   %rbx
mov    %esi,%ebx
call   1040 <getoloc@plt>
movslq %ebx,%rdi
add    %rax,%rdi
pop    %rbx
jmp    1030 <getword@plt>

LLVM IR (-O0):
define i32 @getofield(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 = call i64 @getoloc(i32 %5)
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
%10 = call i32 @getword(i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @getofield(i32 %0, i32 %1) {
%3 = tail call i64 @getoloc(i32 %0)
%4 = sext i32 %1 to i64
%5 = add nsw i64 %3, %4
%6 = tail call i32 @getword(i64 %5)
ret i32 %6
}
void cttestsegfault() {
  return;
  *(volatile int *)0 = 0;
}


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

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

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

LLVM IR (-O2):
define void @cttestsegfault() {
ret void
}
float Float__MINUS_(float x, float y) { return x - y; }


x86 assembly (clang, -O0):
<Float__MINUS_>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float__MINUS_>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Float__MINUS_(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @Float__MINUS_(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void cleanup_trace_log_file(char *log_filename, FILE *logfp) {
  if ((log_filename) && (logfp)) {
    fflush(logfp);
    fclose(logfp);
  }
  log_filename = NULL;
  return;
}


x86 assembly (clang, -O0):
<cleanup_trace_log_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <cleanup_trace_log_file+0x38>
cmpq   $0x0,-0x10(%rbp)
je     1158 <cleanup_trace_log_file+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_trace_log_file>:
push   %rbx
test   %rdi,%rdi
je     113f <cleanup_trace_log_file+0x1f>
mov    %rsi,%rbx
test   %rsi,%rsi
je     113f <cleanup_trace_log_file+0x1f>
mov    %rbx,%rdi
call   1040 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @cleanup_trace_log_file(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = call i32 @fflush(i32* %11)
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
br label %15
15: ; preds = %10, %7, %2
store i8* null, i8** %3
ret void
}

LLVM IR (-O2):
define void @cleanup_trace_log_file(i8* readnone %0, i32* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @fflush(i32* %1)
%8 = tail call i32 @fclose(i32* %1)
br label %9
9: ; preds = %6, %2
ret void
}
/* Variables and functions */
size_t stdc_2F45D39C(char const *);
size_t strlen(const char *str) { return stdc_2F45D39C(str); }


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

x86 assembly (clang, -O2):
<strlen>:
jmp    1030 <stdc_2F45D39C@plt>

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @stdc_2F45D39C(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
%2 = tail call i64 @stdc_2F45D39C(i8* %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setgid(int /*<<< orphan*/);
int pthread_setgid_np(gid_t gid) { return setgid(gid); }


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

x86 assembly (clang, -O2):
<pthread_setgid_np>:
jmp    1030 <setgid@plt>

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

LLVM IR (-O2):
define i32 @pthread_setgid_np(i32 %0) {
%2 = tail call i32 @setgid(i32 %0)
ret i32 %2
}
/* Variables and functions */
double __ocml_hypot_f64(double, double);
double hypot(double x, double y) { return __ocml_hypot_f64(x, y); }


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

x86 assembly (clang, -O2):
<hypot>:
jmp    1030 <__ocml_hypot_f64@plt>

LLVM IR (-O0):
define double @hypot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_hypot_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @hypot(double %0, double %1) {
%3 = tail call double @__ocml_hypot_f64(double %0, double %1)
ret double %3
}
/* Variables and functions */
unsigned int cpuid_eax(int /*<<< orphan*/);
unsigned int cpuid_max(void) { return cpuid_eax(0); }


x86 assembly (clang, -O0):
<cpuid_max>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <cpuid_eax@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_max>:
xor    %edi,%edi
jmp    1030 <cpuid_eax@plt>

LLVM IR (-O0):
define i32 @cpuid_max() {
%1 = call i32 @cpuid_eax(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @cpuid_max() {
%1 = tail call i32 @cpuid_eax(i32 0)
ret i32 %1
}
int main() {
  int i = 0;
  while (i < 10) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xa,%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 = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
float FastInverseSqrt(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759df - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


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

x86 assembly (clang, -O2):
<FastInverseSqrt>:
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):
define float @FastInverseSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463007, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @FastInverseSqrt(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
}
int main() { return sizeof(unsigned short); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ unsetenv(char const *);
int xunsetenv(const char *name) {
  unsetenv(name);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @xunsetenv(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret i32 0
}
__attribute__((__unused__)) int PyMPI_UNAVAILABLE(const char *name, ...) {
  (void)name;
  return (-1431655766);
}


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

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

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

LLVM IR (-O2):
define i32 @PyMPI_UNAVAILABLE(i8* nocapture readnone %0, ...) {
ret i32 -1431655766
}
int irc_isdigit(int c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<irc_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <irc_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @irc_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void Byt_BS_TYPE_dummy__() { ; }


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

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

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

LLVM IR (-O2):
define void @Byt_BS_TYPE_dummy__() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
int get_XKeyPressedEvent_x(void *_p) {
  return (int)((XKeyPressedEvent *)_p)->x;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XKeyPressedEvent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XKeyPressedEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cm_acronym_or_abbr(int, int /*<<< orphan*/);
void cm_acronym(int arg) { cm_acronym_or_abbr(arg, 0); }


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

x86 assembly (clang, -O2):
<cm_acronym>:
xor    %esi,%esi
jmp    1030 <cm_acronym_or_abbr@plt>

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

LLVM IR (-O2):
define void @cm_acronym(i32 %0) {
%2 = tail call i32 @cm_acronym_or_abbr(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
void usage() { err(EX_USAGE, "connect [-p port]\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <err@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <err@plt>

LLVM IR (-O0):
@EX_USAGE = global i32 0
@.str = [19 x i8] c"connect [-p port]\0A\00"
define void @usage() {
%1 = load i32, i32* @EX_USAGE
%2 = call i32 @err(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EX_USAGE = global i32 0
@.str = [19 x i8] c"connect [-p port]\0A\00"
define void @usage() {
%1 = load i32, i32* @EX_USAGE
%2 = tail call i32 @err(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(double);
void math_sqrt(void) {
  double d = luaL_check_number(1);
  lua_pushnumber(sqrt(d));
}


x86 assembly (clang, -O0):
<math_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_sqrt>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
call   1050 <sqrt@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_sqrt() {
%1 = alloca double
%2 = call double @luaL_check_number(i32 1)
store double %2, double* %1
%3 = load double, double* %1
%4 = call i32 @sqrt(double %3)
%5 = call i32 @lua_pushnumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @math_sqrt() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = tail call i32 @sqrt(double %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void header(void) {
  printf("CCExtractor v0.34, cfsmp3 at gmail\n");
  printf("----------------------------------\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"CCExtractor v0.34, cfsmp3 at gmail\0A\00"
@.str.1 = [36 x i8] c"----------------------------------\0A\00"
define void @header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"CCExtractor v0.34, cfsmp3 at gmail\00"
@str.2 = [35 x i8] c"----------------------------------\00"
define void @header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 0;
  int a = 1;
  int b = 2;
  int c;
  printf("%d\n", c = a++ + b);
  ++i + ++i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
add    -0x10(%rbp),%esi
mov    %esi,-0x14(%rbp)
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Zdravo, kako si?\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Zdravo, kako si?\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = 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"Zdravo, kako si?\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double ceil(double);
double floor(double);
double round(double x) {
  if (x >= 0.0)
    return floor(x + 0.5);
  else
    return ceil(x - 0.5);
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115b <round+0x3b>
movsd  0xeb9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <round+0x56>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1137 <round+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1030 <ceil@plt>
addsd  0xec1(%rip),%xmm0
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = call double @llvm.floor.f64(double %8)
store double %9, double* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fsub double %11, 5.000000e-01
%13 = call double @llvm.ceil.f64(double %12)
store double %13, double* %2
br label %14
14: ; preds = %10, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call double @llvm.floor.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call double @llvm.ceil.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
/* Variables and functions */
int _mul(int);
int mul(int bar) { return _mul(bar); }


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

x86 assembly (clang, -O2):
<mul>:
jmp    1030 <_mul@plt>

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

LLVM IR (-O2):
define i32 @mul(i32 %0) {
%2 = tail call i32 @_mul(i32 %0)
ret i32 %2
}
int leapyear(int yy) {
  if (yy % 4 != 0)
    return 0;
  if (yy % 400 == 0)
    return 1;
  if (yy % 100 == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <leapyear+0x27>
movl   $0x0,-0x4(%rbp)
jmp    116e <leapyear+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <leapyear+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <leapyear+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <leapyear+0x67>
movl   $0x0,-0x4(%rbp)
jmp    116e <leapyear+0x6e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <leapyear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1130 <leapyear+0x30>
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @leapyear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 400
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 100
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %2
br label %19
18: ; preds = %13
store i32 1, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _plibc_syscall(int /*<<< orphan*/, int, void *, size_t);
ssize_t read(int fd, void *buf, size_t count) {
  return _plibc_syscall(0, fd, buf, count);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <_plibc_syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <_plibc_syscall@plt>

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @_plibc_syscall(i32 0, i32 %0, i8* %1, i64 %2)
ret i32 %4
}
const char *of_prop_next_string(struct property *prop, const char *cur) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.property = type opaque
define i8* @of_prop_next_string(%struct.property* %0, i8* %1) {
%3 = alloca %struct.property*
%4 = alloca i8*
store %struct.property* %0, %struct.property** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
%struct.property = type opaque
define noalias i8* @of_prop_next_string(%struct.property* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  do {
    int t = 2;
    printf("%d\n", t);
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0
store i32 2, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ gen_lockfile_name(char *, char *, char *);
int open(char *, int /*<<< orphan*/);
int facility_active(char *tagfile, char *iface) {
  int fd;
  char lockfile[64];
  gen_lockfile_name(tagfile, iface, lockfile);
  fd = open(lockfile, O_RDONLY);
  if (fd < 0)
    return 0;
  else {
    close(fd);
    return 1;
  }
}


x86 assembly (clang, -O0):
<facility_active>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1050 <gen_lockfile_name@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    117c <facility_active+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    118b <facility_active+0x5b>
mov    -0x1c(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<facility_active>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1050 <gen_lockfile_name@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <open@plt>
test   %eax,%eax
js     1163 <facility_active+0x33>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
jmp    1165 <facility_active+0x35>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @facility_active(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [64 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%11 = call i32 @gen_lockfile_name(i8* %8, i8* %9, i8* %10)
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* @O_RDONLY
%14 = call i32 @open(i8* %12, i32 %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %21
18: ; preds = %2
%19 = load i32, i32* %6
%20 = call i32 @close(i32 %19)
store i32 1, i32* %3
br label %21
21: ; preds = %18, %17
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @facility_active(i8* %0, i8* %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @gen_lockfile_name(i8* %0, i8* %1, i8* %4)
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %4, i32 %6)
%8 = icmp slt i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @close(i32 %7)
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %12
}
int sprec() { return 0; }


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

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

LLVM IR (-O0):
define i32 @sprec() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sprec() {
ret i32 0
}
void test___atomic_fetch_add_0(char *mem) { __atomic_fetch_add(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_add_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%al
lock xadd %al,(%rcx)
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_add_0>:
lock addb $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_fetch_add_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw add i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_add_0(i8* nocapture %0) {
%2 = atomicrmw add i8* %0, i8 1 acq_rel
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void compute_checksum(uint8_t bytes[3], uint8_t sum[2]) {
  uint8_t first_sum = 0;
  uint8_t second_sum = 0;
  for (int i = 0; i < 3; i++) {
    first_sum += bytes[i];
    second_sum += first_sum;
  }
  sum[0] = first_sum;
  sum[1] = second_sum;
}


x86 assembly (clang, -O0):
<compute_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    115b <compute_checksum+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1123 <compute_checksum+0x23>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_checksum>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
add    %rax,%rcx
add    %rcx,%rax
add    0x10(%rdi),%rcx
add    %rcx,%rax
mov    %rcx,(%rsi)
mov    %rax,0x8(%rsi)
ret

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

LLVM IR (-O2):
define void @compute_checksum(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = add nsw i64 %5, %3
%7 = add nsw i64 %6, %3
%8 = getelementptr inbounds i64, i64* %0, i64 2
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %6
%11 = add nsw i64 %10, %7
store i64 %10, i64* %1
%12 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %11, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *, char const *, char *);
char *strerror(int /*<<< orphan*/);
void errorm(const char *error_msg) {
  printf("%s: %s  %s\n", "[\033[31mERROR\033[0m]", error_msg, strerror(errno));
}


x86 assembly (clang, -O0):
<errorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xeb0(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorm>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
lea    0xecc(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s: %s %s\0A\00"
@.str.1 = [17 x i8] c"[\1B[31mERROR\1B[0m]\00"
@errno = global i32 0
define void @errorm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s: %s %s\0A\00"
@.str.1 = [17 x i8] c"[\1B[31mERROR\1B[0m]\00"
@errno = global i32 0
define void @errorm(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mostra_vetor(int *vetor, int tamanho_do_vetor) {
  int i;
  for (i = 0; i < tamanho_do_vetor; i++) {
    printf("%d\n", vetor[i]);
  }
}


x86 assembly (clang, -O0):
<mostra_vetor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <mostra_vetor+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <mostra_vetor+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostra_vetor>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <mostra_vetor+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <mostra_vetor+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @mostra_vetor(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}