#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 */
long lopt(int, char **, char);
char *scan(int, char **, char, char *);
char *getout(int argc, char *argv[], long *iget) {
  char *fout;
  *iget = 0;
  fout = scan(argc, argv, 'o', "");
  if (fout[0] != '\0')
    return fout;
  *iget = lopt(argc, argv, 'o');
  return fout;
}


x86 assembly (clang, -O0):
<getout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x6f,%edx
lea    0xeaf(%rip),%rcx
call   1030 <scan@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <getout+0x57>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    119a <getout+0x7a>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x6f,%edx
call   1040 <lopt@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getout>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
movq   $0x0,(%rdx)
lea    0xec3(%rip),%rcx
mov    $0x6f,%edx
call   1030 <scan@plt>
mov    %rax,%rbx
cmpb   $0x0,(%rax)
jne    1161 <getout+0x41>
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x6f,%edx
call   1040 <lopt@plt>
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getout(i32 %0, i8** %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i64*
%8 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i64* %2, i64** %7
%9 = load i64*, i64** %7
store i64 0, i64* %9
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = call i8* @scan(i32 %10, i8** %11, i8 signext 111, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = load i8*, i8** %8
store i8* %19, i8** %4
br label %26
20: ; preds = %3
%21 = load i32, i32* %5
%22 = load i8**, i8*** %6
%23 = call i64 @lopt(i32 %21, i8** %22, i8 signext 111)
%24 = load i64*, i64** %7
store i64 %23, i64* %24
%25 = load i8*, i8** %8
store i8* %25, i8** %4
br label %26
26: ; preds = %20, %18
%27 = load i8*, i8** %4
ret i8* %27
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getout(i32 %0, i8** %1, i64* nocapture writeonly %2) {
store i64 0, i64* %2
%4 = tail call i8* @scan(i32 %0, i8** %1, i8 signext 111, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i64 @lopt(i32 %0, i8** %1, i8 signext 111)
store i64 %8, i64* %2
br label %9
9: ; preds = %3, %7
ret i8* %4
}