#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 */

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void fpf_get_glyph_position(const char character, unsigned int *const x,
                            unsigned int *const y) {
  const int ascii_value =
      (character < ' ' || character > '~') ? 127 : character;
  const int glyph_index = ascii_value - ' ';
  const unsigned int glyphs_per_row = 64u / 6u;
  const int texture_row = glyph_index / glyphs_per_row;
  const int texture_column = glyph_index - (glyphs_per_row * texture_row);
  assert(NULL != x);
  assert(NULL != y);
  *x = texture_column * 6u;
  *y = texture_row * 6u;
}


x86 assembly (clang, -O0):
<fpf_get_glyph_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     1140 <fpf_get_glyph_position+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
jle    114d <fpf_get_glyph_position+0x3d>
mov    $0x7f,%eax
mov    %eax,-0x30(%rbp)
jmp    1154 <fpf_get_glyph_position+0x44>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x20(%rbp)
movl   $0xa,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
imul   $0xa,-0x28(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
imul   $0x6,-0x2c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
imul   $0x6,-0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpf_get_glyph_position>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    -0x7f(%rdi),%eax
cmp    $0xa1,%al
mov    $0x7f,%eax
cmovae %edi,%eax
mov    %rdx,%r14
mov    %rsi,%r15
movzbl %al,%ebx
add    $0xffffffe0,%ebx
movzbl %bl,%eax
imul   $0xcd,%eax,%r12d
shr    $0xa,%r12d
and    $0xfffffffe,%r12d
lea    (%r12,%r12,4),%eax
sub    %eax,%ebx
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,2),%eax
mov    %eax,(%r15)
lea    (%r12,%r12,2),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fpf_get_glyph_position(i8 signext %0, i32* %1, i32* %2) {
%4 = alloca i8
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp slt i32 %13, 32
br i1 %14, label %19, label %15
15: ; preds = %3
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = icmp sgt i32 %17, 126
br i1 %18, label %19, label %20
19: ; preds = %15, %3
br label %23
20: ; preds = %15
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
br label %23
23: ; preds = %20, %19
%24 = phi i32 [ 127, %19 ], [ %22, %20 ]
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = sub nsw i32 %25, 32
store i32 %26, i32* %8
store i32 10, i32* %9
%27 = load i32, i32* %8
%28 = udiv i32 %27, 10
store i32 %28, i32* %10
%29 = load i32, i32* %8
%30 = load i32, i32* %10
%31 = mul i32 10, %30
%32 = sub i32 %29, %31
store i32 %32, i32* %11
%33 = load i32*, i32** %5
%34 = icmp ne i32* null, %33
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = load i32*, i32** %6
%38 = icmp ne i32* null, %37
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = load i32, i32* %11
%42 = mul i32 %41, 6
%43 = load i32*, i32** %5
store i32 %42, i32* %43
%44 = load i32, i32* %10
%45 = mul i32 %44, 6
%46 = load i32*, i32** %6
store i32 %45, i32* %46
ret void
}

LLVM IR (-O2):
define void @fpf_get_glyph_position(i8 signext %0, i32* writeonly %1, i32* writeonly %2) {
%4 = add i8 %0, -127
%5 = icmp ult i8 %4, -95
%6 = select i1 %5, i8 127, i8 %0
%7 = zext i8 %6 to i32
%8 = add nsw i32 %7, -32
%9 = trunc i32 %8 to i8
%10 = udiv i8 %9, 10
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, -10
%13 = add nsw i32 %12, %8
%14 = icmp ne i32* %1, null
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = icmp ne i32* %2, null
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = mul nsw i32 %13, 6
store i32 %20, i32* %1
%21 = mul nuw nsw i32 %11, 6
store i32 %21, i32* %2
ret void
}