#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 subraster_struct {
  int dummy;
};
struct mathchardef_struct {
  int dummy;
};

/* Variables and functions */
struct subraster_struct *get_symsubraster(char *symbol, int size) {
  struct subraster_struct *sp = NULL, *get_charsubraster();
  struct mathchardef_struct *symdef = NULL, *get_symdef();
  if (symbol != NULL)
    symdef = get_symdef(symbol);
  if (symdef != NULL)
    sp = get_charsubraster(symdef, size);
  return (sp);
}


x86 assembly (clang, -O0):
<get_symsubraster>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <get_symsubraster+0x39>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <get_symdef@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1176 <get_symsubraster+0x56>
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <get_charsubraster@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_symsubraster>:
push   %rbx
test   %rdi,%rdi
je     1141 <get_symsubraster+0x21>
mov    %esi,%ebx
xor    %eax,%eax
call   1040 <get_symdef@plt>
test   %rax,%rax
je     1141 <get_symsubraster+0x21>
mov    %rax,%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <get_charsubraster@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.subraster_struct = type { i32 }
%struct.mathchardef_struct = type { i32 }
define %struct.subraster_struct* @get_symsubraster(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.subraster_struct*
%6 = alloca %struct.mathchardef_struct*
store i8* %0, i8** %3
store i32 %1, i32* %4
store %struct.subraster_struct* null, %struct.subraster_struct** %5
store %struct.mathchardef_struct* null, %struct.mathchardef_struct** %6
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call %struct.mathchardef_struct* (i8*, ...) bitcast (%struct.mathchardef_struct* (...)* @get_symdef to %struct.mathchardef_struct* (i8*, ...)*)(i8* %10)
store %struct.mathchardef_struct* %11, %struct.mathchardef_struct** %6
br label %12
12: ; preds = %9, %2
%13 = load %struct.mathchardef_struct*, %struct.mathchardef_struct** %6
%14 = icmp ne %struct.mathchardef_struct* %13, null
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load %struct.mathchardef_struct*, %struct.mathchardef_struct** %6
%17 = load i32, i32* %4
%18 = call %struct.subraster_struct* (%struct.mathchardef_struct*, i32, ...) bitcast (%struct.subraster_struct* (...)* @get_charsubraster to %struct.subraster_struct* (%struct.mathchardef_struct*, i32, ...)*)(%struct.mathchardef_struct* %16, i32 %17)
store %struct.subraster_struct* %18, %struct.subraster_struct** %5
br label %19
19: ; preds = %15, %12
%20 = load %struct.subraster_struct*, %struct.subraster_struct** %5
ret %struct.subraster_struct* %20
}

LLVM IR (-O2):
%struct.subraster_struct = type { i32 }
%struct.mathchardef_struct = type { i32 }
define %struct.subraster_struct* @get_symsubraster(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call %struct.mathchardef_struct* (i8*, ...) bitcast (%struct.mathchardef_struct* (...)* @get_symdef to %struct.mathchardef_struct* (i8*, ...)*)(i8* %0)
%6 = icmp eq %struct.mathchardef_struct* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call %struct.subraster_struct* (%struct.mathchardef_struct*, i32, ...) bitcast (%struct.subraster_struct* (...)* @get_charsubraster to %struct.subraster_struct* (%struct.mathchardef_struct*, i32, ...)*)(%struct.mathchardef_struct* %5, i32 %1)
br label %9
9: ; preds = %2, %7, %4
%10 = phi %struct.subraster_struct* [ %8, %7 ], [ null, %4 ], [ null, %2 ]
ret %struct.subraster_struct* %10
}