xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
char *skip_non_whitespace(const char *s) {
  while (*s != '\0' && !isspace(*s))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_non_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <skip_non_whitespace+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <skip_non_whitespace+0x48>
jmp    1169 <skip_non_whitespace+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_non_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_non_whitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <skip_non_whitespace+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <skip_non_whitespace+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_non_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_non_whitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
float distance_from_edge(int x, int max) {
  int dx = (max / 2) - x;
  if (dx < 0)
    dx = -dx;
  dx = (max / 2) + 1 - dx;
  dx *= 2;
  float dist = (float)dx / max;
  if (dist > 1)
    dist = 1;
  return dist;
}


x86 assembly (clang, -O0):
<distance_from_edge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    112d <distance_from_edge+0x2d>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe96(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1180 <distance_from_edge+0x80>
movss  0xe85(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_from_edge>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
mov    %eax,%ecx
sub    %edi,%ecx
mov    %ecx,%edx
neg    %edx
cmovns %ecx,%edx
add    %eax,%edx
lea    (%rdx,%rdx,1),%eax
add    $0x2,%eax
cvtsi2ss %eax,%xmm1
cvtsi2ss %esi,%xmm0
divss  %xmm0,%xmm1
movss  0xed0(%rip),%xmm0
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @distance_from_edge(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 2
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %5
%15 = sub nsw i32 0, %14
store i32 %15, i32* %5
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %4
%18 = sdiv i32 %17, 2
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = mul nsw i32 %22, 2
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = sitofp i32 %24 to float
%26 = load i32, i32* %4
%27 = sitofp i32 %26 to float
%28 = fdiv float %25, %27
store float %28, float* %6
%29 = load float, float* %6
%30 = fcmp ogt float %29, 1.000000e+00
br i1 %30, label %31, label %32
31: ; preds = %16
store float 1.000000e+00, float* %6
br label %32
32: ; preds = %31, %16
%33 = load float, float* %6
ret float %33
}

LLVM IR (-O2):
define float @distance_from_edge(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = sub nsw i32 %3, %0
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = add nsw i32 %3, 1
%7 = sub i32 %6, %5
%8 = shl nsw i32 %7, 1
%9 = sitofp i32 %8 to float
%10 = sitofp i32 %1 to float
%11 = fdiv float %9, %10
%12 = fcmp ogt float %11, 1.000000e+00
%13 = select i1 %12, float 1.000000e+00, float %11
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
int /*<<< orphan*/ cal_angle(unsigned int);
int /*<<< orphan*/ motion_direction(int);
int /*<<< orphan*/ speed_control(int /*<<< orphan*/, unsigned int);
void backward_soft_left(unsigned int speed, unsigned int angle) {
  motion_direction(0b00001000);
  speed_control(0, speed);
  cal_angle(angle * 2);
  _delay_us(10);
}


x86 assembly (clang, -O0):
<backward_soft_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <motion_direction@plt>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1060 <speed_control@plt>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
call   1050 <_delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backward_soft_left>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x8,%edi
call   1040 <motion_direction@plt>
xor    %edi,%edi
mov    %ebp,%esi
call   1060 <speed_control@plt>
add    %ebx,%ebx
mov    %ebx,%edi
call   1030 <cal_angle@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <_delay_us@plt>

LLVM IR (-O0):
define void @backward_soft_left(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @motion_direction(i32 8)
%6 = load i32, i32* %3
%7 = call i32 @speed_control(i32 0, i32 %6)
%8 = load i32, i32* %4
%9 = mul i32 %8, 2
%10 = call i32 @cal_angle(i32 %9)
%11 = call i32 @_delay_us(i32 10)
ret void
}

LLVM IR (-O2):
define void @backward_soft_left(i32 %0, i32 %1) {
%3 = tail call i32 @motion_direction(i32 8)
%4 = tail call i32 @speed_control(i32 0, i32 %0)
%5 = shl i32 %1, 1
%6 = tail call i32 @cal_angle(i32 %5)
%7 = tail call i32 @_delay_us(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall1(int);
void clrscr() { syscall1(512); }


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

x86 assembly (clang, -O2):
<clrscr>:
mov    $0x200,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define void @clrscr() {
%1 = call i32 @syscall1(i32 512)
ret void
}

LLVM IR (-O2):
define void @clrscr() {
%1 = tail call i32 @syscall1(i32 512)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ udp_emission_init(int);
int /*<<< orphan*/ udp_reception_init(int);
int /*<<< orphan*/ udp_send_int32(int);
int /*<<< orphan*/ usleep(int);
int main() {
  int envoi;
  udp_reception_init(9000);
  udp_emission_init(9000);
  while (1) {
    scanf("%d", &envoi);
    udp_send_int32(envoi);
    usleep(5000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2328,%edi
call   1040 <udp_reception_init@plt>
mov    $0x2328,%edi
call   1060 <udp_emission_init@plt>
lea    0xe86(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <udp_send_int32@plt>
mov    $0x1388,%edi
call   1070 <usleep@plt>
jmp    1173 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2328,%edi
call   1040 <udp_reception_init@plt>
mov    $0x2328,%edi
call   1060 <udp_emission_init@plt>
lea    0xe91(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <udp_send_int32@plt>
mov    $0x1388,%edi
call   1070 <usleep@plt>
jmp    1180 <main+0x30>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @udp_reception_init(i32 9000)
%4 = call i32 @udp_emission_init(i32 9000)
br label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @udp_send_int32(i32 %7)
%9 = call i32 @usleep(i32 5000)
br label %5
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @udp_reception_init(i32 9000)
%4 = tail call i32 @udp_emission_init(i32 9000)
br label %5
5: ; preds = %5, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @udp_send_int32(i32 %7)
%9 = call i32 @usleep(i32 5000)
br label %5
}
void marker_update_probe_range(struct marker *begin, struct marker *end,
                               struct module *probe_module, int *refcount) {}


x86 assembly (clang, -O0):
<marker_update_probe_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.marker = type opaque
%struct.module = type opaque
define void @marker_update_probe_range(%struct.marker* %0, %struct.marker* %1, %struct.module* %2, i32* %3) {
%5 = alloca %struct.marker*
%6 = alloca %struct.marker*
%7 = alloca %struct.module*
%8 = alloca i32*
store %struct.marker* %0, %struct.marker** %5
store %struct.marker* %1, %struct.marker** %6
store %struct.module* %2, %struct.module** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
%struct.marker = type opaque
%struct.module = type opaque
define void @marker_update_probe_range(%struct.marker* nocapture %0, %struct.marker* nocapture %1, %struct.module* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
void test2() {
  int *s = NULL;
  *s = 42;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @test2() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ solve();
int main(int argc, const char *argv[]) {
  init();
  solve();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @solve()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void f(void) {
  int x = 3;
  exit(x);
  x++;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x3,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @exit(i32 3)
unreachable
}
void InitCpp2() {}


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

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

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

LLVM IR (-O2):
define void @InitCpp2() {
ret void
}
/* Variables and functions */
double rand_rect_port();
double drandom(void) { return rand_rect_port(); }


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

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

LLVM IR (-O0):
define double @drandom() {
%1 = call double (...) @rand_rect_port()
ret double %1
}

LLVM IR (-O2):
define double @drandom() {
%1 = tail call double (...) @rand_rect_port()
ret double %1
}
void TimerDMAEnable(unsigned long ulBase, unsigned long ulDMASource) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= ulDMASource;
}


x86 assembly (clang, -O0):
<TimerDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerDMAEnable>:
or     %rsi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @TimerDMAEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerDMAEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help_proc(char **args) {
  printf("*** Be honest with yourself, you don't need help ***\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"*** Be honest with yourself, you don't need help ***\0A\00"
define i32 @help_proc(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [53 x i8] c"*** Be honest with yourself, you don't need help ***\00"
define i32 @help_proc(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ reset(unsigned char *, int);
void bitmapReset(unsigned char *bitmap, int pos) {
  reset(&bitmap[pos / (8 * sizeof(unsigned char))],
        pos % (8 * sizeof(unsigned char)));
}


x86 assembly (clang, -O0):
<bitmapReset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shr    $0x3,%rax
add    %rax,%rdi
movslq -0xc(%rbp),%rax
and    $0x7,%rax
mov    %eax,%esi
call   1030 <reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmapReset>:
movslq %esi,%rsi
mov    %rsi,%rax
shr    $0x3,%rax
add    %rax,%rdi
and    $0x7,%esi
jmp    1030 <reset@plt>

LLVM IR (-O0):
define void @bitmapReset(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 8
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = urem i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = call i32 @reset(i8* %9, i32 %13)
ret void
}

LLVM IR (-O2):
define void @bitmapReset(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = lshr i64 %3, 3
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %1, 7
%7 = tail call i32 @reset(i8* %5, i32 %6)
ret void
}
double comma(double a, double b) {
  a = a;
  return b;
}


x86 assembly (clang, -O0):
<comma>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<comma>:
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @comma(double %0, double returned %1) {
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double, double, double,
                          double);
void mcdis_line(double x1, double y1, double z1, double x2, double y2,
                double z2) {
  printf("MCDISPLAY: multiline(2,%g,%g,%g,%g,%g,%g)\n", x1, y1, z1, x2, y2, z2);
}


x86 assembly (clang, -O0):
<mcdis_line>:
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  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"MCDISPLAY: multiline(2,%g,%g,%g,%g,%g,%g)\0A\00"
define void @mcdis_line(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %13, double %14, double %15, double %16, double %17, double %18)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"MCDISPLAY: multiline(2,%g,%g,%g,%g,%g,%g)\0A\00"
define void @mcdis_line(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %2, double %3, double %4, double %5)
ret void
}
/* Variables and functions */
double floor(double);
double ceil(double d) { return -floor(-d); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <floor@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @llvm.floor.f64(double %4)
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fneg double %3
ret double %4
}
float load_avg() { return -1.0; }


x86 assembly (clang, -O0):
<load_avg>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @load_avg() {
ret float -1.000000e+00
}

LLVM IR (-O2):
define float @load_avg() {
ret float -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *str, int doexit) {
  fprintf(stderr, "spicd: %s\n", str);
  if (doexit)
    exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     115c <error+0x3c>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    1141 <error+0x21>
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"spicd: %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"spicd: %s\0A\00"
define void @error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
unsigned int _strlen(char *str) {
  unsigned int i;
  for (i = 0; str && str[i]; i++)
    ;
  return (i);
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1133 <_strlen+0x33>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1143 <_strlen+0x43>
jmp    1156 <_strlen+0x56>
jmp    1148 <_strlen+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
test   %rdi,%rdi
je     111a <_strlen+0x1a>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add i32 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %4, %3 ]
ret i32 %11
}
void ff_hevc_put_hevc_bi_w_pel_pixels48_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_pel_pixels48_12_sse4() {
ret void
}
int main() {
  int year = 17;
  char a[18] = {"I got it-- printf"};
  char c = 'l';
  printf_EOF("hello world !%s %d", a, 100);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebd(%rip),%ax
mov    %ax,-0x10(%rbp)
movb   $0x6c,-0x21(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x64,%edx
mov    $0x0,%al
call   1030 <printf_EOF@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x66,0x10(%rsp)
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
mov    $0x64,%edx
xor    %eax,%eax
call   1030 <printf_EOF@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [18 x i8] c"I got it-- printf\00"
@.str = [19 x i8] c"hello world !%s %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [18 x i8]
%4 = alloca i8
store i32 0, i32* %1
store i32 17, i32* %2
%5 = bitcast [18 x i8]* %3 to i8*
store i8 108, i8* %4
%6 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @printf_EOF to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6, i32 100)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [18 x i8] c"I got it-- printf\00"
@.str = [19 x i8] c"hello world !%s %d\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @printf_EOF to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2, i32 100)
%4 = call i32 (...) @getchar()
ret i32 0
}
void b_rev(void *x, int n) {
  char *b = x;
  char *e = b + n - 1;
  while (b < e) {
    char t = *b;
    *b++ = *e;
    *e-- = t;
  }
}


x86 assembly (clang, -O0):
<b_rev>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    116d <b_rev+0x6d>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1126 <b_rev+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_rev>:
movslq %esi,%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jbe    113c <b_rev+0x3c>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rdi),%ecx
movzbl (%rax),%edx
mov    %dl,-0x1(%rdi)
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
lea    0x1(%rdi),%rcx
cmp    %rax,%rdi
mov    %rcx,%rdi
jb     1120 <b_rev+0x20>
ret

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

LLVM IR (-O2):
define void @b_rev(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %15
7: ; preds = %2, %7
%8 = phi i8* [ %13, %7 ], [ %5, %2 ]
%9 = phi i8* [ %12, %7 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = load i8, i8* %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %11, i8* %9
store i8 %10, i8* %8
%13 = getelementptr inbounds i8, i8* %8, i64 -1
%14 = icmp ult i8* %12, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
int nid_find(int nid, int *arr, int num) {
  int i;
  if (nid == -1) {
    return (-1);
  }
  for (i = 0; i < num; i++) {
    if (arr[i] == nid) {
      return (i);
    }
  }
  return (-1);
}


x86 assembly (clang, -O0):
<nid_find>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1124 <nid_find+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <nid_find+0x70>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1169 <nid_find+0x69>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1156 <nid_find+0x56>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <nid_find+0x70>
jmp    115b <nid_find+0x5b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112b <nid_find+0x2b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nid_find>:
mov    $0xffffffff,%eax
cmp    $0xffffffff,%edi
je     112e <nid_find+0x2e>
test   %edx,%edx
jle    112e <nid_find+0x2e>
mov    %edx,%edx
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %edi,(%rsi,%rcx,4)
je     112f <nid_find+0x2f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1120 <nid_find+0x20>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @nid_find(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp ne i32 %0, -1
%5 = icmp sgt i32 %2, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %19
7: ; preds = %3
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %7, %14
%10 = phi i64 [ 0, %7 ], [ %15, %14 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %19, label %9
17: ; preds = %9
%18 = trunc i64 %10 to i32
br label %19
19: ; preds = %14, %17, %3
%20 = phi i32 [ -1, %3 ], [ %18, %17 ], [ -1, %14 ]
ret i32 %20
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsumkbn2(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dsumkbn2(N, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1040 <stdlib_strided_dsumkbn2@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dsumkbn2@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsumkbn2(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsumkbn2(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void PrintWelcomeMessage() {
  fprintf(stdout, "%s\n%s\n", "Nova - Copyright (C) 2013 Jan Peter Koenig",
          "This program comes with ABSOLUTELY NO WARRANTY");
}


x86 assembly (clang, -O0):
<PrintWelcomeMessage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xedc(%rip),%rdx
lea    0xf00(%rip),%rcx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintWelcomeMessage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xee0(%rip),%rdx
lea    0xf04(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [43 x i8] c"Nova - Copyright (C) 2013 Jan Peter Koenig\00"
@.str.2 = [47 x i8] c"This program comes with ABSOLUTELY NO WARRANTY\00"
define void @PrintWelcomeMessage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [43 x i8] c"Nova - Copyright (C) 2013 Jan Peter Koenig\00"
@.str.2 = [47 x i8] c"This program comes with ABSOLUTELY NO WARRANTY\00"
define void @PrintWelcomeMessage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int getRocketDelay(int level) {
  switch (level) {
  case 2:
    return 7;
  case 3:
    return 6;
  case 4:
    return 5;
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<getRocketDelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     113d <getRocketDelay+0x3d>
jmp    111b <getRocketDelay+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1149 <getRocketDelay+0x49>
jmp    112c <getRocketDelay+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1155 <getRocketDelay+0x55>
jmp    1161 <getRocketDelay+0x61>
movl   $0x7,-0x4(%rbp)
jmp    1168 <getRocketDelay+0x68>
movl   $0x6,-0x4(%rbp)
jmp    1168 <getRocketDelay+0x68>
movl   $0x5,-0x4(%rbp)
jmp    1168 <getRocketDelay+0x68>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRocketDelay>:
mov    $0x9,%ecx
sub    %edi,%ecx
add    $0xfffffffe,%edi
cmp    $0x3,%edi
mov    $0x4,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getRocketDelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 2, label %5
i32 3, label %6
i32 4, label %7
]
5: ; preds = %1
store i32 7, i32* %2
br label %9
6: ; preds = %1
store i32 6, i32* %2
br label %9
7: ; preds = %1
store i32 5, i32* %2
br label %9
8: ; preds = %1
store i32 4, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @getRocketDelay(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 3
%4 = sub i32 9, %0
%5 = select i1 %3, i32 %4, i32 4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128Timer0AsyncP__TimerAsync__setTimer0Asynchronous();
void Atm128AlarmAsyncP__0__TimerAsync__setTimer0Asynchronous(void) {
  HplAtm128Timer0AsyncP__TimerAsync__setTimer0Asynchronous();
}


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

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

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

LLVM IR (-O2):
define void @Atm128AlarmAsyncP__0__TimerAsync__setTimer0Asynchronous() {
%1 = tail call i32 (...) @HplAtm128Timer0AsyncP__TimerAsync__setTimer0Asynchronous()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CrestCall(int, int);
int /*<<< orphan*/ __CrestReturn(int);
void createCDG(void) {
  {
    __CrestCall(45, 5);
    {
      __CrestReturn(46);
      return;
    }
  }
}


x86 assembly (clang, -O0):
<createCDG>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
mov    $0x5,%esi
call   1040 <__CrestCall@plt>
mov    $0x2e,%edi
call   1030 <__CrestReturn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createCDG>:
push   %rax
mov    $0x2d,%edi
mov    $0x5,%esi
call   1040 <__CrestCall@plt>
mov    $0x2e,%edi
pop    %rax
jmp    1030 <__CrestReturn@plt>

LLVM IR (-O0):
define void @createCDG() {
%1 = call i32 @__CrestCall(i32 45, i32 5)
%2 = call i32 @__CrestReturn(i32 46)
ret void
}

LLVM IR (-O2):
define void @createCDG() {
%1 = tail call i32 @__CrestCall(i32 45, i32 5)
%2 = tail call i32 @__CrestReturn(i32 46)
ret void
}
int e100_init(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define i32 @e100_init() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test12_head() {
  do {
    printf("test12");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test12_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test12_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test12\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test12_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test12\00"
define void @test12_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef scalar_t__ __u32;

/* Variables and functions */
scalar_t__ INT_MAX;
int ethtool_validate_speed(__u32 speed) {
  return speed <= INT_MAX || speed == (__u32)-1;
}


x86 assembly (clang, -O0):
<ethtool_validate_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
mov    0x2ed3(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
jle    112c <ethtool_validate_speed+0x2c>
cmpq   $0xffffffffffffffff,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethtool_validate_speed>:
mov    0x2ee1(%rip),%rax
cmp    %rdi,(%rax)
setge  %al
cmp    $0xffffffffffffffff,%rdi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @ethtool_validate_speed(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @INT_MAX
%5 = icmp sle i64 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = icmp eq i64 %7, -1
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define i32 @ethtool_validate_speed(i64 %0) {
%2 = load i64, i64* @INT_MAX
%3 = icmp sge i64 %2, %0
%4 = icmp eq i64 %0, -1
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void gtk_show_about_dialog() {}


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

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

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

LLVM IR (-O2):
define void @gtk_show_about_dialog() {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t join_64bit_register(uint32_t *buffer, int index) {
  uint64_t result = 0;
  result |= buffer[index];
  result |= (uint64_t)(buffer[index + 1]) << 32;
  return result;
}


x86 assembly (clang, -O0):
<join_64bit_register>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @join_64bit_register(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
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %5
%12 = or i32 %11, %10
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
%18 = load i32, i32* %17
%19 = shl i32 %18, 32
%20 = load i32, i32* %5
%21 = or i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @join_64bit_register(i32* nocapture readnone %0, i32 %1) {
ret i32 poison
}
int f(int i) { return i < (i - 2); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 2
%6 = icmp slt i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 0
}
long add_one(long x) { return x + 1; }


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

x86 assembly (clang, -O2):
<add_one>:
lea    0x1(%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @add_one(i64 %0) {
%2 = add nsw i64 %0, 1
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ dmap_read_u64(char const *);
int64_t dmap_read_i64(const char *buf) { return (int64_t)dmap_read_u64(buf); }


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

x86 assembly (clang, -O2):
<dmap_read_i64>:
jmp    1030 <dmap_read_u64@plt>

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

LLVM IR (-O2):
define i32 @dmap_read_i64(i8* %0) {
%2 = tail call i32 @dmap_read_u64(i8* %0)
ret i32 %2
}