#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_write_string(struct vsofont *, unsigned char *);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glTranslatef(float, float, int /*<<< orphan*/);
int vsofont_write_string_2D(struct vsofont *font, char *s, float x, float y) {
  if (font == NULL || s == NULL)
    return 0;
  glPushMatrix();
  glTranslatef(x, y, 0);
  _vsofont_write_string(font, (unsigned char *)s);
  glPopMatrix();
  return 1;
}


x86 assembly (clang, -O0):
<vsofont_write_string_2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <vsofont_write_string_2D+0x30>
cmpq   $0x0,-0x18(%rbp)
jne    117c <vsofont_write_string_2D+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    11af <vsofont_write_string_2D+0x6f>
mov    $0x0,%al
call   1040 <glPushMatrix@plt>
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
xor    %edi,%edi
call   1050 <glTranslatef@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <_vsofont_write_string@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsofont_write_string_2D>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1191 <vsofont_write_string_2D+0x51>
mov    %rsi,%r14
test   %rsi,%rsi
je     1191 <vsofont_write_string_2D+0x51>
mov    %rdi,%rbx
xor    %eax,%eax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
call   1040 <glPushMatrix@plt>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
xor    %edi,%edi
call   1050 <glTranslatef@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <_vsofont_write_string@plt>
xor    %eax,%eax
call   1030 <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_2D(%struct.vsofont* %0, i8* %1, float %2, float %3) {
%5 = alloca i32
%6 = alloca %struct.vsofont*
%7 = alloca i8*
%8 = alloca float
%9 = alloca float
store %struct.vsofont* %0, %struct.vsofont** %6
store i8* %1, i8** %7
store float %2, float* %8
store float %3, float* %9
%10 = load %struct.vsofont*, %struct.vsofont** %6
%11 = icmp eq %struct.vsofont* %10, null
br i1 %11, label %15, label %12
12: ; preds = %4
%13 = load i8*, i8** %7
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %12, %4
store i32 0, i32* %5
br label %25
16: ; preds = %12
%17 = call i32 (...) @glPushMatrix()
%18 = load float, float* %8
%19 = load float, float* %9
%20 = call i32 @glTranslatef(float %18, float %19, i32 0)
%21 = load %struct.vsofont*, %struct.vsofont** %6
%22 = load i8*, i8** %7
%23 = call i32 @_vsofont_write_string(%struct.vsofont* %21, i8* %22)
%24 = call i32 (...) @glPopMatrix()
store i32 1, i32* %5
br label %25
25: ; preds = %16, %15
%26 = load i32, i32* %5
ret i32 %26
}

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