#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*/ time_t;
struct chirp_stat {
  int dummy;
};
struct chirp_client {
  int dummy;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ chirp_client_fstat_begin(struct chirp_client *, scalar_t__,
                                    struct chirp_stat *, int /*<<< orphan*/);
scalar_t__ chirp_client_fstat_finish(struct chirp_client *, scalar_t__,
                                     struct chirp_stat *, int /*<<< orphan*/);
int64_t chirp_client_fstat(struct chirp_client *c, int64_t fd,
                           struct chirp_stat *info, time_t stoptime) {
  int64_t result = chirp_client_fstat_begin(c, fd, info, stoptime);
  if (result >= 0)
    return chirp_client_fstat_finish(c, fd, info, stoptime);
  return result;
}


x86 assembly (clang, -O0):
<chirp_client_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <chirp_client_fstat_begin@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jl     1177 <chirp_client_fstat+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <chirp_client_fstat_finish@plt>
mov    %rax,-0x8(%rbp)
jmp    117f <chirp_client_fstat+0x5f>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_fstat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <chirp_client_fstat_begin@plt>
test   %rax,%rax
js     1158 <chirp_client_fstat+0x38>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <chirp_client_fstat_finish@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
%struct.chirp_stat = type { i32 }
define i64 @chirp_client_fstat(%struct.chirp_client* %0, i64 %1, %struct.chirp_stat* %2, i32 %3) {
%5 = alloca i64
%6 = alloca %struct.chirp_client*
%7 = alloca i64
%8 = alloca %struct.chirp_stat*
%9 = alloca i32
%10 = alloca i64
store %struct.chirp_client* %0, %struct.chirp_client** %6
store i64 %1, i64* %7
store %struct.chirp_stat* %2, %struct.chirp_stat** %8
store i32 %3, i32* %9
%11 = load %struct.chirp_client*, %struct.chirp_client** %6
%12 = load i64, i64* %7
%13 = load %struct.chirp_stat*, %struct.chirp_stat** %8
%14 = load i32, i32* %9
%15 = call i64 @chirp_client_fstat_begin(%struct.chirp_client* %11, i64 %12, %struct.chirp_stat* %13, i32 %14)
store i64 %15, i64* %10
%16 = load i64, i64* %10
%17 = icmp sge i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %4
%19 = load %struct.chirp_client*, %struct.chirp_client** %6
%20 = load i64, i64* %7
%21 = load %struct.chirp_stat*, %struct.chirp_stat** %8
%22 = load i32, i32* %9
%23 = call i64 @chirp_client_fstat_finish(%struct.chirp_client* %19, i64 %20, %struct.chirp_stat* %21, i32 %22)
store i64 %23, i64* %5
br label %26
24: ; preds = %4
%25 = load i64, i64* %10
store i64 %25, i64* %5
br label %26
26: ; preds = %24, %18
%27 = load i64, i64* %5
ret i64 %27
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
%struct.chirp_stat = type { i32 }
define i64 @chirp_client_fstat(%struct.chirp_client* %0, i64 %1, %struct.chirp_stat* %2, i32 %3) {
%5 = tail call i64 @chirp_client_fstat_begin(%struct.chirp_client* %0, i64 %1, %struct.chirp_stat* %2, i32 %3)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i64 @chirp_client_fstat_finish(%struct.chirp_client* %0, i64 %1, %struct.chirp_stat* %2, i32 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i64 [ %8, %7 ], [ %5, %4 ]
ret i64 %10
}