#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*/ chomp(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int are_you_sure(void) {
  char answer[8] = "n";
  printf("%s [%s]: ", "are you sure ? (y/n)", answer);
  fgets(answer, 8, stdin);
  chomp(answer);
  return (0 == strcmp(answer, "y")) ? (!(0)) : (0);
}


x86 assembly (clang, -O0):
<are_you_sure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdx
lea    0xeaa(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
mov    0x2e73(%rip),%rax
mov    (%rax),%edx
mov    $0x8,%esi
call   1040 <fgets@plt>
lea    -0x8(%rbp),%rdi
call   1060 <chomp@plt>
lea    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<are_you_sure>:
push   %rbx
sub    $0x10,%rsp
movq   $0x6e,0x8(%rsp)
lea    0xeab(%rip),%rdi
lea    0xeae(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1060 <chomp@plt>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.are_you_sure.answer = [8 x i8] c"n\00\00\00\00\00\00\00"
@.str = [10 x i8] c"%s [%s]: \00"
@.str.1 = [21 x i8] c"are you sure ? (y/n)\00"
@stdin = global i32 0
@.str.2 = [2 x i8] c"y\00"
define i32 @are_you_sure() {
%1 = alloca [8 x i8]
%2 = bitcast [8 x i8]* %1 to i8*
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 8, i32 %6)
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%9 = call i32 @chomp(i8* %8)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 0, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
ret i32 %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s [%s]: \00"
@.str.1 = [21 x i8] c"are you sure ? (y/n)\00"
@stdin = global i32 0
@.str.2 = [2 x i8] c"y\00"
define i32 @are_you_sure() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 110, i64* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 8, i32 %4)
%6 = call i32 @chomp(i8* %2)
%7 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}