#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int read_solution_banner(int /*<<< orphan*/ *, int *, int *);
char *read_solution_string(int /*<<< orphan*/ *, int, int, int);
char *read_solution_banner_and_string(FILE *fp, int k, int *len, int *dim) {
  int fail;
  char *result;
  fail = read_solution_banner(fp, len, dim);
  if (fail == 0)
    result = read_solution_string(fp, k, *len, *dim);
  return result;
}


x86 assembly (clang, -O0):
<read_solution_banner_and_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <read_solution_banner@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1171 <read_solution_banner_and_string+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
call   1030 <read_solution_string@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_solution_banner_and_string>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1040 <read_solution_banner@plt>
test   %eax,%eax
je     114d <read_solution_banner_and_string+0x2d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%edx
mov    (%r15),%ecx
mov    %rbp,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <read_solution_string@plt>

LLVM IR (-O0):
define i8* @read_solution_banner_and_string(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%11 = load i32*, i32** %5
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @read_solution_banner(i32* %11, i32* %12, i32* %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %4
%18 = load i32*, i32** %5
%19 = load i32, i32* %6
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = load i32*, i32** %8
%23 = load i32, i32* %22
%24 = call i8* @read_solution_string(i32* %18, i32 %19, i32 %21, i32 %23)
store i8* %24, i8** %10
br label %25
25: ; preds = %17, %4
%26 = load i8*, i8** %10
ret i8* %26
}

LLVM IR (-O2):
define i8* @read_solution_banner_and_string(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @read_solution_banner(i32* %0, i32* %2, i32* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = tail call i8* @read_solution_string(i32* %0, i32 %1, i32 %8, i32 %9)
br label %11
11: ; preds = %7, %4
%12 = phi i8* [ %10, %7 ], [ undef, %4 ]
ret i8* %12
}