#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 *, char *);
int main(void) {
  char nome[3][30];
  float valorPaciente[3];
  printf("Particular:\n");
  printf("O valor da consulta e de R$ 450,00: \n");
  float valorTotal = 0;
  int i;
  for (i = 0; i < 3; i++) {
    printf("Digite o nome do paciente:");
    scanf("%30s", nome[i]);
    valorPaciente[i] = 450.00;
    valorTotal += valorPaciente[i];
  }
  int qtdPaciente = i - 1;
  printf("A quantidade de pacientes particulas foi: %i \n", qtdPaciente);
  printf("o valor total de hoje foi: %.2f\n", valorTotal);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x3,-0x74(%rbp)
jge    11c4 <main+0xa4>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x74(%rbp),%rax
lea    -0x60(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
lea    0xec7(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x74(%rbp),%rax
movss  0xe64(%rip),%xmm0
movss  %xmm0,-0x6c(%rbp,%rax,4)
movslq -0x74(%rbp),%rax
movss  -0x6c(%rbp,%rax,4),%xmm0
addss  -0x70(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    115d <main+0x3d>
mov    -0x74(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1e(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe81(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
movsd  0xe3e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Particular:\0A\00"
@.str.1 = [38 x i8] c"O valor da consulta e de R$ 450,00: \0A\00"
@.str.2 = [27 x i8] c"Digite o nome do paciente:\00"
@.str.3 = [5 x i8] c"%30s\00"
@.str.4 = [47 x i8] c"A quantidade de pacientes particulas foi: %i \0A\00"
@.str.5 = [33 x i8] c"o valor total de hoje foi: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [30 x i8]]
%3 = alloca [3 x float]
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
store float 0.000000e+00, float* %4
store i32 0, i32* %5
br label %9
9: ; preds = %28, %0
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %31
12: ; preds = %9
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x [30 x i8]], [3 x [30 x i8]]* %2, i64 0, i64 %15
%17 = getelementptr inbounds [30 x i8], [30 x i8]* %16, i64 0, i64 0
%18 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 %20
store float 4.500000e+02, float* %21
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 %23
%25 = load float, float* %24
%26 = load float, float* %4
%27 = fadd float %26, %25
store float %27, float* %4
br label %28
28: ; preds = %12
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %9
31: ; preds = %9
%32 = load i32, i32* %5
%33 = sub nsw i32 %32, 1
store i32 %33, i32* %6
%34 = load i32, i32* %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = load float, float* %4
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), double %37)
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
@.str.2 = [27 x i8] c"Digite o nome do paciente:\00"
@.str.3 = [5 x i8] c"%30s\00"
@.str.4 = [47 x i8] c"A quantidade de pacientes particulas foi: %i \0A\00"
@.str.5 = [33 x i8] c"o valor total de hoje foi: %.2f\0A\00"
@str = [12 x i8] c"Particular:\00"
@str.6 = [37 x i8] c"O valor da consulta e de R$ 450,00: \00"
define i32 @main() {
%1 = alloca [3 x [30 x i8]]
%2 = getelementptr inbounds [3 x [30 x i8]], [3 x [30 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [3 x [30 x i8]], [3 x [30 x i8]]* %1, i64 0, i64 1, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [3 x [30 x i8]], [3 x [30 x i8]]* %1, i64 0, i64 2, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), i32 2)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), double 1.350000e+03)
ret i32 0
}