#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 *);
int main() {
  char nome1[256], nome2[256];
  int sal1, sal2;
  printf("Quem do casal ganha mais?\n");
  printf("Digite o nome da primeira pessoa e seu salario\n");
  scanf("%s", &nome1, &sal1);
  printf("Digite o nome da segunda pessoa e seu salario\n");
  scanf("%s"
        "%d",
        &nome2, &sal2);
  if (sal1 > sal2) {
    printf("Quem ganha mais e o %s e quem ganha menos recebe %d", nome1, sal2);
  } else {
    printf("Quem ganha mais e o %s e quem ganha menos recebe %d", nome2, sal1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xeef(%rip),%rdi
lea    -0x214(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x210(%rbp),%rsi
lea    0xef9(%rip),%rdi
lea    -0x218(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x214(%rbp),%eax
cmp    -0x218(%rbp),%eax
jle    11c2 <main+0xa2>
lea    -0x110(%rbp),%rsi
mov    -0x218(%rbp),%edx
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
lea    -0x210(%rbp),%rsi
mov    -0x214(%rbp),%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x218,%rsp
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
lea    0x110(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%eax
lea    0xe6f(%rip),%rdi
cmp    %eax,%edx
jle    11a9 <main+0x79>
lea    0x110(%rsp),%rsi
mov    %eax,%edx
jmp    11ae <main+0x7e>
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x218,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Quem do casal ganha mais?\0A\00"
@.str.1 = [48 x i8] c"Digite o nome da primeira pessoa e seu salario\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [47 x i8] c"Digite o nome da segunda pessoa e seu salario\0A\00"
@.str.4 = [5 x i8] c"%s%d\00"
@.str.5 = [52 x i8] c"Quem ganha mais e o %s e quem ganha menos recebe %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%8 = bitcast [256 x i8]* %2 to i8**
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %8, i32* %4)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%11 = bitcast [256 x i8]* %3 to i8**
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %11, i32* %5)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %0
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%18 = load i32, i32* %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %17, i32 %18)
br label %24
20: ; preds = %0
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %21, i32 %22)
br label %24
24: ; preds = %20, %16
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"%s\00"
@.str.4 = [5 x i8] c"%s%d\00"
@.str.5 = [52 x i8] c"Quem ganha mais e o %s e quem ganha menos recebe %d\00"
@str = [26 x i8] c"Quem do casal ganha mais?\00"
@str.6 = [47 x i8] c"Digite o nome da primeira pessoa e seu salario\00"
@str.7 = [46 x i8] c"Digite o nome da segunda pessoa e seu salario\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.6, i64 0, i64 0))
%11 = bitcast [256 x i8]* %1 to i8**
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %11, i32* %3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.7, i64 0, i64 0))
%14 = bitcast [256 x i8]* %2 to i8**
%15 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %14, i32* %4)
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %5, i32 %17)
br label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0), i8* %6, i32 %16)
br label %23
23: ; preds = %21, %19
ret i32 0
}