#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  int idade = 0, old = 0, oldest = 0, young = 0, youngest = 0,
      idade_anterior = 0;
  char nome[50], oldest_name[50], youngest_name[50];
  int i = 0, j;
  while (idade >= 0) {
    i++;
    for (j = 0; j < strlen(nome) - 1; j++) {
      youngest_name[j] = nome[j];
    }
    if (oldest > idade) {
      oldest = idade;
      strcpy(oldest_name, nome);
    }
    fgets(nome, 50, stdin);
    scanf("%d", &idade);
  }
  printf("Oldest Name: %s\n", oldest_name);
  printf("Oldest Age: %d\n", oldest);
  printf("Youngest Name: %s\n", youngest_name);
  printf("Youngest Age: %d\n", youngest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0xd4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     125c <main+0x10c>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
movl   $0x0,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
mov    %eax,-0xdc(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0xdc(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    120e <main+0xbe>
movslq -0xd8(%rbp),%rax
mov    -0x50(%rbp,%rax,1),%cl
movslq -0xd8(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    11b9 <main+0x69>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1230 <main+0xe0>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
mov    0x2dad(%rip),%rax
mov    (%rax),%edx
mov    $0x32,%esi
call   1060 <fgets@plt>
lea    0xdb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
jmp    1196 <main+0x46>
lea    -0x90(%rbp),%rsi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xd0(%rbp),%rsi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
movl   $0x0,0xc(%rsp)
xor    %r14d,%r14d
lea    0x90(%rsp),%rbx
lea    0xe85(%rip),%r12
lea    0xc(%rsp),%r13
jmp    11b8 <main+0x68>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x2e51(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1060 <fgets@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
js     120f <main+0xbf>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jl     11f4 <main+0xa4>
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
movzbl 0x90(%rsp,%r15,1),%eax
mov    %al,0x10(%rsp,%r15,1)
add    $0x1,%r15
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%r15
jl     11d0 <main+0x80>
mov    0xc(%rsp),%ebp
cmp    %ebp,%r14d
jle    1190 <main+0x40>
lea    0x50(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %ebp,%r14d
jmp    1190 <main+0x40>
lea    0xded(%rip),%rdi
lea    0x50(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdeb(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdea(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdea(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [17 x i8] c"Oldest Name: %s\0A\00"
@.str.2 = [16 x i8] c"Oldest Age: %d\0A\00"
@.str.3 = [19 x i8] c"Youngest Name: %s\0A\00"
@.str.4 = [18 x i8] c"Youngest Age: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [50 x i8]
%9 = alloca [50 x i8]
%10 = alloca [50 x i8]
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %11
br label %13
13: ; preds = %45, %0
%14 = load i32, i32* %2
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %50
16: ; preds = %13
%17 = load i32, i32* %11
%18 = add nsw i32 %17, 1
store i32 %18, i32* %11
store i32 0, i32* %12
br label %19
19: ; preds = %33, %16
%20 = load i32, i32* %12
%21 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = sub nsw i32 %22, 1
%24 = icmp slt i32 %20, %23
br i1 %24, label %25, label %36
25: ; preds = %19
%26 = load i32, i32* %12
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = load i32, i32* %12
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 %31
store i8 %29, i8* %32
br label %33
33: ; preds = %25
%34 = load i32, i32* %12
%35 = add nsw i32 %34, 1
store i32 %35, i32* %12
br label %19
36: ; preds = %19
%37 = load i32, i32* %4
%38 = load i32, i32* %2
%39 = icmp sgt i32 %37, %38
br i1 %39, label %40, label %45
40: ; preds = %36
%41 = load i32, i32* %2
store i32 %41, i32* %4
%42 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%43 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%44 = call i32 @strcpy(i8* %42, i8* %43)
br label %45
45: ; preds = %40, %36
%46 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%47 = load i32, i32* @stdin
%48 = call i32 @fgets(i8* %46, i32 50, i32 %47)
%49 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %13
50: ; preds = %13
%51 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %51)
%53 = load i32, i32* %4
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %55)
%57 = load i32, i32* %6
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %57)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [17 x i8] c"Oldest Name: %s\0A\00"
@.str.2 = [16 x i8] c"Oldest Age: %d\0A\00"
@.str.3 = [19 x i8] c"Youngest Name: %s\0A\00"
@.str.4 = [18 x i8] c"Youngest Age: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [50 x i8]
%4 = alloca [50 x i8]
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
br label %9
9: ; preds = %0, %28
%10 = phi i32 [ %29, %28 ], [ 0, %0 ]
%11 = call i32 @strlen(i8* %6)
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %23
13: ; preds = %9, %13
%14 = phi i64 [ %18, %13 ], [ 0, %9 ]
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %14
store i8 %16, i8* %17
%18 = add nuw nsw i64 %14, 1
%19 = call i32 @strlen(i8* %6)
%20 = add nsw i32 %19, -1
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %18, %21
br i1 %22, label %13, label %23
23: ; preds = %13, %9
%24 = load i32, i32* %1
%25 = icmp sgt i32 %10, %24
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @strcpy(i8* %7, i8* %6)
br label %28
28: ; preds = %26, %23
%29 = phi i32 [ %24, %26 ], [ %10, %23 ]
%30 = load i32, i32* @stdin
%31 = call i32 @fgets(i8* %6, i32 50, i32 %30)
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%33 = load i32, i32* %1
%34 = icmp sgt i32 %33, -1
br i1 %34, label %9, label %35
35: ; preds = %28
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 0)
ret i32 0
}