void Quit(void) {
  int term;
  char path[1024 + 1];
  char *p;
  term = InputChoise("quit ytree (Y/N) ?", "YNQq\r\033");
  if (term == 'Y' || term == 'Q' || term == 'q') {
    if ((p = getenv("HOME"))) {
      sprintf(path, "%s%c%s", p, '/', ".ytree-hst");
      SaveHistory(path);
    }
    endwin();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<Quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
lea    0xe8e(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1050 <InputChoise@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x59,-0x4(%rbp)
je     11a1 <Quit+0x41>
cmpl   $0x51,-0x4(%rbp)
je     11a1 <Quit+0x41>
cmpl   $0x71,-0x4(%rbp)
jne    1206 <Quit+0xa6>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <getenv@plt>
cltq
mov    %rax,-0x418(%rbp)
cmp    $0x0,%rax
je     11f8 <Quit+0x98>
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
lea    0xe48(%rip),%rsi
mov    $0x2f,%ecx
lea    0xe43(%rip),%r8
mov    $0x0,%al
call   1070 <sprintf@plt>
lea    -0x410(%rbp),%rdi
mov    $0x0,%al
call   1040 <SaveHistory@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %edi,%edi
call   1080 <exit@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Quit>:
push   %rbx
sub    $0x410,%rsp
lea    0xe91(%rip),%rdi
lea    0xe9d(%rip),%rsi
xor    %eax,%eax
call   1050 <InputChoise@plt>
add    $0xffffffaf,%eax
cmp    $0x20,%eax
ja     1195 <Quit+0x35>
movabs $0x100000101,%rcx
bt     %rax,%rcx
jb     119e <Quit+0x3e>
add    $0x410,%rsp
pop    %rbx
ret
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1030 <getenv@plt>
test   %eax,%eax
je     11dd <Quit+0x7d>
movslq %eax,%rdx
lea    0xe65(%rip),%rsi
lea    0xe65(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2f,%ecx
xor    %eax,%eax
call   1070 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <SaveHistory@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"quit ytree (Y/N) ?\00"
@.str.1 = [7 x i8] c"YNQq\0D\1B\00"
@.str.2 = [5 x i8] c"HOME\00"
@.str.3 = [7 x i8] c"%s%c%s\00"
@.str.4 = [11 x i8] c".ytree-hst\00"
define void @Quit() {
%1 = alloca i32
%2 = alloca [1025 x i8]
%3 = alloca i8*
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @InputChoise to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 89
br i1 %6, label %13, label %7
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 81
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 113
br i1 %12, label %13, label %26
13: ; preds = %10, %7, %0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %3
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%20 = load i8*, i8** %3
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %20, i32 47, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%22 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @SaveHistory to i32 (i8*, ...)*)(i8* %22)
br label %24
24: ; preds = %18, %13
%25 = call i32 (...) @endwin()
unreachable
26: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"quit ytree (Y/N) ?\00"
@.str.1 = [7 x i8] c"YNQq\0D\1B\00"
@.str.2 = [5 x i8] c"HOME\00"
@.str.3 = [7 x i8] c"%s%c%s\00"
@.str.4 = [11 x i8] c".ytree-hst\00"
define void @Quit() {
%1 = alloca [1025 x i8]
%2 = getelementptr inbounds [1025 x i8], [1025 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @InputChoise to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
switch i32 %3, label %14 [
i32 113, label %4
i32 89, label %4
i32 81, label %4
]
4: ; preds = %0, %0, %0
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = inttoptr i64 %8 to i8*
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 47, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @SaveHistory to i32 (i8*, ...)*)(i8* %2)
br label %12
12: ; preds = %7, %4
%13 = call i32 (...) @endwin()
unreachable
14: ; preds = %0
ret void
}