xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
char *emptyString() {
  char *empty = malloc(sizeof(char));
  empty[0] = '\0';
  return empty;
}


x86 assembly (clang, -O0):
<emptyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyString>:
push   %rax
mov    $0x1,%edi
call   1030 <malloc@plt>
movb   $0x0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @emptyString() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @emptyString() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
store i8 0, i8* %1
ret i8* %1
}
/* Variables and functions */
void *cpu00(int);
void *startcpu(int cpu) { return (cpu00(cpu)); }


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

x86 assembly (clang, -O2):
<startcpu>:
jmp    1030 <cpu00@plt>

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

LLVM IR (-O2):
define i8* @startcpu(i32 %0) {
%2 = tail call i8* @cpu00(i32 %0)
ret i8* %2
}
void TimerHalWaitForL3ClockBeingActive(void) {
  while (!((*((volatile unsigned int *)(((0x44E00000) + 0) + (0xc)))) &
           (0x00000010u)))
    ;
}


x86 assembly (clang, -O0):
<TimerHalWaitForL3ClockBeingActive>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TimerHalWaitForL3ClockBeingActive+0x9>
mov    $0x44e0000c,%eax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <TimerHalWaitForL3ClockBeingActive+0x28>
jmp    112d <TimerHalWaitForL3ClockBeingActive+0x2d>
jmp    1109 <TimerHalWaitForL3ClockBeingActive+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerHalWaitForL3ClockBeingActive>:
testl  $0x10,0x44e0000c
je     1100 <TimerHalWaitForL3ClockBeingActive>
ret

LLVM IR (-O0):
define void @TimerHalWaitForL3ClockBeingActive() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 1155530764 to i32*)
%3 = and i32 %2, 16
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @TimerHalWaitForL3ClockBeingActive() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1155530764 to i32*)
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_entropy_words();
int /*<<< orphan*/ extract_entropy();
__attribute__((always_)) void xfer_secondary_pool(void) {
  extract_entropy();
  add_entropy_words();
}


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

x86 assembly (clang, -O2):
<xfer_secondary_pool>:
push   %rax
xor    %eax,%eax
call   1030 <extract_entropy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <add_entropy_words@plt>

LLVM IR (-O0):
define void @xfer_secondary_pool() {
%1 = call i32 (...) @extract_entropy()
%2 = call i32 (...) @add_entropy_words()
ret void
}

