#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 */
struct command_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pop_unfinished_command();
int /*<<< orphan*/ setn_edit_line(char *, int /*<<< orphan*/);
scalar_t__ words_imatch(char **, char *);
char *yes_verify(char **end, struct command_arg *arg) {
  if (words_imatch(end, "no")) {
    pop_unfinished_command();
    return "Aborted.";
  } else if (words_imatch(end, "yes"))
    return 0;
  else {
    setn_edit_line("", 0);
    return "Please answer yes or no.";
  }
}


x86 assembly (clang, -O0):
<yes_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <words_imatch@plt>
cmp    $0x0,%rax
je     1171 <yes_verify+0x41>
mov    $0x0,%al
call   1030 <pop_unfinished_command@plt>
lea    0xe9b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b1 <yes_verify+0x81>
mov    -0x10(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1050 <words_imatch@plt>
cmp    $0x0,%rax
je     1198 <yes_verify+0x68>
movq   $0x0,-0x8(%rbp)
jmp    11b1 <yes_verify+0x81>
lea    0xe6c(%rip),%rdi
xor    %esi,%esi
call   1040 <setn_edit_line@plt>
lea    0xe63(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yes_verify>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1050 <words_imatch@plt>
test   %rax,%rax
je     1155 <yes_verify+0x25>
xor    %eax,%eax
call   1030 <pop_unfinished_command@plt>
lea    0xeb0(%rip),%rax
pop    %rbx
ret
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <words_imatch@plt>
test   %rax,%rax
je     116d <yes_verify+0x3d>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe97(%rip),%rdi
xor    %esi,%esi
call   1040 <setn_edit_line@plt>
lea    0xe8e(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.command_arg = type { i32 }
@.str = [3 x i8] c"no\00"
@.str.1 = [9 x i8] c"Aborted.\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [25 x i8] c"Please answer yes or no.\00"
define i8* @yes_verify(i8** %0, %struct.command_arg* %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca %struct.command_arg*
store i8** %0, i8*** %4
store %struct.command_arg* %1, %struct.command_arg** %5
%6 = load i8**, i8*** %4
%7 = call i64 @words_imatch(i8** %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @pop_unfinished_command()
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %18
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = call i64 @words_imatch(i8** %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i8* null, i8** %3
br label %18
16: ; preds = %11
%17 = call i32 @setn_edit_line(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %18
18: ; preds = %16, %15, %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
%struct.command_arg = type { i32 }
@.str = [3 x i8] c"no\00"
@.str.1 = [9 x i8] c"Aborted.\00"
@.str.2 = [4 x i8] c"yes\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [25 x i8] c"Please answer yes or no.\00"
define i8* @yes_verify(i8** %0, %struct.command_arg* nocapture readnone %1) {
%3 = tail call i64 @words_imatch(i8** %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @pop_unfinished_command()
br label %12
7: ; preds = %2
%8 = tail call i64 @words_imatch(i8** %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @setn_edit_line(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %12
12: ; preds = %7, %10, %5
%13 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), %10 ], [ null, %7 ]
ret i8* %13
}