xunge/DecIR huggingface dataset:
int sum_array(int my_array[]) {
  int total = 0;
  int i;
  for (i = 0; i < 10; i++) {
    total = total + my_array[i];
  }
  return (total);
}


x86 assembly (clang, -O0):
<sum_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    113f <sum_array+0x3f>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <sum_array+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_array>:
movdqu 0x8(%rdi),%xmm0
movdqu 0x18(%rdi),%xmm1
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
add    0x4(%rdi),%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sum_array(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = bitcast i32* %5 to <8 x i32>*
%7 = load <8 x i32>, <8 x i32>* %6
%8 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %7)
%9 = add nsw i32 %8, %4
%10 = add nsw i32 %9, %2
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage:\n\tiau2wkt naifcodes_radii_m_wAsteroids_IAU2000.csv "
         "outputFileName.wtk\n");
}


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

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

LLVM IR (-O0):
@.str = [77 x i8] c"usage:\0A\09iau2wkt naifcodes_radii_m_wAsteroids_IAU2000.csv outputFileName.wtk\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [76 x i8] c"usage:\0A\09iau2wkt naifcodes_radii_m_wAsteroids_IAU2000.csv outputFileName.wtk\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
ret void
}
void single_release(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<single_release>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<single_release>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.single_release = [15 x i8] c"single_release\00"
define void @single_release() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.single_release, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.single_release = [15 x i8] c"single_release\00"
define void @single_release() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.single_release, i64 0, i64 0))
ret void
}
/* Type definitions */
struct itimerval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _setitimer(int which, const struct itimerval *value,
               struct itimerval *ovalue) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_setitimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setitimer>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2) {
%4 = alloca i32
%5 = alloca %struct.itimerval*
%6 = alloca %struct.itimerval*
store i32 %0, i32* %4
store %struct.itimerval* %1, %struct.itimerval** %5
store %struct.itimerval* %2, %struct.itimerval** %6
%7 = load i32, i32* @ENOTSUP
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_setitimer(i32 %0, %struct.itimerval* nocapture readnone %1, %struct.itimerval* nocapture readnone %2) {
%4 = load i32, i32* @ENOTSUP
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT0_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT0_IRQHandler(void) {
  GPIO1_INT0_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @GPIO1_INT0_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT0_DriverIRQHandler()
ret void
}
/* Type definitions */
struct DSPObject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct DSPObject *);
void dsp_sampled_instr_dispose(struct DSPObject *obj) {
  if (obj)
    free(obj);
}


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

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

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

LLVM IR (-O2):
%struct.DSPObject = type { i32 }
define void @dsp_sampled_instr_dispose(%struct.DSPObject* %0) {
%2 = icmp eq %struct.DSPObject* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.DSPObject* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ author();
int /*<<< orphan*/ description();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ options();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usage();
int /*<<< orphan*/ version();
void help() {
  fprintf(stdout, "\x1b[34m"
                  "J S O N C A T \n\n"
                  "\x1b[0m");
  usage();
  description();
  options();
  author();
  version();
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1070 <usage@plt>
mov    $0x0,%al
call   1080 <description@plt>
mov    $0x0,%al
call   1030 <options@plt>
mov    $0x0,%al
call   1060 <author@plt>
mov    $0x0,%al
call   1050 <version@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1070 <usage@plt>
xor    %eax,%eax
call   1080 <description@plt>
xor    %eax,%eax
call   1030 <options@plt>
xor    %eax,%eax
call   1060 <author@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <version@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [26 x i8] c"\1B[34mJ S O N C A T \0A\0A\1B[0m\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @usage()
%4 = call i32 (...) @description()
%5 = call i32 (...) @options()
%6 = call i32 (...) @author()
%7 = call i32 (...) @version()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [26 x i8] c"\1B[34mJ S O N C A T \0A\0A\1B[0m\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @usage()
%4 = tail call i32 (...) @description()
%5 = tail call i32 (...) @options()
%6 = tail call i32 (...) @author()
%7 = tail call i32 (...) @version()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_pointers();
void setup_indexing(void) { setup_pointers(); }


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

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

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

LLVM IR (-O2):
define void @setup_indexing() {
%1 = tail call i32 (...) @setup_pointers()
ret void
}
/* Variables and functions */
scalar_t__ hl_math_fround(double);
int hl_math_round(double d) { return (int)hl_math_fround(d); }


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

x86 assembly (clang, -O2):
<hl_math_round>:
jmp    1030 <hl_math_fround@plt>

LLVM IR (-O0):
define i32 @hl_math_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @hl_math_fround(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @hl_math_round(double %0) {
%2 = tail call i64 @hl_math_fround(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
double KMtoM(double KM) { return KM / 1000; }


x86 assembly (clang, -O0):
<KMtoM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<KMtoM>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @KMtoM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @KMtoM(double %0) {
%2 = fdiv double %0, 1.000000e+03
ret double %2
}
void work(a) int *a;
{ *a += 1; }


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @work(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
int do_aa(int x) { return x * x * 5; }


x86 assembly (clang, -O0):
<do_aa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   $0x5,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_aa>:
imul   %edi,%edi
lea    (%rdi,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @do_aa(i32 %0) {
%2 = mul i32 %0, 5
%3 = mul i32 %2, %0
ret i32 %3
}
int get(int num, int m) {
  int ret = 0;
  do {
    if (num % 10 == m)
      ++ret;
  } while (num /= 10);
  return ret;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%edx
jne    112e <get+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <get+0x33>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1111 <get+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%r9
imul   $0x66666667,%r9,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%r8d
mov    %r9d,%edx
sub    %r8d,%edx
xor    %ecx,%ecx
cmp    %esi,%edx
sete   %cl
add    %ecx,%eax
add    $0x9,%r9d
cmp    $0x12,%r9d
ja     1110 <get+0x10>
ret

LLVM IR (-O0):
define i32 @get(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 = %15, %2
%7 = load i32, i32* %3
%8 = srem i32 %7, 10
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %6
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 10
store i32 %17, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %6, label %19
19: ; preds = %15
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @get(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %10, %3 ]
%5 = phi i32 [ 0, %2 ], [ %9, %3 ]
%6 = srem i32 %4, 10
%7 = icmp eq i32 %6, %1
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %5, %8
%10 = sdiv i32 %4, 10
%11 = add i32 %4, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3
ret i32 %9
}
void foo161() {}


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

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

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

LLVM IR (-O2):
define void @foo161() {
ret void
}
/* Variables and functions */
scalar_t__ sensors_read_line(char *, int, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int system_get_cpu_gov(int cpu, int max, char *out) {
  char filename[128];
  sprintf(filename, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor",
          cpu);
  if (sensors_read_line(filename, max, out) <= 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<system_get_cpu_gov>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <sensors_read_line@plt>
cmp    $0x0,%rax
jg     1174 <system_get_cpu_gov+0x54>
movl   $0x0,-0x4(%rbp)
jmp    117b <system_get_cpu_gov+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_get_cpu_gov>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%edx
lea    0xec7(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <sensors_read_line@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [55 x i8] c"/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor\00"
define i32 @system_get_cpu_gov(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca [128 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%10 = load i32, i32* %5
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = call i64 @sensors_read_line(i8* %12, i32 %13, i8* %14)
%16 = icmp sle i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 0, i32* %4
br label %19
18: ; preds = %3
store i32 1, i32* %4
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [55 x i8] c"/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor\00"
define i32 @system_get_cpu_gov(i32 %0, i32 %1, i8* %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i64 @sensors_read_line(i8* %5, i32 %1, i8* %2)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
iswhite(char c) {
  if (c == ' ' || c == '\t')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1124 <iswhite+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1130 <iswhite+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <iswhite+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @iswhite(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cpi_fatalf(char *, char const *, char const *);
__attribute__((visibility("hidden"))) void
cpi_fatal_null_arg(const char *arg, const char *func) {
  cpi_fatalf(("Argument %s has illegal NULL value in call to function %s."),
             arg, func);
}


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

x86 assembly (clang, -O2):
<cpi_fatal_null_arg>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <cpi_fatalf@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Argument %s has illegal NULL value in call to function %s.\00"
define hidden void @cpi_fatal_null_arg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @cpi_fatalf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"Argument %s has illegal NULL value in call to function %s.\00"
define hidden void @cpi_fatal_null_arg(i8* %0, i8* %1) {
%3 = tail call i32 @cpi_fatalf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int u_long;

/* Variables and functions */
u_long *IP_host_addresses() {
  static u_long addresses[3] = {0x0100007F, 0x0D0C0B0A, 0};
  return addresses;
}


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

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

LLVM IR (-O0):
@IP_host_addresses.addresses = internal global [3 x i32] [i32 16777343, i32 218893066, i32 0]
define i32* @IP_host_addresses() {
ret i32* getelementptr inbounds ([3 x i32], [3 x i32]* @IP_host_addresses.addresses, i64 0, i64 0)
}

LLVM IR (-O2):
@IP_host_addresses.addresses = internal global [3 x i32] [i32 16777343, i32 218893066, i32 0]
define i32* @IP_host_addresses() {
ret i32* getelementptr inbounds ([3 x i32], [3 x i32]* @IP_host_addresses.addresses, i64 0, i64 0)
}
strcopy(a, b) char *a, *b;
{
  while (*a++ = *b++)
    ;
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strcopy+0x3b>
jmp    110c <strcopy+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcopy+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcopy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 undef
}
/* Type definitions */
struct rlimit {
  int /*<<< orphan*/ rlim_max;
  int /*<<< orphan*/ rlim_cur;
};
typedef int /*<<< orphan*/ rlim_t;

/* Variables and functions */
scalar_t__ setrlimit(int, struct rlimit const *);
int /*<<< orphan*/ xerror(char *);
void xsetrlimit(int resource, rlim_t rlim) {
  const struct rlimit buf = {
      .rlim_cur = rlim,
      .rlim_max = rlim,
  };
  if (setrlimit(resource, &buf) != 0)
    xerror("setrlimit");
}


x86 assembly (clang, -O0):
<xsetrlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <setrlimit@plt>
cmp    $0x0,%rax
je     115c <xsetrlimit+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <xerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsetrlimit>:
push   %rax
mov    %esi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rsi
call   1040 <setrlimit@plt>
test   %rax,%rax
je     1141 <xsetrlimit+0x21>
lea    0xec4(%rip),%rdi
call   1030 <xerror@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@.str = [10 x i8] c"setrlimit\00"
define void @xsetrlimit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.rlimit
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 0
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %5, i32 0, i32 1
%9 = load i32, i32* %4
store i32 %9, i32* %8
%10 = load i32, i32* %3
%11 = call i64 @setrlimit(i32 %10, %struct.rlimit* %5)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @xerror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@.str = [10 x i8] c"setrlimit\00"
define void @xsetrlimit(i32 %0, i32 %1) {
%3 = alloca %struct.rlimit
%4 = bitcast %struct.rlimit* %3 to i8*
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i64 @setrlimit(i32 %0, %struct.rlimit* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @xerror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}
void frontb_(n) int *n;
{ frontbuffer(*n); }


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

x86 assembly (clang, -O2):
<frontb_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <frontbuffer@plt>

LLVM IR (-O0):
define void @frontb_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @frontbuffer to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @frontb_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @frontbuffer to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SHAMD5IntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(0x44030000 + 0x0000081C))) =
      ((ui32IntFlags & 0x00070000) >> 16);
}


x86 assembly (clang, -O0):
<SHAMD5IntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x70000,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    $0x4403081c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5IntClear>:
shr    $0x10,%esi
and    $0x7,%esi
mov    %rsi,0x4403081c
44
ret

LLVM IR (-O0):
define void @SHAMD5IntClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 458752
%7 = ashr i32 %6, 16
%8 = sext i32 %7 to i64
store volatile i64 %8, i64* inttoptr (i64 1141049372 to i64*)
ret void
}

LLVM IR (-O2):
define void @SHAMD5IntClear(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 7
%5 = zext i32 %4 to i64
store volatile i64 %5, i64* inttoptr (i64 1141049372 to i64*)
ret void
}
/* Variables and functions */
char *rindex(char *, char);
char *get_program_name(char *prog) {
  char *basename = rindex(prog, '/');
  if (basename)
    return basename + 1;
  else
    return prog;
}


x86 assembly (clang, -O0):
<get_program_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <rindex@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <get_program_name+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <get_program_name+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_program_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <rindex@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_program_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @rindex(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @get_program_name(i8* %0) {
%2 = tail call i8* @rindex(i8* %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int SIGALRM;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ comment(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void handler_parent(int sig) {
  if (sig == SIGALRM) {
    comment("==>   PARENT: in handler for SIGALRM");
  } else {
    comment("==>   PARENT: in handler: unexpected signal");
    kill(0, SIGKILL);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<handler_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    115e <handler_parent+0x2e>
lea    0xeac(%rip),%rdi
call   1030 <comment@plt>
jmp    1184 <handler_parent+0x54>
lea    0xec0(%rip),%rdi
call   1030 <comment@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <kill@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler_parent>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
jne    1149 <handler_parent+0x19>
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1030 <comment@plt>
lea    0xed5(%rip),%rdi
call   1030 <comment@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <kill@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@.str = [37 x i8] c"==> PARENT: in handler for SIGALRM\00"
@.str.1 = [44 x i8] c"==> PARENT: in handler: unexpected signal\00"
@SIGKILL = global i32 0
define void @handler_parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGALRM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @comment(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %13
8: ; preds = %1
%9 = call i32 @comment(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @SIGKILL
%11 = call i32 @kill(i32 0, i32 %10)
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %6
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@.str = [37 x i8] c"==> PARENT: in handler for SIGALRM\00"
@.str.1 = [44 x i8] c"==> PARENT: in handler: unexpected signal\00"
@SIGKILL = global i32 0
define void @handler_parent(i32 %0) {
%2 = load i32, i32* @SIGALRM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @comment(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
6: ; preds = %1
%7 = tail call i32 @comment(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @SIGKILL
%9 = tail call i32 @kill(i32 0, i32 %8)
%10 = tail call i32 @exit(i32 -1)
unreachable
}
falListFonts() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @falListFonts() {
ret i32 0
}
int bar(int x) {
  int a;
  int *p = &a;
#pragma omp parallel
#pragma omp single
#pragma omp taskloop lastprivate(a)
  for (a = 0; a < x; ++a)
    ;
  return *p;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1135 <bar+0x35>
jmp    1127 <bar+0x27>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1116 <bar+0x16>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("hello world in almost invented language!! aa"); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"hello world in almost invented language!! aa\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"hello world in almost invented language!! aa\00"
define void @foo() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool nrf52_errata_117(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_117() {
ret i32 0
}
void test3(char *P) { struct B *b = (struct B *)P; }


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

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

LLVM IR (-O0):
%struct.B = type opaque
define void @test3(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.B*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.B*
store %struct.B* %5, %struct.B** %3
ret void
}

LLVM IR (-O2):
define void @test3(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _info_print(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_hard_handler(int signum) {
  _info_print(("Forcing shutdown"));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<signal_hard_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <_info_print@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_hard_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <_info_print@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Forcing shutdown\00"
@EXIT_FAILURE = global i32 0
define void @signal_hard_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_info_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Forcing shutdown\00"
@EXIT_FAILURE = global i32 0
define void @signal_hard_handler(i32 %0) {
%2 = tail call i32 @_info_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void rgbGenClean(struct LSD_SceneNodeInst const *inst, void *instData) {}


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

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

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

LLVM IR (-O2):
%struct.LSD_SceneNodeInst = type opaque
define void @rgbGenClean(%struct.LSD_SceneNodeInst* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void printCurrentDirectory() {
  char buf[1000];
  printf("Current directory is %s\n", getcwd(buf, 1000));
}


x86 assembly (clang, -O0):
<printCurrentDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getcwd@plt>
mov    %rax,%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCurrentDirectory>:
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getcwd@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x3e8,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Current directory is %s\0A\00"
define void @printCurrentDirectory() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i8* @getcwd(i8* %2, i32 1000)
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Current directory is %s\0A\00"
define void @printCurrentDirectory() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i8* @getcwd(i8* %2, i32 1000)
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
char *find_and_terminate(char *, char);
char *find_path(char *str) { return find_and_terminate(str, '/'); }


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

x86 assembly (clang, -O2):
<find_path>:
mov    $0x2f,%esi
jmp    1030 <find_and_terminate@plt>

LLVM IR (-O0):
define i8* @find_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @find_and_terminate(i8* %3, i8 signext 47)
ret i8* %4
}

LLVM IR (-O2):
define i8* @find_path(i8* %0) {
%2 = tail call i8* @find_and_terminate(i8* %0, i8 signext 47)
ret i8* %2
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_ISVTX;
scalar_t__ stat(char *, struct stat *);
int unary_k(char *s) {
  struct stat buf;
  if (stat(s, &buf))
    return 0;
  return S_ISVTX & buf.st_mode;
}


x86 assembly (clang, -O0):
<unary_k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <unary_k+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    114e <unary_k+0x3e>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary_k>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x2ec8(%rip),%rcx
mov    (%rsp),%edx
and    (%rcx),%edx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_ISVTX = global i32 0
define i32 @unary_k(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
%6 = load i32, i32* @S_ISVTX
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = and i32 %8, %6
%10 = select i1 %5, i32 %9, i32 0
ret i32 %10
}
float *vec3_negative(float *result, float *a) {
  result[0] = -a[0];
  result[1] = -a[1];
  result[2] = -a[2];
  return result;
}


x86 assembly (clang, -O0):
<vec3_negative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_negative>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movaps 0xef2(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define float* @vec3_negative(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret float* %0
}
void REMR3NotifyDmaPending(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3NotifyDmaPending() {
ret void
}
void _Block_retain_object_default(const void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @_Block_retain_object_default(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned char, int);
int /*<<< orphan*/ print_reg(int);
void setup_func(unsigned char func) {
  outb(0x07, 0x2e);
  outb(func, 0x2f);
  print_reg(0x30);
  print_reg(0x60);
  print_reg(0x61);
  print_reg(0x62);
  print_reg(0x63);
  print_reg(0x70);
  print_reg(0x71);
  print_reg(0x74);
  print_reg(0x75);
  return;
}


x86 assembly (clang, -O0):
<setup_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7,%edi
mov    $0x2e,%esi
call   1040 <outb@plt>
mov    $0x2f,%esi
movzbl -0x1(%rbp),%edi
call   1040 <outb@plt>
mov    $0x30,%edi
call   1030 <print_reg@plt>
mov    $0x60,%edi
call   1030 <print_reg@plt>
mov    $0x61,%edi
call   1030 <print_reg@plt>
mov    $0x62,%edi
call   1030 <print_reg@plt>
mov    $0x63,%edi
call   1030 <print_reg@plt>
mov    $0x70,%edi
call   1030 <print_reg@plt>
mov    $0x71,%edi
call   1030 <print_reg@plt>
mov    $0x74,%edi
call   1030 <print_reg@plt>
mov    $0x75,%edi
call   1030 <print_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_func>:
push   %rbx
mov    %edi,%ebx
mov    $0x7,%edi
mov    $0x2e,%esi
call   1040 <outb@plt>
mov    %ebx,%edi
mov    $0x2f,%esi
call   1040 <outb@plt>
mov    $0x30,%edi
call   1030 <print_reg@plt>
mov    $0x60,%edi
call   1030 <print_reg@plt>
mov    $0x61,%edi
call   1030 <print_reg@plt>
mov    $0x62,%edi
call   1030 <print_reg@plt>
mov    $0x63,%edi
call   1030 <print_reg@plt>
mov    $0x70,%edi
call   1030 <print_reg@plt>
mov    $0x71,%edi
call   1030 <print_reg@plt>
mov    $0x74,%edi
call   1030 <print_reg@plt>
mov    $0x75,%edi
pop    %rbx
jmp    1030 <print_reg@plt>

LLVM IR (-O0):
define void @setup_func(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @outb(i8 zeroext 7, i32 46)
%4 = load i8, i8* %2
%5 = call i32 @outb(i8 zeroext %4, i32 47)
%6 = call i32 @print_reg(i32 48)
%7 = call i32 @print_reg(i32 96)
%8 = call i32 @print_reg(i32 97)
%9 = call i32 @print_reg(i32 98)
%10 = call i32 @print_reg(i32 99)
%11 = call i32 @print_reg(i32 112)
%12 = call i32 @print_reg(i32 113)
%13 = call i32 @print_reg(i32 116)
%14 = call i32 @print_reg(i32 117)
ret void
}

LLVM IR (-O2):
define void @setup_func(i8 zeroext %0) {
%2 = tail call i32 @outb(i8 zeroext 7, i32 46)
%3 = tail call i32 @outb(i8 zeroext %0, i32 47)
%4 = tail call i32 @print_reg(i32 48)
%5 = tail call i32 @print_reg(i32 96)
%6 = tail call i32 @print_reg(i32 97)
%7 = tail call i32 @print_reg(i32 98)
%8 = tail call i32 @print_reg(i32 99)
%9 = tail call i32 @print_reg(i32 112)
%10 = tail call i32 @print_reg(i32 113)
%11 = tail call i32 @print_reg(i32 116)
%12 = tail call i32 @print_reg(i32 117)
ret void
}