#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 getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char const *, char *);
bool check_force(const char *arg, const char *message) {
  if (arg && strcmp(arg, "force"))
    return true;
  else {
    int c;
    printf("%s ? [y/N] ", message);
    c = getc(stdin);
    if (c == 'y')
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<check_force>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1171 <check_force+0x41>
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1171 <check_force+0x41>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <check_force+0x84>
mov    -0x18(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x79,-0x1c(%rbp)
jne    11a8 <check_force+0x78>
movl   $0x1,-0x4(%rbp)
jmp    11b4 <check_force+0x84>
jmp    11ad <check_force+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_force>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     1154 <check_force+0x24>
lea    0xec0(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1154 <check_force+0x24>
pop    %rbx
ret
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x79,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"force\00"
@.str.1 = [12 x i8] c"%s ? [y/N] \00"
@stdin = global i32 0
define i32 @check_force(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %3
br label %24
14: ; preds = %9, %2
%15 = load i8*, i8** %5
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @stdin
%18 = call i32 @getc(i32 %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 121
br i1 %20, label %21, label %22
21: ; preds = %14
store i32 1, i32* %3
br label %24
22: ; preds = %14
br label %23
23: ; preds = %22
store i32 0, i32* %3
br label %24
24: ; preds = %23, %21, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [6 x i8] c"force\00"
@.str.1 = [12 x i8] c"%s ? [y/N] \00"
@stdin = global i32 0
define i32 @check_force(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4, %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%9 = load i32, i32* @stdin
%10 = tail call i32 @getc(i32 %9)
%11 = icmp eq i32 %10, 121
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ 1, %4 ], [ %12, %7 ]
ret i32 %14
}