xunge/DecIR huggingface dataset:
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ syscall_cp(int, int, struct iovec const *, int, long, long);
ssize_t preadv(int fd, const struct iovec *iov, int count, off_t ofs) {
  return syscall_cp(361, fd, iov, count, (long)(ofs), (long)(ofs >> 32));
}


x86 assembly (clang, -O0):
<preadv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x18(%rbp),%r8
mov    -0x18(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    -0x1c(%rbp),%ecx
movslq %eax,%r9
mov    $0x169,%edi
call   1030 <syscall_cp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preadv>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %edi,%esi
movslq %ecx,%r8
mov    $0x169,%edi
mov    %eax,%ecx
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @preadv(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.iovec*, %struct.iovec** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = sext i32 %12 to i64
%14 = load i32, i32* %8
%15 = ashr i32 %14, 32
%16 = sext i32 %15 to i64
%17 = call i32 @syscall_cp(i32 361, i32 %9, %struct.iovec* %10, i32 %11, i64 %13, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @preadv(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = tail call i32 @syscall_cp(i32 361, i32 %0, %struct.iovec* %1, i32 %2, i64 %5, i64 poison)
ret i32 %6
}
void removeTrailingNewLine(char *s) {
  for (int i = 0; s[i] != '\0'; i++) {
    if (s[i] == '\n') {
      s[i] = '\0';
      return;
    }
  }
}


x86 assembly (clang, -O0):
<removeTrailingNewLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115d <removeTrailingNewLine+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114a <removeTrailingNewLine+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    115d <removeTrailingNewLine+0x5d>
jmp    114f <removeTrailingNewLine+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <removeTrailingNewLine+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeTrailingNewLine>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1129 <removeTrailingNewLine+0x29>
cmp    $0xa,%cl
je     1123 <removeTrailingNewLine+0x23>
add    $0x1,%rax
jmp    1110 <removeTrailingNewLine+0x10>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @removeTrailingNewLine(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %10, %9 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %11
i8 10, label %6
]
6: ; preds = %2
%7 = and i64 %3, 4294967295
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %11
9: ; preds = %2
%10 = add nuw i64 %3, 1
br label %2
11: ; preds = %2, %6
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t seconds_since_midnight(uint8_t hours, uint8_t minutes,
                                uint8_t seconds) {
  return ((hours * 60 * 60) + (minutes * 60) + seconds);
}


x86 assembly (clang, -O0):
<seconds_since_midnight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
imul   $0x3c,%eax,%eax
imul   $0x3c,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds_since_midnight>:
imul   $0xe10,%edi,%ecx
imul   $0x3c,%esi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @seconds_since_midnight(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 = mul nsw i32 %7, 60
%9 = mul nsw i32 %8, 60
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 60
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @seconds_since_midnight(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 3600
%5 = mul nsw i32 %1, 60
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
void test_no_clause() {
  int i;
#pragma omp target teams distribute
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ idt_add(int, unsigned int, int);
void keyboard_init() {
  extern void _keyboard_handler();
  idt_add(0x21, (unsigned int)_keyboard_handler, 0x8e);
}


x86 assembly (clang, -O0):
<keyboard_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    0x2ec0(%rip),%rax
mov    %eax,%esi
mov    $0x8e,%edx
call   1030 <idt_add@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_init>:
mov    0x2eca(%rip),%esi
mov    $0x21,%edi
mov    $0x8e,%edx
jmp    1030 <idt_add@plt>

LLVM IR (-O0):
define void @keyboard_init() {
%1 = call i32 @idt_add(i32 33, i32 ptrtoint (void (...)* @_keyboard_handler to i32), i32 142)
ret void
}

LLVM IR (-O2):
define void @keyboard_init() {
%1 = tail call i32 @idt_add(i32 33, i32 ptrtoint (void (...)* @_keyboard_handler to i32), i32 142)
ret void
}
void reg_write_8(unsigned char data, volatile unsigned char *addr) {
  *addr = data;
}


x86 assembly (clang, -O0):
<reg_write_8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_write_8>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @reg_write_8(i8 zeroext %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
store volatile i8 %5, i8* %6
ret void
}

LLVM IR (-O2):
define void @reg_write_8(i8 zeroext %0, i8* %1) {
store volatile i8 %0, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void move_X(int dir) {
  if (dir == 0) {
    printf("Stop X motor\n");
  } else {
    printf("Move X to %s\n", (dir > 0) ? "++" : "--");
  }
}


x86 assembly (clang, -O0):
<move_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <move_X+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <move_X+0x4e>
mov    -0x4(%rbp),%ecx
lea    0xedd(%rip),%rsi
lea    0xed3(%rip),%rax
cmp    $0x0,%ecx
cmovg  %rax,%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_X>:
test   %edi,%edi
je     1144 <move_X+0x24>
lea    0xee3(%rip),%rax
lea    0xedf(%rip),%rsi
cmovg  %rax,%rsi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Stop X motor\0A\00"
@.str.1 = [14 x i8] c"Move X to %s\0A\00"
@.str.2 = [3 x i8] c"++\00"
@.str.3 = [3 x i8] c"--\00"
define void @move_X(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Move X to %s\0A\00"
@.str.2 = [3 x i8] c"++\00"
@.str.3 = [3 x i8] c"--\00"
@str = [13 x i8] c"Stop X motor\00"
define void @move_X(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = icmp sgt i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %3
ret void
}
unsigned char explicit_conversion_interference1(unsigned int c) {
  unsigned short b;
  return (unsigned char)(b = c);
}


x86 assembly (clang, -O0):
<explicit_conversion_interference1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0x6(%rbp)
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @explicit_conversion_interference1(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i16
store i16 %5, i16* %3
%6 = trunc i16 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @explicit_conversion_interference1(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
unsigned addval_184(unsigned x) { return x + 3529556617U; }


x86 assembly (clang, -O0):
<addval_184>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd260c289,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addval_184>:
lea    -0x2d9f3d77(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_184(i32 %0) {
%2 = add i32 %0, -765410679
ret i32 %2
}
/* Variables and functions */
float sqrtf(float);
float vec2_length(float *a) { return sqrtf(a[0] * a[0] + a[1] * a[1]); }


x86 assembly (clang, -O0):
<vec2_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_length>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1132 <vec2_length+0x22>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @vec2_length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = call float @sqrtf(float %16)
ret float %17
}

LLVM IR (-O2):
define float @vec2_length(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call float @sqrtf(float %6)
ret float %7
}
void UI_set_ex_data(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_set_ex_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void display(int a[], int length) {
  int i;
  for (i = 0; i < length; i++)
    printf("%d ", a[i]);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<display>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <display+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <display+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
char *DES_crypt(char const *, char const *);
char *_ossl_old_des_crypt(const char *buf, const char *salt) {
  return DES_crypt(buf, salt);
}


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

x86 assembly (clang, -O2):
<_ossl_old_des_crypt>:
jmp    1030 <DES_crypt@plt>

LLVM IR (-O0):
define i8* @_ossl_old_des_crypt(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 i8* @DES_crypt(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @_ossl_old_des_crypt(i8* %0, i8* %1) {
%3 = tail call i8* @DES_crypt(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int get();
void skipnl() {
  register int c;
  do {
    c = get();
  } while (c != '\n' && c != '\r' && c != 0);
}


x86 assembly (clang, -O0):
<skipnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <skipnl+0x3a>
xor    %eax,%eax
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114a <skipnl+0x3a>
cmpl   $0x0,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1118 <skipnl+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipnl>:
push   %rbx
mov    $0x2401,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get@plt>
cmp    $0xd,%eax
ja     1120 <skipnl+0x10>
bt     %eax,%ebx
jae    1120 <skipnl+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @skipnl() {
%1 = alloca i32
br label %2
2: ; preds = %13, %0
%3 = call i32 (...) @get()
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 13
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %1
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %10, %7, %4
%14 = phi i1 [ false, %7 ], [ false, %4 ], [ %12, %10 ]
br i1 %14, label %2, label %15
15: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @skipnl() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @get()
switch i32 %2, label %1 [
i32 13, label %3
i32 10, label %3
i32 0, label %3
]
3: ; preds = %1, %1, %1
ret void
}
float m_abs(float value) {
  if (value < 0)
    value = -value;
  return value;
}


x86 assembly (clang, -O0):
<m_abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <m_abs+0x2d>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_abs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @m_abs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
store float %7, float* %2
br label %8
8: ; preds = %5, %1
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @m_abs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
double sqrt(double);
double distance(double x1, double z1, double x2, double z2) {
  double dx = x1 - x2;
  double dz = z1 - z2;
  return sqrt(dx * dx + dz * dz);
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <distance+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %5
%12 = load double, double* %7
%13 = fsub double %11, %12
store double %13, double* %9
%14 = load double, double* %6
%15 = load double, double* %8
%16 = fsub double %14, %15
store double %16, double* %10
%17 = load double, double* %9
%18 = load double, double* %9
%19 = load double, double* %10
%20 = load double, double* %10
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %17, double %18, double %21)
%23 = call double @sqrt(double %22)
ret double %23
}

LLVM IR (-O2):
define double @distance(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fsub double %1, %3
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
ret double %9
}
void yy_2_IgnoredElements(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_2_IgnoredElements(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_2_IgnoredElements(i8* nocapture %0, i32 %1) {
ret void
}
__attribute__((always_)) void touch_all_softlockup_watchdogs(void) {}


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

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

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

LLVM IR (-O2):
define void @touch_all_softlockup_watchdogs() {
ret void
}
/* Variables and functions */
double pow(double, int);
double calculateDiscriminant(double a, double b, double c) {
  return (pow(b, 2) - 4 * a * c);
}


x86 assembly (clang, -O0):
<calculateDiscriminant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xebf(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateDiscriminant>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xec4(%rip),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calculateDiscriminant(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = call double @pow(double %7, i32 2)
%9 = load double, double* %4
%10 = fmul double 4.000000e+00, %9
%11 = load double, double* %6
%12 = fneg double %10
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double %8)
ret double %13
}

LLVM IR (-O2):
define double @calculateDiscriminant(double %0, double %1, double %2) {
%4 = tail call double @pow(double %1, i32 2)
%5 = fmul double %0, -4.000000e+00
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %4)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void iw_sockets_close(int skfd) { close(skfd); }


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

x86 assembly (clang, -O2):
<iw_sockets_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @iw_sockets_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int who(pr, s, t)
char *pr, *s, *t;
{
  int i;
  if (!readdefault(pr, s, 21, ""))
    return (-100);
  if ((i = lookup(s, t)) == -100)
    return (-101);
  return (i);
}


x86 assembly (clang, -O0):
<who>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x15,%edx
lea    0xeb8(%rip),%rcx
mov    $0x0,%al
call   1030 <readdefault@plt>
cmp    $0x0,%eax
jne    1164 <who+0x44>
movl   $0xffffff9c,-0x4(%rbp)
jmp    1191 <who+0x71>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <lookup@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffff9c,%eax
jne    118b <who+0x6b>
movl   $0xffffff9b,-0x4(%rbp)
jmp    1191 <who+0x71>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<who>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xecf(%rip),%rcx
mov    $0x15,%edx
xor    %eax,%eax
call   1030 <readdefault@plt>
test   %eax,%eax
je     115d <who+0x3d>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <lookup@plt>
mov    %eax,%ecx
cmp    $0xffffff9c,%eax
mov    $0xffffff9b,%eax
cmovne %ecx,%eax
jmp    1162 <who+0x42>
mov    $0xffffff9c,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @who(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @readdefault to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %9, i8* %10, i32 21, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %3
store i32 -100, i32* %4
br label %22
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @lookup to i32 (i8*, i8*, ...)*)(i8* %15, i8* %16)
store i32 %17, i32* %8
%18 = icmp eq i32 %17, -100
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 -101, i32* %4
br label %22
20: ; preds = %14
%21 = load i32, i32* %8
store i32 %21, i32* %4
br label %22
22: ; preds = %20, %19, %13
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @who(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @readdefault to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %0, i8* %1, i32 21, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @lookup to i32 (i8*, i8*, ...)*)(i8* %1, i8* %2)
%8 = icmp eq i32 %7, -100
%9 = select i1 %8, i32 -101, i32 %7
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -100, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int mwsp_send_command(int, int, int);
int mwsp_reset_conf(int fd) { return mwsp_send_command(fd, 208, 0x1); }


x86 assembly (clang, -O0):
<mwsp_reset_conf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xd0,%esi
mov    $0x1,%edx
call   1030 <mwsp_send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mwsp_reset_conf>:
mov    $0xd0,%esi
mov    $0x1,%edx
jmp    1030 <mwsp_send_command@plt>

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

LLVM IR (-O2):
define i32 @mwsp_reset_conf(i32 %0) {
%2 = tail call i32 @mwsp_send_command(i32 %0, i32 208, i32 1)
ret i32 %2
}
/* Variables and functions */
double __nv_remquo(double, double, int *);
double remquo(double __a, double __b, int *__c) {
  return __nv_remquo(__a, __b, __c);
}


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

x86 assembly (clang, -O2):
<remquo>:
jmp    1030 <__nv_remquo@plt>

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

LLVM IR (-O2):
define double @remquo(double %0, double %1, i32* %2) {
%4 = tail call double @__nv_remquo(double %0, double %1, i32* %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ stdimpl_sprintf(char *, char const *, char **);
void stdimpl_print(const char *string, ...) {
  char outString[50];
  char **va_args = &string + 1;
  stdimpl_sprintf(outString, string, va_args);
  return;
}


x86 assembly (clang, -O0):
<stdimpl_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x0(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x48(%rbp),%rdx
lea    -0x40(%rbp),%rdi
call   1030 <stdimpl_sprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdimpl_print>:
sub    $0x48,%rsp
mov    %rdi,%rsi
mov    %rdi,0x8(%rsp)
lea    0x10(%rsp),%rdx
lea    0x10(%rsp),%rdi
call   1030 <stdimpl_sprintf@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @stdimpl_print(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [50 x i8]
%4 = alloca i8**
store i8* %0, i8** %2
%5 = getelementptr inbounds i8*, i8** %2, i64 1
store i8** %5, i8*** %4
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = load i8**, i8*** %4
%9 = call i32 @stdimpl_sprintf(i8* %6, i8* %7, i8** %8)
ret void
}

LLVM IR (-O2):
define void @stdimpl_print(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca [50 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %2, i64 1
%6 = call i32 @stdimpl_sprintf(i8* %4, i8* %0, i8** %5)
ret void
}
void usdhc1_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @usdhc1_iomux_config() {
ret void
}
float Sleef_asinf_u10(float x) { return __builtin_asinf(x); }


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

x86 assembly (clang, -O2):
<Sleef_asinf_u10>:
jmp    1030 <asinf@plt>

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

LLVM IR (-O2):
define float @Sleef_asinf_u10(float %0) {
%2 = tail call float @asinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ input_device_reset();
int /*<<< orphan*/ nmi_device_reset();
int /*<<< orphan*/ output_device_reset();
void cpu_pulse_reset(void) {
  nmi_device_reset();
  output_device_reset();
  input_device_reset();
}


x86 assembly (clang, -O0):
<cpu_pulse_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <nmi_device_reset@plt>
mov    $0x0,%al
call   1050 <output_device_reset@plt>
mov    $0x0,%al
call   1030 <input_device_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_pulse_reset>:
push   %rax
xor    %eax,%eax
call   1040 <nmi_device_reset@plt>
xor    %eax,%eax
call   1050 <output_device_reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <input_device_reset@plt>

LLVM IR (-O0):
define void @cpu_pulse_reset() {
%1 = call i32 (...) @nmi_device_reset()
%2 = call i32 (...) @output_device_reset()
%3 = call i32 (...) @input_device_reset()
ret void
}

LLVM IR (-O2):
define void @cpu_pulse_reset() {
%1 = tail call i32 (...) @nmi_device_reset()
%2 = tail call i32 (...) @output_device_reset()
%3 = tail call i32 (...) @input_device_reset()
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double timer_value(struct timeval *tv) {
  return (double)(tv->tv_sec) + (double)(tv->tv_usec) / (double)(1000000);
}


x86 assembly (clang, -O0):
<timer_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_value>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @timer_value(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @timer_value(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %8, %4
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void epilog() { emitln("EPILOG"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"EPILOG\00"
define void @epilog() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int altera(int *a, int *b) {
  int tmp;
  tmp = *b;
  *b = *a;
  *a = tmp;
}


x86 assembly (clang, -O0):
<altera>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @altera(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
store i32 %8, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = load i32*, i32** %5
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @altera(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret i32 undef
}
int eol(char *stream, long offset) {
  char c = stream[offset];
  return c == '\r' || c == '\n';
}


x86 assembly (clang, -O0):
<eol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x12(%rbp)
je     1139 <eol+0x39>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eol>:
mov    (%rdi,%rsi,1),%al
cmp    $0xd,%al
sete   %cl
cmp    $0xa,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @eol(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 13
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br label %17
17: ; preds = %13, %2
%18 = phi i1 [ true, %2 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @eol(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 13
%6 = icmp eq i8 %4, 10
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int PathDecl_57_5(char *t1) {
  int t0;
  char *t2;
  char *t3;
  unsigned int t4;
  unsigned int t5;
  unsigned int t6;
  unsigned int t7;
  unsigned int t8;
LAB0:
  t2 = (t1 + 1824U);
  t3 = *((char **)t2);
  t2 = (t3 + 4);
  t4 = *((unsigned int *)t2);
  t5 = (~(t4));
  t6 = *((unsigned int *)t3);
  t7 = (t6 & t5);
  t8 = (t7 != 0);
  t0 = t8;
LAB1:
  return t0;
}


x86 assembly (clang, -O0):
<PathDecl_57_5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x720,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathDecl_57_5>:
mov    0x720(%rdi),%rcx
mov    0x4(%rcx),%edx
not    %edx
xor    %eax,%eax
test   %edx,(%rcx)
setne  %al
ret

LLVM IR (-O0):
define i32 @PathDecl_57_5(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %2
br label %11
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1824
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i8**
%16 = load i8*, i8** %15
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 4
store i8* %18, i8** %4
%19 = load i8*, i8** %4
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = xor i32 %22, -1
store i32 %23, i32* %7
%24 = load i8*, i8** %5
%25 = bitcast i8* %24 to i32*
%26 = load i32, i32* %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %7
%29 = and i32 %27, %28
store i32 %29, i32* %9
%30 = load i32, i32* %9
%31 = icmp ne i32 %30, 0
%32 = zext i1 %31 to i32
store i32 %32, i32* %10
%33 = load i32, i32* %10
store i32 %33, i32* %3
br label %34
34: ; preds = %11
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @PathDecl_57_5(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1824
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = xor i32 %7, -1
%9 = bitcast i8* %4 to i32*
%10 = load i32, i32* %9
%11 = and i32 %10, %8
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
void initialize(char *p) {
  for (int i = 0; i < 50; i++) {
    p[i] = 0;
  }
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1133 <initialize+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initialize+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movw   $0x0,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @initialize(i8* nocapture writeonly %0) {
ret void
}
void test_ar_1_ULONG(void *d, unsigned long n) {
  if (n == (0x7fffffffffffffffL * 2LU + 1) - 1)
    n = (0x7fffffffffffffffL * 2LU + 1) - 2;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_1_ULONG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xfffffffffffffffe,-0x10(%rbp)
jne    1133 <test_ar_1_ULONG+0x23>
movq   $0xfffffffffffffffd,-0x10(%rbp)
ff
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_1_ULONG>:
cmp    $0xfffffffffffffffe,%rsi
mov    $0xfffffffffffffffd,%rdx
cmovne %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @test_ar_1_ULONG(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, -2
%4 = select i1 %3, i64 -3, i64 %1
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %4, i1 false)
ret void
}
/* Variables and functions */
void free(void *);
void hb_free_impl(void *ptr) { return free(ptr); }


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

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

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

LLVM IR (-O2):
define void @hb_free_impl(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
unsigned int read16(unsigned int);
unsigned int read8(unsigned int addr) {
  unsigned int data;
  data = read16(addr & (~1));
  if (addr & 1) {
    data >>= 8;
  }
  return (data & 0xFF);
}


x86 assembly (clang, -O0):
<read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xfffffffe,%edi
call   1030 <read16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1141 <read8+0x31>
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read8>:
push   %rbx
mov    %edi,%ebx
and    $0xfffffffe,%edi
call   1030 <read16@plt>
mov    %eax,%ecx
shr    $0x8,%ecx
test   $0x1,%bl
cmove  %eax,%ecx
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @read8(i32 %0) {
%2 = and i32 %0, -2
%3 = tail call i32 @read16(i32 %2)
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
%6 = lshr i32 %3, 8
%7 = select i1 %5, i32 %3, i32 %6
%8 = and i32 %7, 255
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
void sim_os_sleep(unsigned int sec) {
  sleep(sec);
  return;
}


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

x86 assembly (clang, -O2):
<sim_os_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @sim_os_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}