#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 meexit(int);
int /*<<< orphan*/ mlerase();
int mlyesno(char *);
quit(int f, int n) {
  register int status;
  if (f != 0 || anycb() == 0 ||
      (status = mlyesno("Modified buffers exist. Leave anyway")) == 1) {
    if (f)
      status = meexit(n);
    else
      status = meexit(0);
  }
  mlerase();
  return (status);
}


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    1181 <quit+0x41>
mov    $0x0,%al
call   1060 <anycb@plt>
cmp    $0x0,%rax
je     1181 <quit+0x41>
lea    0xe90(%rip),%rdi
call   1040 <mlyesno@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x1,%eax
jne    11aa <quit+0x6a>
cmpl   $0x0,-0x4(%rbp)
je     119b <quit+0x5b>
mov    -0x8(%rbp),%edi
call   1030 <meexit@plt>
mov    %eax,-0xc(%rbp)
jmp    11a5 <quit+0x65>
xor    %edi,%edi
call   1030 <meexit@plt>
mov    %eax,-0xc(%rbp)
jmp    11aa <quit+0x6a>
mov    $0x0,%al
call   1050 <mlerase@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
test   %edi,%edi
je     1162 <quit+0x22>
mov    %ebx,%edi
call   1030 <meexit@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <mlerase@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <anycb@plt>
test   %rax,%rax
je     1149 <quit+0x9>
lea    0xe89(%rip),%rdi
call   1040 <mlyesno@plt>
mov    %eax,%ebp
cmp    $0x1,%eax
je     1149 <quit+0x9>
jmp    1152 <quit+0x12>

LLVM IR (-O0):
@.str = [37 x i8] c"Modified buffers exist. Leave anyway\00"
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 ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %5
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %23
14: ; preds = %11, %8, %2
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %4
%19 = call i32 @meexit(i32 %18)
store i32 %19, i32* %5
br label %22
20: ; preds = %14
%21 = call i32 @meexit(i32 0)
store i32 %21, i32* %5
br label %22
22: ; preds = %20, %17
br label %23
23: ; preds = %22, %11
%24 = call i32 (...) @mlerase()
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
@.str = [37 x i8] c"Modified buffers exist. Leave anyway\00"
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 ([37 x i8], [37 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 = phi i32 [ %1, %2 ], [ 0, %4 ], [ 0, %7 ]
%12 = tail call i32 @meexit(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i32 [ %8, %7 ], [ %12, %10 ]
%15 = tail call i32 (...) @mlerase()
ret i32 %14
}