#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");
  if (!pinentry_emacs_init())
    return 1;
  pinentry_parse_opts(argc, argv);
  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    $0x0,%al
call   1060 <pinentry_emacs_init@plt>
cmp    $0x0,%eax
jne    117e <main+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    11ae <main+0x6e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pinentry_parse_opts@plt>
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>
xor    %eax,%eax
call   1060 <pinentry_emacs_init@plt>
test   %eax,%eax
je     117d <main+0x3d>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <pinentry_parse_opts@plt>
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 = call i32 (...) @pinentry_emacs_init()
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 1, i32* %3
br label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @pinentry_parse_opts(i32 %11, i8** %12)
%14 = call i64 (...) @pinentry_loop()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %18
17: ; preds = %10
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16, %9
%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_emacs_init()
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @pinentry_parse_opts(i32 %0, i8** %1)
%8 = tail call i64 (...) @pinentry_loop()
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 1, %2 ], [ %10, %6 ]
ret i32 %12
}