#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 *SkipFontNameElement(char *);
int atoi(char *);
int ConvertFontNameToSize(char *n) {
  int i, size;
  for (i = 0; i < 8; i++) {
    n = SkipFontNameElement(n);
    if (!n)
      return -1;
  }
  size = atoi(n);
  return size;
}


x86 assembly (clang, -O0):
<ConvertFontNameToSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1174 <ConvertFontNameToSize+0x54>
mov    -0x10(%rbp),%rdi
call   1040 <SkipFontNameElement@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <ConvertFontNameToSize+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1186 <ConvertFontNameToSize+0x66>
jmp    1166 <ConvertFontNameToSize+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <ConvertFontNameToSize+0x13>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertFontNameToSize>:
push   %rax
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
call   1040 <SkipFontNameElement@plt>
test   %rax,%rax
je     118f <ConvertFontNameToSize+0x6f>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ConvertFontNameToSize(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = call i8* @SkipFontNameElement(i8* %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %9
store i32 -1, i32* %2
br label %23
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load i8*, i8** %3
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %5
%22 = load i32, i32* %5
store i32 %22, i32* %2
br label %23
23: ; preds = %19, %14
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @ConvertFontNameToSize(i8* %0) {
%2 = tail call i8* @SkipFontNameElement(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %27, label %4
4: ; preds = %1
%5 = tail call i8* @SkipFontNameElement(i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %27, label %7
7: ; preds = %4
%8 = tail call i8* @SkipFontNameElement(i8* %5)
%9 = icmp eq i8* %8, null
br i1 %9, label %27, label %10
10: ; preds = %7
%11 = tail call i8* @SkipFontNameElement(i8* %8)
%12 = icmp eq i8* %11, null
br i1 %12, label %27, label %13
13: ; preds = %10
%14 = tail call i8* @SkipFontNameElement(i8* %11)
%15 = icmp eq i8* %14, null
br i1 %15, label %27, label %16
16: ; preds = %13
%17 = tail call i8* @SkipFontNameElement(i8* %14)
%18 = icmp eq i8* %17, null
br i1 %18, label %27, label %19
19: ; preds = %16
%20 = tail call i8* @SkipFontNameElement(i8* %17)
%21 = icmp eq i8* %20, null
br i1 %21, label %27, label %22
22: ; preds = %19
%23 = tail call i8* @SkipFontNameElement(i8* %20)
%24 = icmp eq i8* %23, null
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @atoi(i8* %23)
br label %27
27: ; preds = %1, %4, %7, %10, %13, %16, %19, %22, %25
%28 = phi i32 [ %26, %25 ], [ -1, %22 ], [ -1, %19 ], [ -1, %16 ], [ -1, %13 ], [ -1, %10 ], [ -1, %7 ], [ -1, %4 ], [ -1, %1 ]
ret i32 %28
}