#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 ic_symbol {
  int dummy;
};
struct ic_expr_func_call {
  int dummy;
};

/* Variables and functions */
struct ic_symbol *ic_expr_func_call_get_symbol(struct ic_expr_func_call *);
int /*<<< orphan*/ puts(char *);
struct ic_symbol *ic_expr_func_call_get_name(struct ic_expr_func_call *fcall) {
  struct ic_symbol *sym = 0;
  if (!fcall) {
    puts("ic_expr_func_call_get_name: fcall was null");
    return 0;
  }
  sym = ic_expr_func_call_get_symbol(fcall);
  if (!sym) {
    puts("ic_expr_func_call_get_name: call to ic_expr_func_call_get_symbol "
         "failed");
    return 0;
  }
  return sym;
}


x86 assembly (clang, -O0):
<ic_expr_func_call_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <ic_expr_func_call_get_name+0x38>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,-0x8(%rbp)
jmp    1191 <ic_expr_func_call_get_name+0x71>
mov    -0x10(%rbp),%rdi
call   1040 <ic_expr_func_call_get_symbol@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1189 <ic_expr_func_call_get_name+0x69>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,-0x8(%rbp)
jmp    1191 <ic_expr_func_call_get_name+0x71>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_expr_func_call_get_name>:
push   %rax
test   %rdi,%rdi
je     1132 <ic_expr_func_call_get_name+0x12>
call   1040 <ic_expr_func_call_get_symbol@plt>
test   %rax,%rax
je     113b <ic_expr_func_call_get_name+0x1b>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
jmp    1142 <ic_expr_func_call_get_name+0x22>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ic_symbol = type { i32 }
%struct.ic_expr_func_call = type { i32 }
@.str = [43 x i8] c"ic_expr_func_call_get_name: fcall was null\00"
@.str.1 = [72 x i8] c"ic_expr_func_call_get_name: call to ic_expr_func_call_get_symbol failed\00"
define %struct.ic_symbol* @ic_expr_func_call_get_name(%struct.ic_expr_func_call* %0) {
%2 = alloca %struct.ic_symbol*
%3 = alloca %struct.ic_expr_func_call*
%4 = alloca %struct.ic_symbol*
store %struct.ic_expr_func_call* %0, %struct.ic_expr_func_call** %3
store %struct.ic_symbol* null, %struct.ic_symbol** %4
%5 = load %struct.ic_expr_func_call*, %struct.ic_expr_func_call** %3
%6 = icmp ne %struct.ic_expr_func_call* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
store %struct.ic_symbol* null, %struct.ic_symbol** %2
br label %18
9: ; preds = %1
%10 = load %struct.ic_expr_func_call*, %struct.ic_expr_func_call** %3
%11 = call %struct.ic_symbol* @ic_expr_func_call_get_symbol(%struct.ic_expr_func_call* %10)
store %struct.ic_symbol* %11, %struct.ic_symbol** %4
%12 = load %struct.ic_symbol*, %struct.ic_symbol** %4
%13 = icmp ne %struct.ic_symbol* %12, null
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = call i32 @puts(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.1, i64 0, i64 0))
store %struct.ic_symbol* null, %struct.ic_symbol** %2
br label %18
16: ; preds = %9
%17 = load %struct.ic_symbol*, %struct.ic_symbol** %4
store %struct.ic_symbol* %17, %struct.ic_symbol** %2
br label %18
18: ; preds = %16, %14, %7
%19 = load %struct.ic_symbol*, %struct.ic_symbol** %2
ret %struct.ic_symbol* %19
}

LLVM IR (-O2):
%struct.ic_symbol = type { i32 }
%struct.ic_expr_func_call = type { i32 }
@.str = [43 x i8] c"ic_expr_func_call_get_name: fcall was null\00"
@.str.1 = [72 x i8] c"ic_expr_func_call_get_name: call to ic_expr_func_call_get_symbol failed\00"
define %struct.ic_symbol* @ic_expr_func_call_get_name(%struct.ic_expr_func_call* %0) {
%2 = icmp eq %struct.ic_expr_func_call* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call %struct.ic_symbol* @ic_expr_func_call_get_symbol(%struct.ic_expr_func_call* %0)
%5 = icmp eq %struct.ic_symbol* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3, %1
%7 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([72 x i8], [72 x i8]* @.str.1, i64 0, i64 0), %3 ]
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %6, %3
%10 = phi %struct.ic_symbol* [ %4, %3 ], [ null, %6 ]
ret %struct.ic_symbol* %10
}