#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 /*<<< orphan*/ scanf(char *, float *);
int main() {
  float d_t, d_a = 0;
  int i;
  do {
    printf("entre com a vantagem da tartaruga em metros: ");
    scanf("%f", &d_t);
  } while (d_t <= 0);
  for (i = 0; d_t > d_a; i++) {
    d_t = d_t + 1;
    d_a = d_a + 10;
  }
  printf("Aquiles ultrapassará a tartaruga em %d segundos\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jae    1137 <main+0x17>
movl   $0x0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11aa <main+0x8a>
movss  0xe84(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe6e(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1169 <main+0x49>
mov    -0x10(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%r14
lea    0xf03(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1140 <main+0x20>
xor    %esi,%esi
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1196 <main+0x76>
xor    %esi,%esi
movss  0xe89(%rip),%xmm2
movss  0xe85(%rip),%xmm3
nop
addss  %xmm2,%xmm0
addss  %xmm3,%xmm1
add    $0x1,%esi
ucomiss %xmm1,%xmm0
ja     1180 <main+0x60>
movss  %xmm0,0xc(%rsp)
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"entre com a vantagem da tartaruga em metros: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [50 x i8] c"Aquiles ultrapassar\C3\A1 a tartaruga em %d segundos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %3
br label %5
5: ; preds = %8, %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
br label %8
8: ; preds = %5
%9 = load float, float* %2
%10 = fcmp ole float %9, 0.000000e+00
br i1 %10, label %5, label %11
11: ; preds = %8
store i32 0, i32* %4
br label %12
12: ; preds = %21, %11
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load float, float* %2
%18 = fadd float %17, 1.000000e+00
store float %18, float* %2
%19 = load float, float* %3
%20 = fadd float %19, 1.000000e+01
store float %20, float* %3
br label %21
21: ; preds = %16
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %12
24: ; preds = %12
%25 = load i32, i32* %4
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [46 x i8] c"entre com a vantagem da tartaruga em metros: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [50 x i8] c"Aquiles ultrapassar\C3\A1 a tartaruga em %d segundos\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fcmp ugt float %6, 0.000000e+00
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = fcmp ogt float %6, 0.000000e+00
br i1 %9, label %10, label %19
10: ; preds = %8, %10
%11 = phi i32 [ %16, %10 ], [ 0, %8 ]
%12 = phi float [ %15, %10 ], [ 0.000000e+00, %8 ]
%13 = phi float [ %14, %10 ], [ %6, %8 ]
%14 = fadd float %13, 1.000000e+00
%15 = fadd float %12, 1.000000e+01
%16 = add nuw nsw i32 %11, 1
%17 = fcmp ogt float %14, %15
br i1 %17, label %10, label %18
18: ; preds = %10
store float %14, float* %1
br label %19
19: ; preds = %18, %8
%20 = phi i32 [ %16, %18 ], [ 0, %8 ]
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %20)
ret i32 0
}