LLVM IR (-O2):
define void @xfer_secondary_pool() {
%1 = tail call i32 (...) @extract_entropy()
%2 = tail call i32 (...) @add_entropy_words()
ret void
}
/* Type definitions */
struct uart {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_uart1();
int /*<<< orphan*/ uart_init(struct uart *, int);
void serial_init(void) {
  gpio_uart1();
  uart_init((struct uart *)0x40013800, 115200);
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gpio_uart1@plt>
mov    $0x40013800,%edi
mov    $0x1c200,%esi
call   1030 <uart_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
push   %rax
xor    %eax,%eax
call   1040 <gpio_uart1@plt>
mov    $0x40013800,%edi
mov    $0x1c200,%esi
pop    %rax
jmp    1030 <uart_init@plt>

LLVM IR (-O0):
%struct.uart = type { i32 }
define void @serial_init() {
%1 = call i32 (...) @gpio_uart1()
%2 = call i32 @uart_init(%struct.uart* inttoptr (i64 1073821696 to %struct.uart*), i32 115200)
ret void
}

LLVM IR (-O2):
%struct.uart = type { i32 }
define void @serial_init() {
%1 = tail call i32 (...) @gpio_uart1()
%2 = tail call i32 @uart_init(%struct.uart* inttoptr (i64 1073821696 to %struct.uart*), i32 115200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, float);
float sum_kahan(float const *, int);
void show_sums(const float f[], int N) {
  float rSumKahan = sum_kahan(f, N);
  assert(rSumKahan > 0.0);
  printf("Kahan = %.7e\n", rSumKahan);
}


x86 assembly (clang, -O0):
<show_sums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sum_kahan@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movss  -0x10(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_sums>:
push   %rax
call   1030 <sum_kahan@plt>
movss  %xmm0,0x4(%rsp)
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
call   1050 <assert@plt>
lea    0xeac(%rip),%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Kahan = %.7e\0A\00"
define void @show_sums(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca float
store float* %0, float** %3
store i32 %1, i32* %4
%6 = load float*, float** %3
%7 = load i32, i32* %4
%8 = call float @sum_kahan(float* %6, i32 %7)
store float %8, float* %5
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, 0.000000e+00
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load float, float* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float %14)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Kahan = %.7e\0A\00"
define void @show_sums(float* %0, i32 %1) {
%3 = tail call float @sum_kahan(float* %0, i32 %1)
%4 = fcmp ogt float %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_ZIGBEE_short(int, int);
void software_reset() { write_ZIGBEE_short(0x2A, 0x07); }


x86 assembly (clang, -O0):
<software_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
mov    $0x7,%esi
call   1030 <write_ZIGBEE_short@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<software_reset>:
mov    $0x2a,%edi
mov    $0x7,%esi
jmp    1030 <write_ZIGBEE_short@plt>

LLVM IR (-O0):
define void @software_reset() {
%1 = call i32 @write_ZIGBEE_short(i32 42, i32 7)
ret void
}

LLVM IR (-O2):
define void @software_reset() {
%1 = tail call i32 @write_ZIGBEE_short(i32 42, i32 7)
ret void
}
void func1() {
  int i;
  int j;
  i = 0x5AA55AA5;
  j = 0xCDDCCDDC;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5aa55aa5,-0x4(%rbp)
movl   $0xcddccddc,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func1() {
%1 = alloca i32
%2 = alloca i32
store i32 1520786085, i32* %1
store i32 -841167396, i32* %2
ret void
}

LLVM IR (-O2):
define void @func1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ print_num(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  print_num(getgid());
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getgid@plt>
mov    %eax,%edi
call   1040 <print_num@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getgid@plt>
mov    %eax,%edi
call   1040 <print_num@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getgid()
%7 = call i32 @print_num(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getgid()
%4 = tail call i32 @print_num(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int readRegister(int, int);
int16_t readY(int file) {
  int16_t result = 0;
  result =
      readRegister(file, (0x32) + 2) | (readRegister(file, (0x32) + 3) << 8);
  return result;
}


x86 assembly (clang, -O0):
<readY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x34,%esi
call   1030 <readRegister@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x35,%esi
call   1030 <readRegister@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readY>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x34,%esi
call   1030 <readRegister@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x35,%esi
call   1030 <readRegister@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readY(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @readRegister(i32 %4, i32 52)
%6 = load i32, i32* %2
%7 = call i32 @readRegister(i32 %6, i32 53)
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @readY(i32 %0) {
%2 = tail call i32 @readRegister(i32 %0, i32 52)
%3 = tail call i32 @readRegister(i32 %0, i32 53)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ event;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
unsigned long get_XReparentEvent_event(void *_p) {
  return (unsigned long)((XReparentEvent *)_p)->event;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XReparentEvent_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void timer0Start() {
  (*(volatile unsigned int *)((0x3FF0000 + 0x6004)) = (50000000));
  (*(volatile unsigned int *)((0x3FF0000 + 0x6000)) = (1));
}


x86 assembly (clang, -O0):
<timer0Start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ff6004,%eax
movl   $0x2faf080,(%rax)
mov    $0x3ff6000,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer0Start>:
movl   $0x2faf080,0x3ff6004
80 f0 fa 02
movl   $0x1,0x3ff6000
ret

LLVM IR (-O0):
define void @timer0Start() {
store volatile i32 50000000, i32* inttoptr (i64 67067908 to i32*)
store volatile i32 1, i32* inttoptr (i64 67067904 to i32*)
ret void
}

LLVM IR (-O2):
define void @timer0Start() {
store volatile i32 50000000, i32* inttoptr (i64 67067908 to i32*)
store volatile i32 1, i32* inttoptr (i64 67067904 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void str_write(char *s) { write(fileno(stdout), s, strlen(s)); }


x86 assembly (clang, -O0):
<str_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_write>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @str_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fileno(i32 %3)
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write(i32 %4, i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @str_write(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fileno(i32 %2)
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @write(i32 %3, i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int cpswHalCommonRandom();
int cpswHalCommonRandomRange(int min, int max) {
  int iTmp;
  iTmp = cpswHalCommonRandom();
  iTmp %= ((max - min) + 1);
  iTmp += min;
  return (iTmp);
}


x86 assembly (clang, -O0):
<cpswHalCommonRandomRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <cpswHalCommonRandom@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpswHalCommonRandomRange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <cpswHalCommonRandom@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cpswHalCommonRandomRange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @cpswHalCommonRandom()
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %5
%12 = srem i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpswHalCommonRandomRange(i32 %0, i32 %1) {
%3 = tail call i32 (...) @cpswHalCommonRandom()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tenStar();
int main() {
  printf("\n");
  tenStar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <tenStar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <tenStar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (...) @tenStar()
ret i32 0
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ log_printf(int, char *);
int perf_shutdown_counter(int counter_fd) {
  int ret;
  if (counter_fd < 0)
    return 2;
  ret = close(counter_fd);
  if (ret < 0) {
    log_printf((1 << 2), "ERROR: "
                         "Failed to shutdown perf counter\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<perf_shutdown_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1141 <perf_shutdown_counter+0x21>
movl   $0x2,-0x4(%rbp)
jmp    117a <perf_shutdown_counter+0x5a>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1173 <perf_shutdown_counter+0x53>
mov    $0x4,%edi
lea    0xe9e(%rip),%rsi
call   1040 <log_printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117a <perf_shutdown_counter+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_shutdown_counter>:
push   %rax
test   %edi,%edi
js     1134 <perf_shutdown_counter+0x14>
call   1030 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     113b <perf_shutdown_counter+0x1b>
pop    %rcx
ret
mov    $0x2,%eax
pop    %rcx
ret
lea    0xebe(%rip),%rsi
mov    $0x4,%edi
call   1040 <log_printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"ERROR: Failed to shutdown perf counter\0A\00"
define i32 @perf_shutdown_counter(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 2, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @close(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @log_printf(i32 4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %16
15: ; preds = %8
store i32 0, i32* %2
br label %16
16: ; preds = %15, %13, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [40 x i8] c"ERROR: Failed to shutdown perf counter\0A\00"
define i32 @perf_shutdown_counter(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @log_printf(i32 4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %1, %6
%9 = phi i32 [ 1, %6 ], [ 2, %1 ], [ 0, %3 ]
ret i32 %9
}
double pdtr(k, m)
int k;
double m;
{
  double v;
  if ((k < 0) || (m <= 0.0)) {
    mtherr("pdtr", 1);
    return (0.0);
  }
  v = k + 1;
  return (igamc(v, m));
}


x86 assembly (clang, -O0):
<pdtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1148 <pdtr+0x28>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1168 <pdtr+0x48>
lea    0xeb1(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1191 <pdtr+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    $0x2,%al
call   1030 <igamc@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdtr>:
push   %rax
test   %edi,%edi
js     114d <pdtr+0x2d>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    114d <pdtr+0x2d>
add    $0x1,%edi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mov    $0x2,%al
call   1030 <igamc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret
lea    0xeac(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"pdtr\00"
define double @pdtr(i32 %0, double %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = fcmp ole double %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9, %2
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
store double 0.000000e+00, double* %3
br label %22
14: ; preds = %9
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
store double %17, double* %6
%18 = load double, double* %6
%19 = load double, double* %5
%20 = call i32 (double, double, ...) bitcast (i32 (...)* @igamc to i32 (double, double, ...)*)(double %18, double %19)
%21 = sitofp i32 %20 to double
store double %21, double* %3
br label %22
22: ; preds = %14, %12
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"pdtr\00"
define double @pdtr(i32 %0, double %1) {
%3 = icmp slt i32 %0, 0
%4 = fcmp ole double %1, 0.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
br label %13
8: ; preds = %2
%9 = add nuw nsw i32 %0, 1
%10 = sitofp i32 %9 to double
%11 = tail call i32 (double, double, ...) bitcast (i32 (...)* @igamc to i32 (double, double, ...)*)(double %10, double %1)
%12 = sitofp i32 %11 to double
br label %13
13: ; preds = %8, %6
%14 = phi double [ 0.000000e+00, %6 ], [ %12, %8 ]
ret double %14
}
int Q_CountChar(const char *string, char tocount) {
  int count;
  for (count = 0; *string; string++) {
    if (*string == tocount) {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<Q_CountChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <Q_CountChar+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <Q_CountChar+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <Q_CountChar+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <Q_CountChar+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_CountChar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <Q_CountChar+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <Q_CountChar+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Q_CountChar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
int sqrt(int);
double D5(int n, int m) {
  return (n * sqrt((n + 1) * (n + 1) - m * m) / (double)(2 * n + 1));
}


x86 assembly (clang, -O0):
<D5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   %eax,%edi
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
sub    %eax,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<D5>:
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%edi
imul   %edi,%edi
imul   %esi,%esi
sub    %esi,%edi
call   1030 <sqrt@plt>
imul   %ebx,%eax
cvtsi2sd %eax,%xmm0
lea    (%rbx,%rbx,1),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @D5(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = sub nsw i32 %10, %13
%15 = call i32 @sqrt(i32 %14)
%16 = mul nsw i32 %5, %15
%17 = sitofp i32 %16 to double
%18 = load i32, i32* %3
%19 = mul nsw i32 2, %18
%20 = add nsw i32 %19, 1
%21 = sitofp i32 %20 to double
%22 = fdiv double %17, %21
ret double %22
}

LLVM IR (-O2):
define double @D5(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = mul nsw i32 %3, %3
%5 = mul nsw i32 %1, %1
%6 = sub nsw i32 %4, %5
%7 = tail call i32 @sqrt(i32 %6)
%8 = mul nsw i32 %7, %0
%9 = sitofp i32 %8 to double
%10 = shl nsw i32 %0, 1
%11 = or i32 %10, 1
%12 = sitofp i32 %11 to double
%13 = fdiv double %9, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ __DSB();
int /*<<< orphan*/ __ISB();
int /*<<< orphan*/ __set_BPIALL(int /*<<< orphan*/);
__attribute__((always_)) void L1C_InvalidateBTAC(void) {
  __set_BPIALL(0);
  __DSB();
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_InvalidateBTAC>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <__set_BPIALL@plt>
mov    $0x0,%al
call   1040 <__DSB@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_InvalidateBTAC>:
push   %rax
xor    %edi,%edi
call   1050 <__set_BPIALL@plt>
xor    %eax,%eax
call   1040 <__DSB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_InvalidateBTAC() {
%1 = call i32 @__set_BPIALL(i32 0)
%2 = call i32 (...) @__DSB()
%3 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_InvalidateBTAC() {
%1 = tail call i32 @__set_BPIALL(i32 0)
%2 = tail call i32 (...) @__DSB()
%3 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
float exp(double);
float height_to_pressure(float height) {
  return (float)1012.5 * exp((double)height / -7.2);
}


x86 assembly (clang, -O0):
<height_to_pressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movss  0xebe(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<height_to_pressure>:
push   %rax
cvtss2sd %xmm0,%xmm0
divsd  0xee3(%rip),%xmm0
call   1030 <exp@plt>
mulss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @height_to_pressure(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, -7.200000e+00
%6 = call float @exp(double %5)
%7 = fmul float 1.012500e+03, %6
ret float %7
}

LLVM IR (-O2):
define float @height_to_pressure(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, -7.200000e+00
%4 = tail call float @exp(double %3)
%5 = fmul float %4, 1.012500e+03
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ XSleep(int);
void fb_Delay(int msecs) { XSleep(msecs); }


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

x86 assembly (clang, -O2):
<fb_Delay>:
jmp    1030 <XSleep@plt>

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

LLVM IR (-O2):
define void @fb_Delay(i32 %0) {
%2 = tail call i32 @XSleep(i32 %0)
ret void
}
/* Variables and functions */
float clamp(float, float, float);
float smoothstep(float lower, float upper, float x) {
  x = clamp((x - lower) / (upper - lower), 0.0f, 1.0f);
  return x * x * (3.0f - 2.0f * x);
}


x86 assembly (clang, -O0):
<smoothstep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
movss  0xeba(%rip),%xmm2
call   1030 <clamp@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
addss  %xmm2,%xmm2
movss  0xe91(%rip),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smoothstep>:
push   %rax
movaps %xmm2,%xmm3
subss  %xmm0,%xmm3
subss  %xmm0,%xmm1
divss  %xmm1,%xmm3
movss  0xed8(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm3,%xmm0
call   1030 <clamp@plt>
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm0,%xmm0
movss  0xebe(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @smoothstep(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = load float, float* %5
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = fdiv float %9, %12
%14 = call float @clamp(float %13, float 0.000000e+00, float 1.000000e+00)
store float %14, float* %6
%15 = load float, float* %6
%16 = load float, float* %6
%17 = fmul float %15, %16
%18 = load float, float* %6
%19 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %18, float 3.000000e+00)
%20 = fmul float %17, %19
ret float %20
}

LLVM IR (-O2):
define float @smoothstep(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %0
%6 = fdiv float %4, %5
%7 = tail call float @clamp(float %6, float 0.000000e+00, float 1.000000e+00)
%8 = fmul float %7, %7
%9 = tail call float @llvm.fmuladd.f32(float %7, float -2.000000e+00, float 3.000000e+00)
%10 = fmul float %8, %9
ret float %10
}
void reset(unsigned char *a, unsigned char pos) { *a &= ~(1 << pos); }


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
not    %al
and    %al,(%rdi)
ret

LLVM IR (-O0):
define void @reset(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, %8
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
ret void
}

LLVM IR (-O2):
define void @reset(i8* nocapture %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = shl nuw i32 1, %3
%5 = load i8, i8* %0
%6 = trunc i32 %4 to i8
%7 = xor i8 %6, -1
%8 = and i8 %5, %7
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_CLEAR_BIT(int, int);
void xburst_cgm_ungate_aic1() { MIPS_CLEAR_BIT((0xB0000000 + 0x28), 6); }


x86 assembly (clang, -O0):
<xburst_cgm_ungate_aic1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x6,%esi
call   1030 <MIPS_CLEAR_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_ungate_aic1>:
mov    $0xb0000028,%edi
mov    $0x6,%esi
jmp    1030 <MIPS_CLEAR_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_ungate_aic1() {
%1 = call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 6)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_ungate_aic1() {
%1 = tail call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 6)
ret void
}
long double test_ceill(long double x) { return __builtin_ceill(x); }


x86 assembly (clang, -O0):
<test_ceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <ceill@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ceill>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <ceill@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @test_ceill(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.ceil.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test_ceill(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.ceil.f80(x86_fp80 %0)
ret x86_fp80 %2
}
int strcmp(const char *s1, const char *s2) {
  while (1) {
    int c1 = (unsigned char)*s1++;
    int c2 = (unsigned char)*s2++;
    int diff = c1 - c2;
    if (!c1 || diff) {
      return diff;
    }
  }
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <strcmp+0x53>
cmpl   $0x0,-0x1c(%rbp)
je     1158 <strcmp+0x58>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret
jmp    110c <strcmp+0xc>

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
movzbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
test   %edx,%edx
je     112a <strcmp+0x2a>
add    $0x1,%rcx
test   %eax,%eax
je     1110 <strcmp+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = sub nsw i32 %8, %11
%13 = icmp eq i8 %7, 0
%14 = icmp ne i32 %12, 0
%15 = select i1 %13, i1 true, i1 %14
br i1 %15, label %16, label %3
16: ; preds = %3
ret i32 %12
}
/* Variables and functions */
int strtol(char const *, int /*<<< orphan*/ *, int);
int atoi(const char *s) { return strtol(s, NULL, 10); }


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

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i32 %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long ztimeout_set(long timeout) {
  long r;
  struct timeval tv;
  gettimeofday(&tv, 0);
  r = tv.tv_sec * 1000 + tv.tv_usec / 1000 + timeout;
  return r;
}


x86 assembly (clang, -O0):
<ztimeout_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cltq
add    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ztimeout_set>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0xc(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @ztimeout_set(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca %struct.timeval
store i64 %0, i64* %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
%13 = sext i32 %12 to i64
%14 = load i64, i64* %2
%15 = add nsw i64 %13, %14
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @ztimeout_set(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %0
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void helptext(char *p_name) {
  printf(
      "Usage: %s [--dos2unix,--unix2dos,-a] -i <input file> -o <output file>\n",
      p_name);
}


x86 assembly (clang, -O0):
<helptext>:
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):
<helptext>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"Usage: %s [--dos2unix,--unix2dos,-a] -i <input file> -o <output file>\0A\00"
define void @helptext(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"Usage: %s [--dos2unix,--unix2dos,-a] -i <input file> -o <output file>\0A\00"
define void @helptext(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
test(x, m) int x, m;
{ return ((x & m) ? 1 : 0); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
and    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %eax,%eax
test   %edi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int c = 0;
  printf("enter a number");
  scanf("%d", &c);
  printf("The number is %d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"The number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"enter a number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"The number is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
void *start_thread(void *arg) {
  pthread_detach(pthread_self());
  pthread_exit(NULL);
  return NULL;
}


x86 assembly (clang, -O0):
<start_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_thread>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @start_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @pthread_detach(i32 %3)
%5 = call i32 @pthread_exit(i32* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @start_thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i32 %2)
%4 = tail call i32 @pthread_exit(i32* null)
ret i8* null
}
void ff_hevc_put_hevc_bi_epel_hv32_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv32_8_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_CMPLTDP(int s1, int s2, int dst) {
  C67_asm("CMPLTDP.S1", s1, s2, dst);
}


x86 assembly (clang, -O0):
<C67_CMPLTDP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_CMPLTDP>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMPLTDP.S1\00"
define void @C67_CMPLTDP(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 = load i32, i32* %6
%10 = call i32 @C67_asm(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMPLTDP.S1\00"
define void @C67_CMPLTDP(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
unsigned int getpid();
unsigned int time(int /*<<< orphan*/ *);
unsigned int pm_randseed(void) { return time(NULL) ^ getpid(); }


x86 assembly (clang, -O0):
<pm_randseed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_randseed>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pm_randseed() {
%1 = call i32 @time(i32* null)
%2 = call i32 (...) @getpid()
%3 = xor i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @pm_randseed() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 (...) @getpid()
%3 = xor i32 %2, %1
ret i32 %3
}
double myrad2deg(double rad) { return rad * 180. / 3.14159265358979323846; }


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

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

LLVM IR (-O0):
define double @myrad2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 0x400921FB54442D18
ret double %5
}

LLVM IR (-O2):
define double @myrad2deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB54442D18
ret double %3
}