#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 *);
void city() {
  int per, mediasal, mediafilhos, cont, contsal, contfilhos, sal, filhos,
      continua, maiorsal, contper, resposta;
  cont = 0;
  contsal = 0;
  contfilhos = 0;
  continua = 1;
  maiorsal = 0;
  contper = 0;
  while (continua = 1) {
    printf("salario:\n");
    scanf("%d", &sal);
    contsal = contsal + sal;
    if (sal > maiorsal) {
      maiorsal = sal;
    }
    if (sal <= 350) {
      contper++;
    }
    printf("filhos:\n");
    scanf("%d", &filhos);
    contfilhos = contfilhos + filhos;
    printf("continuar? 1 ou 0\n");
    scanf("%d", &resposta);
    cont++;
    if (resposta == 0) {
      continua = 0;
    }
  }
  mediasal = contsal / cont;
  mediafilhos = contfilhos / cont;
  per = contper / 100;
  printf("%d", mediafilhos);
  printf("%d", mediasal);
  printf("%d", maiorsal);
  printf("%d", per);
}


x86 assembly (clang, -O0):
<city>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x1,-0x24(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    1192 <city+0x72>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x15e,-0x1c(%rbp)
jg     11a8 <city+0x88>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe26(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x30(%rbp)
jne    1207 <city+0xe7>
movl   $0x0,-0x24(%rbp)
jmp    1152 <city+0x32>

x86 assembly (clang, -O2):
<city>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rbx
lea    0x14(%rsp),%r15
lea    0xecb(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xec7(%rip),%rbp
lea    0xc(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
jmp    1160 <city+0x40>

LLVM IR (-O0):
@.str = [10 x i8] c"salario:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"filhos:\0A\00"
@.str.3 = [19 x i8] c"continuar? 1 ou 0\0A\00"
define void @city() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 1, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
br label %13
13: ; preds = %44, %0
store i32 1, i32* %9
br label %14
14: ; preds = %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = add nsw i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %7
%21 = load i32, i32* %10
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %14
%24 = load i32, i32* %7
store i32 %24, i32* %10
br label %25
25: ; preds = %23, %14
%26 = load i32, i32* %7
%27 = icmp sle i32 %26, 350
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32, i32* %11
%30 = add nsw i32 %29, 1
store i32 %30, i32* %11
br label %31
31: ; preds = %28, %25
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%34 = load i32, i32* %6
%35 = load i32, i32* %8
%36 = add nsw i32 %34, %35
store i32 %36, i32* %6
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 1
store i32 %40, i32* %4
%41 = load i32, i32* %12
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %31
store i32 0, i32* %9
br label %44
44: ; preds = %43, %31
br label %13
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [9 x i8] c"salario:\00"
@str.4 = [8 x i8] c"filhos:\00"
@str.5 = [18 x i8] c"continuar? 1 ou 0\00"
define void @city() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
br label %7
7: ; preds = %7, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %7
}