#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 */
scalar_t__ anycb();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mlwrite(char *);
int mlyesno(char *);
int /*<<< orphan*/ vttidy();
int quit(int f, int n) {
  int s;
  if (f != 0 || anycb() == 0 || (s = mlyesno("Quit without saving")) == 1) {
    vttidy();
    exit(0);
  }
  mlwrite("");
  return (s);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1191 <quit+0x41>
mov    $0x0,%al
call   1070 <anycb@plt>
cmp    $0x0,%rax
je     1191 <quit+0x41>
lea    0xe80(%rip),%rdi
call   1040 <mlyesno@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x1,%eax
jne    119f <quit+0x4f>
mov    $0x0,%al
call   1050 <vttidy@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe6d(%rip),%rdi
call   1030 <mlwrite@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit>:
push   %rbx
test   %edi,%edi
jne    1184 <quit+0x34>
xor    %eax,%eax
call   1070 <anycb@plt>
test   %rax,%rax
je     1184 <quit+0x34>
lea    0xe98(%rip),%rdi
call   1040 <mlyesno@plt>
cmp    $0x1,%eax
je     1184 <quit+0x34>
mov    %eax,%ebx
lea    0xe98(%rip),%rdi
call   1030 <mlwrite@plt>
mov    %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1050 <vttidy@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Quit without saving\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @quit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = call i64 (...) @anycb()
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = call i32 @mlyesno(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %5
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11, %8, %2
%15 = call i32 (...) @vttidy()
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %11
%18 = call i32 @mlwrite(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@.str = [20 x i8] c"Quit without saving\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @quit(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = tail call i64 (...) @anycb()
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @mlyesno(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %7, %4, %2
%11 = tail call i32 (...) @vttidy()
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %7
%14 = tail call i32 @mlwrite(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 %8
}