#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*/ abort();
char *f();
char *g();
main() {
  const char *s = f();
  if (s[0] != 'f' || s[1])
    abort();
  s = g();
  if (s[0] != 'g' || s[1])
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x66,%eax
jne    116b <main+0x3b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1172 <main+0x42>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <g@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x67,%eax
jne    119e <main+0x6e>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     11a5 <main+0x75>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmpb   $0x66,(%rax)
jne    1159 <main+0x29>
cmpb   $0x0,0x1(%rax)
jne    1159 <main+0x29>
xor    %eax,%eax
call   1050 <g@plt>
cmpb   $0x67,(%rax)
jne    1159 <main+0x29>
cmpb   $0x0,0x1(%rax)
jne    1159 <main+0x29>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @f()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 102
br i1 %8, label %15, label %9
9: ; preds = %0
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9, %0
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %9
%18 = call i8* (...) @g()
store i8* %18, i8** %2
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 103
br i1 %23, label %30, label %24
24: ; preds = %17
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %24, %17
%31 = call i32 (...) @abort()
unreachable
32: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @f()
%2 = load i8, i8* %1
%3 = icmp eq i8 %2, 102
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4, %0
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %4
%11 = tail call i8* (...) @g()
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 103
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14, %10
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %14
ret i32 0
}