#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 */
char *strtok(char *, char *);
int /*<<< orphan*/ x_preload(char *, int /*<<< orphan*/);
void font_preload(char *s) {
  int k = 0;
  char *buf = strtok(s, ",");
  while (buf != NULL) {
    if (k < 64)
      x_preload(buf, k++);
    buf = strtok(NULL, ",");
  }
}


x86 assembly (clang, -O0):
<font_preload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1189 <font_preload+0x69>
cmpl   $0x40,-0xc(%rbp)
jge    1170 <font_preload+0x50>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
call   1030 <x_preload@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe85(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
jmp    1147 <font_preload+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<font_preload>:
push   %rbp
push   %r14
push   %rbx
lea    0xed5(%rip),%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     1165 <font_preload+0x45>
xor    %ebx,%ebx
lea    0xec2(%rip),%r14
jmp    114f <font_preload+0x2f>
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
je     1165 <font_preload+0x45>
cmp    $0x3f,%ebx
jg     1140 <font_preload+0x20>
lea    0x1(%rbx),%ebp
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <x_preload@plt>
mov    %ebp,%ebx
jmp    1140 <font_preload+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define void @font_preload(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
br label %7
7: ; preds = %18, %1
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 64
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = call i32 @x_preload(i8* %14, i32 %15)
br label %18
18: ; preds = %13, %10
%19 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %19, i8** %4
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define void @font_preload(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8* [ %13, %11 ], [ %2, %1 ]
%6 = phi i32 [ %12, %11 ], [ 0, %1 ]
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = add nsw i32 %6, 1
%10 = tail call i32 @x_preload(i8* %5, i32 %6)
br label %11
11: ; preds = %8, %4
%12 = phi i32 [ %9, %8 ], [ %6, %4 ]
%13 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}