#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ getchar();
int isprime(int);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  float x = 11.3;
  float y = isprime('a');
  printf("y = %f", y);
  getchar();
  int k, n;
  n = 0;
  for (k = 2; k <= 1000; k++)
    if (isprime(k) == 1) {
      printf("%5d", k);
      n++;
      if (n % 6 == 0)
        printf("\n");
    }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xec0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x61,%edi
call   1050 <isprime@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jg     11f6 <main+0xc6>
mov    -0xc(%rbp),%edi
call   1050 <isprime@plt>
cmp    $0x1,%eax
jne    11e3 <main+0xb3>
mov    -0xc(%rbp),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11de <main+0xae>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e3 <main+0xb3>
jmp    11e8 <main+0xb8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <main+0x54>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x61,%edi
call   1060 <isprime@plt>
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    $0x2,%ebx
lea    0xe90(%rip),%r14
xor    %ebp,%ebp
jmp    118b <main+0x4b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x3e9,%ebx
je     11c6 <main+0x86>
mov    %ebx,%edi
call   1060 <isprime@plt>
cmp    $0x1,%eax
jne    1180 <main+0x40>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
imul   $0xaaaaaaab,%ebp,%eax
add    $0x2aaaaaaa,%eax
ror    %eax
cmp    $0x2aaaaaaa,%eax
ja     1180 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1180 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <getchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"y = %f\00"
@.str.1 = [4 x i8] c"%5d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store float 0x40269999A0000000, float* %1
%5 = call i32 @isprime(i32 97)
%6 = sitofp i32 %5 to float
store float %6, float* %2
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call i32 (...) @getchar()
store i32 0, i32* %4
store i32 2, i32* %3
br label %11
11: ; preds = %30, %0
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 1000
br i1 %13, label %14, label %33
14: ; preds = %11
%15 = load i32, i32* %3
%16 = call i32 @isprime(i32 %15)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = srem i32 %23, 6
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %18
br label %29
29: ; preds = %28, %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %11
33: ; preds = %11
%34 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"y = %f\00"
@.str.1 = [4 x i8] c"%5d\00"
define void @main() {
%1 = tail call i32 @isprime(i32 97)
%2 = sitofp i32 %1 to float
%3 = fpext float %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call i32 (...) @getchar()
br label %6
6: ; preds = %0, %18
%7 = phi i32 [ 0, %0 ], [ %19, %18 ]
%8 = phi i32 [ 2, %0 ], [ %20, %18 ]
%9 = tail call i32 @isprime(i32 %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %18
11: ; preds = %6
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%13 = add nsw i32 %7, 1
%14 = srem i32 %13, 6
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = tail call i32 @putchar(i32 10)
br label %18
18: ; preds = %6, %16, %11
%19 = phi i32 [ %13, %16 ], [ %13, %11 ], [ %7, %6 ]
%20 = add nuw nsw i32 %8, 1
%21 = icmp eq i32 %20, 1001
br i1 %21, label %22, label %6
22: ; preds = %18
%23 = tail call i32 (...) @getchar()
ret void
}