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


x86 assembly (clang, -O0):
<pw_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1190 <pw_prompt+0x50>
mov    -0x4(%rbp),%eax
mov    0x2e60(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    11a0 <pw_prompt+0x60>
jmp    11af <pw_prompt+0x6f>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    116f <pw_prompt+0x2f>
cmpl   $0x6e,-0x8(%rbp)
jne    11c6 <pw_prompt+0x86>
xor    %eax,%eax
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <pw_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pw_prompt>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebp
cmp    $0xa,%eax
je     1190 <pw_prompt+0x50>
mov    0x2e76(%rip),%rbx
cmp    (%rbx),%ebp
je     1190 <pw_prompt+0x50>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     1190 <pw_prompt+0x50>
cmp    (%rbx),%eax
jne    1180 <pw_prompt+0x40>
cmp    $0x6e,%ebp
jne    11a6 <pw_prompt+0x66>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <pw_error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 void @pw_prompt() {
%1 = alloca i32
%2 = alloca i32
%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
store i32 %6, i32* %2
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %16, label %18
16: ; preds = %14
%17 = call i32 (...) @getchar()
store i32 %17, i32* %1
br label %7
18: ; preds = %14
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 110
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @pw_error(i32* null, i32 0, i32 0)
br label %23
23: ; preds = %21, %18
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"re-edit the password file? [y]: \00"
@stdout = global i32 0
@EOF = global i32 0
define void @pw_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 = icmp ne i32 %4, 10
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %15
9: ; preds = %0, %9
%10 = tail call i32 (...) @getchar()
%11 = icmp ne i32 %10, 10
%12 = load i32, i32* @EOF
%13 = icmp ne i32 %10, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %9, label %15
15: ; preds = %9, %0
%16 = icmp eq i32 %4, 110
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = tail call i32 @pw_error(i32* null, i32 0, i32 0)
br label %19
19: ; preds = %17, %15
ret void
}