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

/* Variables and functions */
int /*<<< orphan*/ fetchFreeURL(struct url *);
struct url_ent *fetchList(struct url *, char const *);
struct url *fetchParseURL(char const *);
struct url_ent *fetchListURL(const char *URL, const char *flags) {
  struct url *u;
  struct url_ent *ue;
  if ((u = fetchParseURL(URL)) == NULL)
    return (NULL);
  ue = fetchList(u, flags);
  fetchFreeURL(u);
  return (ue);
}


x86 assembly (clang, -O0):
<fetchListURL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fetchParseURL@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1164 <fetchListURL+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1186 <fetchListURL+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fetchList@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <fetchFreeURL@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetchListURL>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <fetchParseURL@plt>
test   %rax,%rax
je     115f <fetchListURL+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <fetchList@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <fetchFreeURL@plt>
mov    %r14,%rax
jmp    1161 <fetchListURL+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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