#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 /*<<< orphan*/ pinentry_emacs_init();
int /*<<< orphan*/ pinentry_init(char *);
scalar_t__ pinentry_loop();
int /*<<< orphan*/ pinentry_parse_opts(int, char **);
int main(int argc, char *argv[]) {
  pinentry_init("pinentry-emacs");
  pinentry_parse_opts(argc, argv);
  if (!pinentry_emacs_init())
    return 1;
  if (pinentry_loop())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <pinentry_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pinentry_parse_opts@plt>
mov    $0x0,%al
call   1060 <pinentry_emacs_init@plt>
cmp    $0x0,%eax
jne    118a <main+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    11ae <main+0x6e>
mov    $0x0,%al
call   1050 <pinentry_loop@plt>
cmp    $0x0,%rax
je     11a7 <main+0x67>
movl   $0x1,-0x4(%rbp)
jmp    11ae <main+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
call   1040 <pinentry_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <pinentry_parse_opts@plt>
xor    %eax,%eax
call   1060 <pinentry_emacs_init@plt>
test   %eax,%eax
je     117d <main+0x3d>
xor    %eax,%eax
call   1050 <pinentry_loop@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1182 <main+0x42>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"pinentry-emacs\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @pinentry_init(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @pinentry_parse_opts(i32 %7, i8** %8)
%10 = call i32 (...) @pinentry_emacs_init()
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 1, i32* %3
br label %18
13: ; preds = %2
%14 = call i64 (...) @pinentry_loop()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %3
br label %18
17: ; preds = %13
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [15 x i8] c"pinentry-emacs\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @pinentry_init(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @pinentry_parse_opts(i32 %0, i8** %1)
%5 = tail call i32 (...) @pinentry_emacs_init()
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i64 (...) @pinentry_loop()
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ 1, %2 ], [ %10, %7 ]
ret i32 %12
}