#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) {
  register int s = 0;
  if (f != 0 || anycb() == 0 ||
      (s = mlyesno("Modified buffers exist. Leave anyway")) == 1) {
    vttidy();
    exit(0);
  }
  mlwrite("");
  return (s);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1195 <quit+0x45>
mov    $0x0,%al
call   1070 <anycb@plt>
cmp    $0x0,%rax
je     1195 <quit+0x45>
lea    0xe7c(%rip),%rdi
call   1040 <mlyesno@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x1,%eax
jne    11a3 <quit+0x53>
mov    $0x0,%al
call   1050 <vttidy@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe7a(%rip),%rdi
call   1030 <mlwrite@plt>
mov    -0x8(%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    0xea9(%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 = [37 x i8] c"Modified buffers exist. Leave anyway\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @quit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = call i64 (...) @anycb()
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = call i32 @mlyesno(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %3
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %9, %6, %1
%13 = call i32 (...) @vttidy()
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %9
%16 = call i32 @mlwrite(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %3
ret i32 %17
}

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