#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*/ read_string(char *);
int be_sure(char *input) {
  do {
    printf("Digite [s] para confirmar ou [n] abortar: ");
    read_string(input);
  } while (*input != 's' && *input != 'n' && *input != 'S' && *input != 'N');
  if (*input == 's' || *input == 'S') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<be_sure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <read_string@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x73,%ecx
mov    %al,-0x11(%rbp)
je     1190 <be_sure+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x6e,%ecx
mov    %al,-0x11(%rbp)
je     1190 <be_sure+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x53,%ecx
mov    %al,-0x11(%rbp)
je     1190 <be_sure+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4e,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    112c <be_sure+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
je     11bb <be_sure+0x9b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x53,%eax
jne    11c7 <be_sure+0xa7>
movl   $0x1,-0x4(%rbp)
jmp    11ce <be_sure+0xae>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_sure>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed1(%rip),%r14
movabs $0x2100000021,%r15
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <read_string@plt>
movzbl (%rbx),%ecx
lea    -0x4e(%rcx),%eax
cmp    $0x25,%al
ja     1140 <be_sure+0x20>
movzbl %al,%eax
bt     %rax,%r15
jae    1140 <be_sure+0x20>
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x53,%cl
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Digite [s] para confirmar ou [n] abortar: \00"
define i32 @be_sure(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %28, %1
%5 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 @read_string(i8* %6)
br label %8
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 115
br i1 %12, label %13, label %28
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 110
br i1 %17, label %18, label %28
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 83
br i1 %22, label %23, label %28
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 78
br label %28
28: ; preds = %23, %18, %13, %8
%29 = phi i1 [ false, %18 ], [ false, %13 ], [ false, %8 ], [ %27, %23 ]
br i1 %29, label %4, label %30
30: ; preds = %28
%31 = load i8*, i8** %3
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 115
br i1 %34, label %40, label %35
35: ; preds = %30
%36 = load i8*, i8** %3
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 83
br i1 %39, label %40, label %41
40: ; preds = %35, %30
store i32 1, i32* %2
br label %42
41: ; preds = %35
store i32 0, i32* %2
br label %42
42: ; preds = %41, %40
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
@.str = [43 x i8] c"Digite [s] para confirmar ou [n] abortar: \00"
define i32 @be_sure(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @read_string(i8* %0)
%5 = load i8, i8* %0
switch i8 %5, label %2 [
i8 115, label %6
i8 110, label %6
i8 83, label %6
i8 78, label %6
]
6: ; preds = %2, %2, %2, %2
%7 = and i8 %5, -33
%8 = icmp eq i8 %7, 83
%9 = zext i1 %8 to i32
ret i32 %9
}