#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 cgi_getentryint(char *);
void cgi_get_integer(char *name, int *value) {
  char *s;
  s = name;
  while (*s != ' ' || *(s + 1) != ' ')
    s++;
  *s = 0;
  *value = cgi_getentryint(name);
}


x86 assembly (clang, -O0):
<cgi_get_integer>:
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),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x19(%rbp)
jne    114e <cgi_get_integer+0x3e>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115e <cgi_get_integer+0x4e>
jmp    116f <cgi_get_integer+0x5f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <cgi_get_integer+0x18>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <cgi_getentryint@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_get_integer>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
jmp    1124 <cgi_get_integer+0x14>
nopl   0x0(%rax)
add    $0x1,%rax
cmpb   $0x20,(%rax)
jne    1120 <cgi_get_integer+0x10>
cmpb   $0x20,0x1(%rax)
jne    1120 <cgi_get_integer+0x10>
movb   $0x0,(%rax)
call   1030 <cgi_getentryint@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cgi_get_integer(i8* %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %11, %2
%4 = phi i8* [ %0, %2 ], [ %12, %11 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
br i1 %10, label %13, label %11
11: ; preds = %3, %7
%12 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
13: ; preds = %7
store i8 0, i8* %4
%14 = tail call i32 @cgi_getentryint(i8* %0)
store i32 %14, i32* %1
ret void
}