#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() {
  char elenco[20][30];
  int cont = 0;
  for (int i = 0; i < 20; i++, cont++) {
    printf("\nindique um menbro do elenco ,se quiser sair escreva apenas a "
           "letra S");
    scanf("%29s", &elenco[i][0]);
    if (elenco[i][0] == 'S' && elenco[i][1] == '\0')
      break;
  }
  for (int i = 0; i < cont; i++)
    printf("\nElenco: %s", elenco[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x264(%rbp)
movl   $0x0,-0x268(%rbp)
cmpl   $0x14,-0x268(%rbp)
jge    11f2 <main+0xd2>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x268(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x268(%rbp),%rcx
lea    -0x260(%rbp),%rax
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
cmp    $0x53,%eax
jne    11ca <main+0xaa>
movslq -0x268(%rbp),%rcx
lea    -0x260(%rbp),%rax
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    11ca <main+0xaa>
jmp    11f2 <main+0xd2>
jmp    11cf <main+0xaf>
mov    -0x268(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x268(%rbp)
mov    -0x264(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x264(%rbp)
jmp    1146 <main+0x26>
movl   $0x0,-0x26c(%rbp)
mov    -0x26c(%rbp),%eax
cmp    -0x264(%rbp),%eax
jge    1245 <main+0x125>
movslq -0x26c(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x26c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x26c(%rbp)
jmp    11fc <main+0xdc>
mov    -0x4(%rbp),%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x258,%rsp
mov    %rsp,%rbx
lea    0xec8(%rip),%r14
lea    0xf07(%rip),%r15
xor    %r12d,%r12d
jmp    115e <main+0x3e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffffffffffff,%r12
add    $0x1e,%rbx
cmp    $0xffffffffffffffec,%r12
je     1188 <main+0x68>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpb   $0x53,(%rbx)
jne    1150 <main+0x30>
cmpb   $0x0,0x1(%rbx)
jne    1150 <main+0x30>
test   %r12d,%r12d
je     11b7 <main+0x97>
neg    %r12
jmp    118e <main+0x6e>
mov    $0x14,%r12d
mov    %rsp,%rbx
lea    0xeb3(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1e,%rbx
add    $0xffffffffffffffff,%r12
jne    11a0 <main+0x80>
xor    %eax,%eax
add    $0x258,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [70 x i8] c"\0Aindique um menbro do elenco ,se quiser sair escreva apenas a letra S\00"
@.str.1 = [5 x i8] c"%29s\00"
@.str.2 = [12 x i8] c"\0AElenco: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [30 x i8]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %33, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 20
br i1 %8, label %9, label %38
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %12
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %13, i64 0, i64 0
%15 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %17
%19 = getelementptr inbounds [30 x i8], [30 x i8]* %18, i64 0, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 83
br i1 %22, label %23, label %32
23: ; preds = %9
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %25
%27 = getelementptr inbounds [30 x i8], [30 x i8]* %26, i64 0, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %23
br label %38
32: ; preds = %23, %9
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %6
38: ; preds = %31, %6
store i32 0, i32* %5
br label %39
39: ; preds = %49, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %3
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %52
43: ; preds = %39
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %45
%47 = getelementptr inbounds [30 x i8], [30 x i8]* %46, i64 0, i64 0
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %43
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %39
52: ; preds = %39
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
@.str = [70 x i8] c"\0Aindique um menbro do elenco ,se quiser sair escreva apenas a letra S\00"
@.str.1 = [5 x i8] c"%29s\00"
@.str.2 = [12 x i8] c"\0AElenco: %s\00"
define i32 @main() {
%1 = alloca [20 x [30 x i8]]
%2 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %1, i64 0, i64 0, i64 0
br label %3
3: ; preds = %0, %14
%4 = phi i64 [ 0, %0 ], [ %15, %14 ]
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %1, i64 0, i64 %4, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 83
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %1, i64 0, i64 %4, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %3, %10
%15 = add nuw nsw i64 %4, 1
%16 = icmp eq i64 %15, 20
br i1 %16, label %20, label %3
17: ; preds = %10
%18 = trunc i64 %4 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %14, %17
%21 = phi i64 [ %4, %17 ], [ 20, %14 ]
%22 = and i64 %21, 4294967295
br label %24
23: ; preds = %24, %17
ret i32 0
24: ; preds = %20, %24
%25 = phi i64 [ 0, %20 ], [ %28, %24 ]
%26 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %1, i64 0, i64 %25, i64 0
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = add nuw nsw i64 %25, 1
%29 = icmp eq i64 %28, %22
br i1 %29, label %23, label %24
}