#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 atoi(unsigned char *);
int getHeightFix(unsigned char *ptr) {
  for (int i = 0; i < 1; i++) {
    while (*ptr != '\n') {
      ptr += sizeof(char);
    }
    ptr += sizeof(char);
  }
  while (*ptr != ' ') {
    ptr += sizeof(char);
  }
  return atoi(ptr);
}


x86 assembly (clang, -O0):
<getHeightFix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    116d <getHeightFix+0x5d>
jmp    1132 <getHeightFix+0x22>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xa,%eax
je     1153 <getHeightFix+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <getHeightFix+0x22>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <getHeightFix+0x13>
jmp    1172 <getHeightFix+0x62>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x20,%eax
je     1193 <getHeightFix+0x83>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <getHeightFix+0x62>
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHeightFix>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0xa,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <getHeightFix+0x10>
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1130 <getHeightFix+0x20>
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @getHeightFix(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %22
7: ; preds = %4
br label %8
8: ; preds = %13, %7
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %2
br label %8
16: ; preds = %8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8* %18, i8** %2
br label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
br label %23
23: ; preds = %28, %22
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = icmp ne i32 %26, 32
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 1
store i8* %30, i8** %2
br label %23
31: ; preds = %23
%32 = load i8*, i8** %2
%33 = call i32 @atoi(i8* %32)
ret i32 %33
}

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