#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 */
struct url_stat {
  int dummy;
};
struct url {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fetchFreeURL(struct url *);
struct url *fetchParseURL(char const *);
int fetchStat(struct url *, struct url_stat *, char const *);
int fetchStatURL(const char *URL, struct url_stat *us, const char *flags) {
  struct url *u;
  int s;
  if ((u = fetchParseURL(URL)) == NULL)
    return (-1);
  s = fetchStat(u, us, flags);
  fetchFreeURL(u);
  return (s);
}


x86 assembly (clang, -O0):
<fetchStatURL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fetchParseURL@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1167 <fetchStatURL+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    118a <fetchStatURL+0x5a>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <fetchStat@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <fetchFreeURL@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetchStatURL>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <fetchParseURL@plt>
test   %rax,%rax
je     1166 <fetchStatURL+0x36>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <fetchStat@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <fetchFreeURL@plt>
mov    %ebp,%eax
jmp    116b <fetchStatURL+0x3b>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.url_stat = type { i32 }
%struct.url = type { i32 }
define i32 @fetchStatURL(i8* %0, %struct.url_stat* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.url_stat*
%7 = alloca i8*
%8 = alloca %struct.url*
%9 = alloca i32
store i8* %0, i8** %5
store %struct.url_stat* %1, %struct.url_stat** %6
store i8* %2, i8** %7
%10 = load i8*, i8** %5
%11 = call %struct.url* @fetchParseURL(i8* %10)
store %struct.url* %11, %struct.url** %8
%12 = icmp eq %struct.url* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 -1, i32* %4
br label %22
14: ; preds = %3
%15 = load %struct.url*, %struct.url** %8
%16 = load %struct.url_stat*, %struct.url_stat** %6
%17 = load i8*, i8** %7
%18 = call i32 @fetchStat(%struct.url* %15, %struct.url_stat* %16, i8* %17)
store i32 %18, i32* %9
%19 = load %struct.url*, %struct.url** %8
%20 = call i32 @fetchFreeURL(%struct.url* %19)
%21 = load i32, i32* %9
store i32 %21, i32* %4
br label %22
22: ; preds = %14, %13
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.url_stat = type { i32 }
%struct.url = type { i32 }
define i32 @fetchStatURL(i8* %0, %struct.url_stat* %1, i8* %2) {
%4 = tail call %struct.url* @fetchParseURL(i8* %0)
%5 = icmp eq %struct.url* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fetchStat(%struct.url* %4, %struct.url_stat* %1, i8* %2)
%8 = tail call i32 @fetchFreeURL(%struct.url* %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %10
}