#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*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ parse(int *);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stderr;
int main(void) {
  bool ret;
  if (parse(&ret) != 0) {
    fprintf(stderr, "failed to parse\n");
    return 1;
  }
  printf("%c\n", ret ? 't' : 'f');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <parse@plt>
cmp    $0x0,%rax
je     1173 <main+0x43>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    119c <main+0x6c>
mov    -0x8(%rbp),%edx
mov    $0x66,%eax
mov    $0x74,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xe84(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <parse@plt>
test   %rax,%rax
je     115c <main+0x2c>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
cmpl   $0x0,0x4(%rsp)
mov    $0x66,%eax
mov    $0x74,%esi
cmove  %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"failed to parse\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 @parse(i32* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %15
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 116, i32 102
%13 = trunc i32 %12 to i8
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %13)
store i32 0, i32* %1
br label %15
15: ; preds = %8, %5
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"failed to parse\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @parse(i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %13
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8 102, i8 116
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %11)
br label %13
13: ; preds = %8, %5
%14 = phi i32 [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}