#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 *, ...);
int main() {
  char c;
  float i, p, soma = 0;
  printf("digite n para entrar no programa e s para sair.\n\ndigite a letra "
         "que deseja :");
  scanf("%c", &c);
  while (c == 'n' && c != 's') {
    printf("\n\ndigite a idade:");
    scanf("%f", &i);
    printf("\n\ndigite peso:");
    scanf("%f", &p);
    printf("\n\ndigite n para continuar ou s para sair:");
    scanf(" %c", &c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x6e,%ecx
mov    %al,-0x15(%rbp)
jne    1174 <main+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0x73,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1184 <main+0x64>
jmp    11e3 <main+0xc3>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    1155 <main+0x35>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5b(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpb   $0x6e,0xf(%rsp)
jne    11cc <main+0xac>
lea    0xf04(%rip),%rbx
lea    0xf00(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xf03(%rip),%rbp
lea    0xf26(%rip),%r14
lea    0xf(%rsp),%r15
nopw   0x0(%rax,%rax,1)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbp,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpb   $0x6e,0xf(%rsp)
je     1180 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [77 x i8] c"digite n para entrar no programa e s para sair.\0A\0Adigite a letra que deseja :\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [18 x i8] c"\0A\0Adigite a idade:\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [15 x i8] c"\0A\0Adigite peso:\00"
@.str.5 = [42 x i8] c"\0A\0Adigite n para continuar ou s para sair:\00"
@.str.6 = [4 x i8] c" %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %18, %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 110
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 115
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ false, %8 ], [ %15, %12 ]
br i1 %17, label %18, label %25
18: ; preds = %16
%19 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%23 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %2)
br label %8
25: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [77 x i8] c"digite n para entrar no programa e s para sair.\0A\0Adigite a letra que deseja :\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [18 x i8] c"\0A\0Adigite a idade:\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [15 x i8] c"\0A\0Adigite peso:\00"
@.str.5 = [42 x i8] c"\0A\0Adigite n para continuar ou s para sair:\00"
@.str.6 = [4 x i8] c" %c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = load i8, i8* %1
%9 = icmp eq i8 %8, 110
br i1 %9, label %10, label %19
10: ; preds = %0, %10
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %1)
%17 = load i8, i8* %1
%18 = icmp eq i8 %17, 110
br i1 %18, label %10, label %19
19: ; preds = %10, %0
ret i32 0
}