#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 */
int EOF;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
prompt() {
  register int c;
  for (;;) {
    (void)printf("re-edit the password file? [y]: ");
    (void)fflush(stdout);
    c = getchar();
    if (c != EOF && c != (int)'\n')
      while (getchar() != (int)'\n')
        ;
    return (c == (int)'n');
  }
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%eax
je     1197 <prompt+0x67>
cmpl   $0xa,-0x4(%rbp)
je     1197 <prompt+0x67>
jmp    117d <prompt+0x4d>
mov    $0x0,%al
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1192 <prompt+0x62>
jmp    117d <prompt+0x4d>
jmp    1197 <prompt+0x67>
cmpl   $0x6e,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    $0xa,%eax
je     117c <prompt+0x4c>
mov    0x2e88(%rip),%rax
cmp    (%rax),%ebx
je     117c <prompt+0x4c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1170 <prompt+0x40>
xor    %eax,%eax
cmp    $0x6e,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"re-edit the password file? [y]: \00"
@stdout = global i32 0
@EOF = global i32 0
define i32 @prompt() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 (...) @getchar()
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i32, i32* %1
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %19
13: ; preds = %10
br label %14
14: ; preds = %17, %13
%15 = call i32 (...) @getchar()
%16 = icmp ne i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %14
br label %14
18: ; preds = %14
br label %19
19: ; preds = %18, %10, %2
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, 110
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
@.str = [33 x i8] c"re-edit the password file? [y]: \00"
@stdout = global i32 0
@EOF = global i32 0
define i32 @prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @getchar()
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
%7 = icmp ne i32 %4, 10
%8 = and i1 %7, %6
br i1 %8, label %9, label %12
9: ; preds = %0, %9
%10 = tail call i32 (...) @getchar()
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %9
12: ; preds = %9, %0
%13 = icmp eq i32 %4, 110
%14 = zext i1 %13 to i32
ret i32 %14
}