#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*/ printf(char *);
int sin(float);
int main() {
  float t, a;
  int s, b;
  b = 0;
  for (t = 0; t < 40; t += .25) {
    a = 26 + 25 * sin(t);
    for (s = 0; s < a; s++)
      printf(" ");
    if (b == 0) {
      printf("Hello\n");
      b = 1;
    } else {
      printf("World\n");
      b = 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeba(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11fa <main+0xda>
movss  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
imul   $0x19,%eax,%eax
add    $0x1a,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    119d <main+0x7d>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1170 <main+0x50>
cmpl   $0x0,-0x14(%rbp)
jne    11bf <main+0x9f>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    11d2 <main+0xb2>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
jmp    11d7 <main+0xb7>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe20(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xorps  %xmm0,%xmm0
xor    %ebx,%ebx
lea    0xecb(%rip),%r14
lea    0xebe(%rip),%r15
jmp    117b <main+0x4b>
nopl   0x0(%rax)
test   %ebx,%ebx
mov    %r15,%rdi
cmove  %r14,%rdi
xor    $0x1,%ebx
call   1040 <puts@plt>
movss  (%rsp),%xmm0
addss  0xe92(%rip),%xmm0
movss  0xe8e(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    11d4 <main+0xa4>
movss  %xmm0,(%rsp)
call   1050 <sin@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%ecx
cmp    $0xffffffe7,%ecx
jl     1150 <main+0x20>
lea    (%rax,%rax,4),%eax
add    $0x1a,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
add    $0x1,%ebp
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
ja     11b0 <main+0x80>
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [7 x i8] c"Hello\0A\00"
@.str.2 = [7 x i8] c"World\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store float 0.000000e+00, float* %2
br label %6
6: ; preds = %33, %0
%7 = load float, float* %2
%8 = fcmp olt float %7, 4.000000e+01
br i1 %8, label %9, label %38
9: ; preds = %6
%10 = load float, float* %2
%11 = call i32 @sin(float %10)
%12 = mul nsw i32 25, %11
%13 = add nsw i32 26, %12
%14 = sitofp i32 %13 to float
store float %14, float* %3
store i32 0, i32* %4
br label %15
15: ; preds = %22, %9
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to float
%18 = load float, float* %3
%19 = fcmp olt float %17, %18
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %15
25: ; preds = %15
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %5
br label %32
30: ; preds = %25
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %32
32: ; preds = %30, %28
br label %33
33: ; preds = %32
%34 = load float, float* %2
%35 = fpext float %34 to double
%36 = fadd double %35, 2.500000e-01
%37 = fptrunc double %36 to float
store float %37, float* %2
br label %6
38: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"World\00"
@str.3 = [6 x i8] c"Hello\00"
define i32 @main() {
br label %1
1: ; preds = %0, %15
%2 = phi i32 [ 0, %0 ], [ %18, %15 ]
%3 = phi float [ 0.000000e+00, %0 ], [ %20, %15 ]
%4 = tail call i32 @sin(float %3)
%5 = mul nsw i32 %4, 25
%6 = add nsw i32 %5, 26
%7 = sitofp i32 %6 to float
%8 = icmp sgt i32 %5, -26
br i1 %8, label %9, label %15
9: ; preds = %1, %9
%10 = phi i32 [ %12, %9 ], [ 0, %1 ]
%11 = tail call i32 @putchar(i32 32)
%12 = add nuw nsw i32 %10, 1
%13 = sitofp i32 %12 to float
%14 = fcmp olt float %13, %7
br i1 %14, label %9, label %15
15: ; preds = %9, %1
%16 = icmp eq i32 %2, 0
%17 = select i1 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%18 = xor i32 %2, 1
%19 = tail call i32 @puts(i8* dereferenceable(1) %17)
%20 = fadd float %3, 2.500000e-01
%21 = fcmp olt float %20, 4.000000e+01
br i1 %21, label %1, label %22
22: ; preds = %15
ret i32 0
}