#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 http_mime_to_digit(char const *, char const *);
int http_fastcgi_parse_content_type(char const *start, char const *end) {
  char const *semicolon;
  for (semicolon = start; semicolon < end && ';' != *semicolon; semicolon++)
    ;
  return http_mime_to_digit(start, semicolon);
}


x86 assembly (clang, -O0):
<http_fastcgi_parse_content_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    114f <http_fastcgi_parse_content_type+0x3f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x3b,%eax
cmp    %ecx,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115f <http_fastcgi_parse_content_type+0x4f>
jmp    1175 <http_fastcgi_parse_content_type+0x65>
jmp    1164 <http_fastcgi_parse_content_type+0x54>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <http_fastcgi_parse_content_type+0x18>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <http_mime_to_digit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_fastcgi_parse_content_type>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    1142 <http_fastcgi_parse_content_type+0x32>
mov    %rsi,%rcx
sub    %rdi,%rcx
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x3b,(%rax)
je     1142 <http_fastcgi_parse_content_type+0x32>
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
jne    1130 <http_fastcgi_parse_content_type+0x20>
mov    %rsi,%rax
mov    %rax,%rsi
jmp    1030 <http_mime_to_digit@plt>

LLVM IR (-O0):
define i32 @http_fastcgi_parse_content_type(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %19, %2
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ult i8* %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 59, %14
br label %16
16: ; preds = %11, %7
%17 = phi i1 [ false, %7 ], [ %15, %11 ]
br i1 %17, label %18, label %22
18: ; preds = %16
br label %19
19: ; preds = %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
br label %7
22: ; preds = %16
%23 = load i8*, i8** %3
%24 = load i8*, i8** %5
%25 = call i32 @http_mime_to_digit(i8* %23, i8* %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @http_fastcgi_parse_content_type(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %4, %13
%10 = phi i8* [ %14, %13 ], [ %0, %4 ]
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 59
br i1 %12, label %16, label %13
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = icmp eq i8* %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %13, %2
%17 = phi i8* [ %0, %2 ], [ %8, %13 ], [ %10, %9 ]
%18 = tail call i32 @http_mime_to_digit(i8* %0, i8* %17)
ret i32 %18
}