#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 vsofont {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _vsofont_billboard_spherical_cheat_apply(float, float,
                                                            float);
int /*<<< orphan*/ _vsofont_write_string(struct vsofont *, unsigned char *);
int /*<<< orphan*/ glPopMatrix();
int vsofont_write_string_billboard(struct vsofont *font, char *s, float x,
                                   float y, float z) {
  if (font == NULL || s == NULL)
    return 0;
  _vsofont_billboard_spherical_cheat_apply(x, y, z);
  _vsofont_write_string(font, (unsigned char *)s);
  glPopMatrix();
  return 1;
}


x86 assembly (clang, -O0):
<vsofont_write_string_billboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
movss  %xmm2,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <vsofont_write_string_billboard+0x35>
cmpq   $0x0,-0x18(%rbp)
jne    1171 <vsofont_write_string_billboard+0x41>
movl   $0x0,-0x4(%rbp)
jmp    11a0 <vsofont_write_string_billboard+0x70>
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
call   1030 <_vsofont_billboard_spherical_cheat_apply@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <_vsofont_write_string@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsofont_write_string_billboard>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1162 <vsofont_write_string_billboard+0x32>
mov    %rsi,%r14
test   %rsi,%rsi
je     1162 <vsofont_write_string_billboard+0x32>
mov    %rdi,%rbx
call   1030 <_vsofont_billboard_spherical_cheat_apply@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <_vsofont_write_string@plt>
xor    %eax,%eax
call   1040 <glPopMatrix@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.vsofont = type { i32 }
define i32 @vsofont_write_string_billboard(%struct.vsofont* %0, i8* %1, float %2, float %3, float %4) {
%6 = alloca i32
%7 = alloca %struct.vsofont*
%8 = alloca i8*
%9 = alloca float
%10 = alloca float
%11 = alloca float
store %struct.vsofont* %0, %struct.vsofont** %7
store i8* %1, i8** %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
%12 = load %struct.vsofont*, %struct.vsofont** %7
%13 = icmp eq %struct.vsofont* %12, null
br i1 %13, label %17, label %14
14: ; preds = %5
%15 = load i8*, i8** %8
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %14, %5
store i32 0, i32* %6
br label %27
18: ; preds = %14
%19 = load float, float* %9
%20 = load float, float* %10
%21 = load float, float* %11
%22 = call i32 @_vsofont_billboard_spherical_cheat_apply(float %19, float %20, float %21)
%23 = load %struct.vsofont*, %struct.vsofont** %7
%24 = load i8*, i8** %8
%25 = call i32 @_vsofont_write_string(%struct.vsofont* %23, i8* %24)
%26 = call i32 (...) @glPopMatrix()
store i32 1, i32* %6
br label %27
27: ; preds = %18, %17
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
%struct.vsofont = type { i32 }
define i32 @vsofont_write_string_billboard(%struct.vsofont* %0, i8* %1, float %2, float %3, float %4) {
%6 = icmp eq %struct.vsofont* %0, null
%7 = icmp eq i8* %1, null
%8 = or i1 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = tail call i32 @_vsofont_billboard_spherical_cheat_apply(float %2, float %3, float %4)
%11 = tail call i32 @_vsofont_write_string(%struct.vsofont* %0, i8* %1)
%12 = tail call i32 (...) @glPopMatrix()
br label %13
13: ; preds = %5, %9
%14 = phi i32 [ 1, %9 ], [ 0, %5 ]
ret i32 %14
}