xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ getegid();
char *getenv(char const *);
scalar_t__ geteuid();
scalar_t__ getgid();
scalar_t__ getuid();
char *safe_getenv(const char *arg) {
  if ((getuid() != geteuid()) || (getgid() != getegid()))
    return NULL;
  return getenv(arg);
}


x86 assembly (clang, -O0):
<safe_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jne    11a0 <safe_getenv+0x50>
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     11ad <safe_getenv+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    11ba <safe_getenv+0x6a>
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_getenv>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <geteuid@plt>
cmp    %rax,%rbx
jne    1192 <safe_getenv+0x42>
xor    %eax,%eax
call   1060 <getgid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <getegid@plt>
cmp    %rax,%rbx
jne    1192 <safe_getenv+0x42>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <getenv@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @safe_getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @getuid()
%5 = call i64 (...) @geteuid()
%6 = icmp ne i64 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = call i64 (...) @getgid()
%9 = call i64 (...) @getegid()
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8* null, i8** %2
br label %15
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = call i8* @getenv(i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %11
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @safe_getenv(i8* nocapture %0) {
%2 = tail call i64 (...) @getuid()
%3 = tail call i64 (...) @geteuid()
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = tail call i64 (...) @getgid()
%7 = tail call i64 (...) @getegid()
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i8* @getenv(i8* %0)
br label %11
11: ; preds = %1, %5, %9
%12 = phi i8* [ %10, %9 ], [ null, %5 ], [ null, %1 ]
ret i8* %12
}
int shmobile_cpufreq_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @shmobile_cpufreq_init() {
ret i32 0
}
/* Variables and functions */
scalar_t__ getpid();
scalar_t__ gettid();
int pthread_main_np(void) { return getpid() == gettid(); }


x86 assembly (clang, -O0):
<pthread_main_np>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_main_np>:
push   %rbx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <gettid@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pthread_main_np() {
%1 = call i64 (...) @getpid()
%2 = call i64 (...) @gettid()
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @pthread_main_np() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i64 (...) @gettid()
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_4(char *s) { printf("%s", s); }


x86 assembly (clang, -O0):
<print_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_4>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_4(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *hash_plugin_detailed(void) {
  return ("pdf - PDF documents password plugin\n"
          "------------------------------------------------\n"
          "Use this module to crack pdf files\n"
          "Input should be a pdf document file (specified with -f)\n"
          "\nAuthor: Dhiru Kholia <dhiru at openwall.com>\n");
}


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

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

LLVM IR (-O0):
@.str = [223 x i8] c"pdf - PDF documents password plugin\0A------------------------------------------------\0AUse this module to crack pdf files\0AInput should be a pdf document file (specified with -f)\0A\0AAuthor: Dhiru Kholia <dhiru at openwall.com>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [223 x i8] c"pdf - PDF documents password plugin\0A------------------------------------------------\0AUse this module to crack pdf files\0AInput should be a pdf document file (specified with -f)\0A\0AAuthor: Dhiru Kholia <dhiru at openwall.com>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0)
}
void enable_button_interrupt(void) {
  (*(volatile unsigned long *)((0xE002C000))) =
      ((*(volatile unsigned long *)((0xE002C000))) & ~0x30000000) | 0x10000000;
  (*(volatile unsigned long *)(((0xFFFFF000) + 0x010))) = 0x08000;
}


x86 assembly (clang, -O0):
<enable_button_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe002c000,%eax
mov    (%rax),%rcx
and    $0xffffffffcfffffff,%rcx
or     $0x10000000,%rcx
mov    $0xe002c000,%eax
mov    %rcx,(%rax)
mov    $0xfffff010,%eax
movq   $0x8000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_button_interrupt>:
mov    $0xe002c000,%eax
mov    $0xffffffffcfffffff,%rcx
and    (%rax),%rcx
or     $0x10000000,%rcx
mov    %rcx,(%rax)
movq   $0x8000,0x1ffd3010(%rax)
ret

LLVM IR (-O0):
define void @enable_button_interrupt() {
%1 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%2 = and i64 %1, -805306369
%3 = or i64 %2, 268435456
store volatile i64 %3, i64* inttoptr (i64 3758276608 to i64*)
store volatile i64 32768, i64* inttoptr (i64 4294963216 to i64*)
ret void
}

LLVM IR (-O2):
define void @enable_button_interrupt() {
%1 = load volatile i64, i64* inttoptr (i64 3758276608 to i64*)
%2 = and i64 %1, -805306369
%3 = or i64 %2, 268435456
store volatile i64 %3, i64* inttoptr (i64 3758276608 to i64*)
store volatile i64 32768, i64* inttoptr (i64 4294963216 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ analogWrite(int, int /*<<< orphan*/);
void endStop() {
  analogWrite(6, 0);
  analogWrite(5, 0);
}


x86 assembly (clang, -O0):
<endStop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <analogWrite@plt>
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <analogWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endStop>:
push   %rax
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <analogWrite@plt>
mov    $0x5,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <analogWrite@plt>

LLVM IR (-O0):
define void @endStop() {
%1 = call i32 @analogWrite(i32 6, i32 0)
%2 = call i32 @analogWrite(i32 5, i32 0)
ret void
}

LLVM IR (-O2):
define void @endStop() {
%1 = tail call i32 @analogWrite(i32 6, i32 0)
%2 = tail call i32 @analogWrite(i32 5, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkLed(int);
void blinkPass() { blinkLed(4); }


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

x86 assembly (clang, -O2):
<blinkPass>:
mov    $0x4,%edi
jmp    1030 <blinkLed@plt>

LLVM IR (-O0):
define void @blinkPass() {
%1 = call i32 @blinkLed(i32 4)
ret void
}

LLVM IR (-O2):
define void @blinkPass() {
%1 = tail call i32 @blinkLed(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_LogF_init(void) {
  _hmt_register_covercase("HMM_LogF", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_LogF_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HMM_LogF\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LogF_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_LogF\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LogF_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_string_ascii_up() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @lapack_version__() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
/* Variables and functions */
double kappa2(double);
double omega(double);
double Dfunc(double x, double omp, int m) {
  return kappa2(x) - m * m * (omega(x) - omp) * (omega(x) - omp);
}


x86 assembly (clang, -O0):
<Dfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <kappa2@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <omega@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <omega@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dfunc>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <kappa2@plt>
movsd  %xmm0,0x18(%rsp)
imul   %ebx,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <omega@plt>
subsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <omega@plt>
subsd  0x10(%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @Dfunc(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = call double @kappa2(double %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = sitofp i32 %11 to double
%13 = load double, double* %4
%14 = call double @omega(double %13)
%15 = load double, double* %5
%16 = fsub double %14, %15
%17 = fmul double %12, %16
%18 = load double, double* %4
%19 = call double @omega(double %18)
%20 = load double, double* %5
%21 = fsub double %19, %20
%22 = fneg double %17
%23 = call double @llvm.fmuladd.f64(double %22, double %21, double %8)
ret double %23
}

LLVM IR (-O2):
define double @Dfunc(double %0, double %1, i32 %2) {
%4 = tail call double @kappa2(double %0)
%5 = mul nsw i32 %2, %2
%6 = sitofp i32 %5 to double
%7 = tail call double @omega(double %0)
%8 = fsub double %7, %1
%9 = tail call double @omega(double %0)
%10 = fsub double %9, %1
%11 = fneg double %8
%12 = fmul double %6, %11
%13 = tail call double @llvm.fmuladd.f64(double %12, double %10, double %4)
ret double %13
}
void c_pomp_parallel_join_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_parallel_join_(%struct.ompregdescr* nocapture %0) {
ret void
}
void gdk_draw_point() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecSharedInitV() {
ret void
}
/* Variables and functions */
int g(int);
int atop(int i) {
  if (i < 0)
    return g(i);
  else
    return 3;
}


x86 assembly (clang, -O0):
<atop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1135 <atop+0x25>
mov    -0x8(%rbp),%edi
call   1030 <g@plt>
mov    %eax,-0x4(%rbp)
jmp    113c <atop+0x2c>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atop>:
test   %edi,%edi
js     111a <atop+0xa>
mov    $0x3,%eax
ret
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define i32 @atop(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @g(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 3, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void UART_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @UART_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @UART_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_put_format_info() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_put_format_info"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_format_info\0A\00"
define i32 @pa_tagstruct_put_format_info() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_format_info\00"
define i32 @pa_tagstruct_put_format_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void cls() { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @cls() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @cls() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *mesg) {
  perror(mesg);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int isgreater(float f1, float f2) {
  int r = __builtin_isgreater(f1, f2);
  return !r ? -1 : 1;
}


x86 assembly (clang, -O0):
<isgreater>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %dl
xor    $0xff,%dl
mov    $0x1,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgreater>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @isgreater(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fcmp ogt float %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @isgreater(float %0, float %1) {
%3 = fcmp ule float %0, %1
%4 = select i1 %3, i32 -1, i32 1
ret i32 %4
}
int f_eq_cr2(float a1) { return !(((100) == (a1))); }


x86 assembly (clang, -O0):
<f_eq_cr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq_cr2>:
cmpneqss 0xef7(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_eq_cr2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_eq_cr2(float %0) {
%2 = fcmp une float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ trace_initialize();
void trace_init_lib(void) { trace_initialize(); }


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

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

LLVM IR (-O0):
define void @trace_init_lib() {
%1 = call i32 (...) @trace_initialize()
ret void
}

LLVM IR (-O2):
define void @trace_init_lib() {
%1 = tail call i32 (...) @trace_initialize()
ret void
}
int f(int x) {
  if (x > 0) {
  } else {
    x = x - 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1116 <f+0x16>
jmp    111f <f+0x1f>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
xor    %ecx,%ecx
test   %edi,%edi
setle  %cl
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = sext i1 %2 to i32
%4 = add nsw i32 %3, %0
ret i32 %4
}
void null_toggle_mixer_channel() {}


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

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

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

LLVM IR (-O2):
define void @null_toggle_mixer_channel() {
ret void
}
int lstat(const char *path __attribute((unused)),
          struct stat *buf __attribute((unused))) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @lstat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
ret i32 -1
}
int meta_l2c_flush(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @meta_l2c_flush() {
ret i32 1
}

LLVM IR (-O2):
define i32 @meta_l2c_flush() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Toggle();
void BaseStationUartC__Leds__led1Toggle(void) { LedsP__Leds__led1Toggle(); }


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

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

LLVM IR (-O0):
define void @BaseStationUartC__Leds__led1Toggle() {
%1 = call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}

LLVM IR (-O2):
define void @BaseStationUartC__Leds__led1Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}
/* Variables and functions */
bool isPrime(unsigned int i) {
  unsigned int n;
  for (n = 2; n <= i / 2; n++) {
    if (i % n == 0)
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x1,%ecx
cmp    %ecx,%eax
ja     114f <isPrime+0x4f>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    113c <isPrime+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1156 <isPrime+0x56>
jmp    1141 <isPrime+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
cmp    $0x4,%edi
jae    110b <isPrime+0xb>
mov    $0x1,%eax
ret
mov    %edi,%r8d
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%edi
nopl   0x0(%rax)
xor    %ecx,%ecx
mov    %r8d,%eax
xor    %edx,%edx
div    %edi
test   %edx,%edx
je     1145 <isPrime+0x45>
lea    (%rsi,%rdi,1),%eax
add    $0x1,%eax
mov    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,%edi
cmp    $0x1,%eax
jne    1120 <isPrime+0x20>
mov    $0x1,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %8
5: ; preds = %8
%6 = add nuw i32 %9, 1
%7 = icmp eq i32 %9, %4
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = urem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8, %5, %1
%13 = phi i32 [ 1, %1 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int main(void) {
  foo(0, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 0, i32 0)
ret i32 0
}
void Dswap4B(void *val) {
  char *c = (char *)val;
  char a;
  a = c[0];
  c[0] = c[3];
  c[3] = a;
  a = c[1];
  c[1] = c[2];
  c[2] = a;
}


x86 assembly (clang, -O0):
<Dswap4B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dswap4B>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @Dswap4B(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 3
store i8 %14, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
store i8 %19, i8* %4
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %22, i8* %24
%25 = load i8, i8* %4
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @Dswap4B(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy_icub(int nx, int ny, int nz, int ***dest, int ***p) {
  memcpy(**dest, **p, nx * ny * nz * sizeof(int));
}


x86 assembly (clang, -O0):
<copy_icub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_icub>:
mov    (%rcx),%rax
mov    (%rax),%rax
mov    (%r8),%rcx
mov    (%rcx),%rcx
imul   %esi,%edi
imul   %edi,%edx
shl    $0x2,%edx
mov    %rax,%rdi
mov    %rcx,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy_icub(i32 %0, i32 %1, i32 %2, i32*** %3, i32*** %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32***
%10 = alloca i32***
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32*** %3, i32**** %9
store i32*** %4, i32**** %10
%11 = load i32***, i32**** %9
%12 = load i32**, i32*** %11
%13 = load i32*, i32** %12
%14 = load i32***, i32**** %10
%15 = load i32**, i32*** %14
%16 = load i32*, i32** %15
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %8
%21 = mul nsw i32 %19, %20
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 4
%24 = trunc i64 %23 to i32
%25 = call i32 @memcpy(i32* %13, i32* %16, i32 %24)
ret void
}

LLVM IR (-O2):
define void @copy_icub(i32 %0, i32 %1, i32 %2, i32*** nocapture %3, i32*** nocapture %4) {
%6 = load i32**, i32*** %3
%7 = load i32*, i32** %6
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
%10 = shl i32 %0, 2
%11 = mul i32 %10, %1
%12 = mul i32 %11, %2
%13 = tail call i32 @memcpy(i32* %7, i32* %9, i32 %12)
ret void
}
int cos_spd_id() {}


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

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

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

LLVM IR (-O2):
define i32 @cos_spd_id() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ put16(unsigned short);
int /*<<< orphan*/ put8(int);
void xor_ax_imm16(unsigned short imm16) {
  put8(0x66);
  put8(0x35);
  put16(imm16);
}


x86 assembly (clang, -O0):
<xor_ax_imm16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x35,%edi
call   1030 <put8@plt>
movzwl -0x2(%rbp),%edi
call   1040 <put16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_ax_imm16>:
push   %rbx
mov    %edi,%ebx
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x35,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put16@plt>

LLVM IR (-O0):
define void @xor_ax_imm16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @put8(i32 102)
%4 = call i32 @put8(i32 53)
%5 = load i16, i16* %2
%6 = call i32 @put16(i16 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @xor_ax_imm16(i16 zeroext %0) {
%2 = tail call i32 @put8(i32 102)
%3 = tail call i32 @put8(i32 53)
%4 = tail call i32 @put16(i16 zeroext %0)
ret void
}
int sectorSize(char one, char two) {
  char size[1];
  size[0] = two;
  size[1] = one;
  int b = (size[0] << 8) | size[1];
  return b;
}


x86 assembly (clang, -O0):
<sectorSize>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movsbl -0x3(%rbp),%eax
shl    $0x8,%eax
movsbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sectorSize(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [1 x i8]
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i8, i8* %3
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = or i32 %14, %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @sectorSize(i8 signext %0, i8 signext %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void string_free(char *string) {
  if (string) {
    free(string);
  }
}


x86 assembly (clang, -O0):
<string_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <string_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_free>:
test   %rdi,%rdi
je     111a <string_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @string_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @string_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_3Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x3A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Aint64_highword_reg>:
movabs $0x3a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Aint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 58
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_3Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 249108103168
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int strlen(char *);
void string_insert_char(char *string, char symbol, int pos) {
  memmove(string + pos + 1, string + pos, strlen(string) - pos + 1);
  string[pos] = symbol;
}


x86 assembly (clang, -O0):
<string_insert_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
sub    -0x10(%rbp),%edx
add    $0x1,%edx
call   1040 <memmove@plt>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_insert_char>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
movslq %edx,%rbp
lea    (%rdi,%rbp,1),%r15
lea    (%rdi,%rbp,1),%r12
add    $0x1,%r12
call   1030 <strlen@plt>
sub    %ebp,%eax
lea    0x1(%rax),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <memmove@plt>
mov    %r14b,(%rbx,%rbp,1)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @string_insert_char(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8*, i8** %4
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %6
%19 = sub nsw i32 %17, %18
%20 = add nsw i32 %19, 1
%21 = call i32 @memmove(i8* %11, i8* %15, i32 %20)
%22 = load i8, i8* %5
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @string_insert_char(i8* %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i32 @strlen(i8* %0)
%8 = sub i32 1, %2
%9 = add i32 %8, %7
%10 = tail call i32 @memmove(i8* %6, i8* %5, i32 %9)
store i8 %1, i8* %5
ret void
}
char *getStringFromValue(unsigned long val) { return 0; }


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

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

LLVM IR (-O0):
define i8* @getStringFromValue(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @getStringFromValue(i64 %0) {
ret i8* null
}
/* Type definitions */
struct colprintTable {
  int dummy;
};

/* Variables and functions */
struct colprintTable *colprintTableNew(char *, char *, char *, char *, char *,
                                       int /*<<< orphan*/ *);
extern struct colprintTable *roleColprintTableNew(void) {
  return colprintTableNew("L:LANGUAGE", "L:KIND(L/N)", "L:NAME", "L:ENABLED",
                          "L:DESCRIPTION", NULL);
}


x86 assembly (clang, -O0):
<roleColprintTableNew>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xeee(%rip),%rdx
lea    0xeee(%rip),%rcx
lea    0xef1(%rip),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <colprintTableNew@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roleColprintTableNew>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xef2(%rip),%rdx
lea    0xef2(%rip),%rcx
lea    0xef5(%rip),%r8
xor    %r9d,%r9d
jmp    1030 <colprintTableNew@plt>

LLVM IR (-O0):
%struct.colprintTable = type { i32 }
@.str = [11 x i8] c"L:LANGUAGE\00"
@.str.1 = [12 x i8] c"L:KIND(L/N)\00"
@.str.2 = [7 x i8] c"L:NAME\00"
@.str.3 = [10 x i8] c"L:ENABLED\00"
@.str.4 = [14 x i8] c"L:DESCRIPTION\00"
define %struct.colprintTable* @roleColprintTableNew() {
%1 = call %struct.colprintTable* @colprintTableNew(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32* null)
ret %struct.colprintTable* %1
}

LLVM IR (-O2):
%struct.colprintTable = type { i32 }
@.str = [11 x i8] c"L:LANGUAGE\00"
@.str.1 = [12 x i8] c"L:KIND(L/N)\00"
@.str.2 = [7 x i8] c"L:NAME\00"
@.str.3 = [10 x i8] c"L:ENABLED\00"
@.str.4 = [14 x i8] c"L:DESCRIPTION\00"
define %struct.colprintTable* @roleColprintTableNew() {
%1 = tail call %struct.colprintTable* @colprintTableNew(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32* null)
ret %struct.colprintTable* %1
}
/* Variables and functions */
int cu2ho(double *, double *, int);
int ho2qu(double *, double *, int);
int cu2qu(double *cu, double *qu, int p) {
  double ho[3];
  int trash;
  trash = cu2ho(cu, ho, p);
  trash = ho2qu(ho, qu, p);
  return 1;
}


x86 assembly (clang, -O0):
<cu2qu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <cu2ho@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ho2qu@plt>
mov    %eax,-0x34(%rbp)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu2qu>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <cu2ho@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <ho2qu@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @cu2qu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @cu2ho(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ho2qu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @cu2qu(double* %0, double* %1, i32 %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @cu2ho(double* %0, double* %6, i32 %2)
%8 = call i32 @ho2qu(double* %6, double* %1, i32 %2)
ret i32 1
}
unsigned int G(unsigned int X, unsigned int Y, unsigned int Z) {
  return (X & Y) | (X & Z) | (Y & Z);
}


x86 assembly (clang, -O0):
<G>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<G>:
mov    %edx,%eax
or     %esi,%eax
and    %edi,%eax
and    %esi,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @G(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 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = and i32 %10, %11
%13 = or i32 %9, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @G(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %2, %1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
void *memmove(void *, void *, size_t);
void *libc_memmove(void *dest, void *src, size_t n) {
  return memmove(dest, src, n);
}


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

x86 assembly (clang, -O2):
<libc_memmove>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @libc_memmove(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ threads_start();
int main(void) {
  printf("starting threads...\n");
  threads_start();
  printf("all threads exited\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"starting threads...\0A\00"
@.str.1 = [20 x i8] c"all threads exited\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @threads_start()
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"starting threads...\00"
@str.2 = [19 x i8] c"all threads exited\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @threads_start()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}