#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 lengthOfLongestSubstring(char *);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  char *a = "abcabcbb";
  char *b = "bbbbbb";
  char *c = "pwwkew";
  char *d = "dvdf";
  char *e = "abba";
  int ret1 = lengthOfLongestSubstring(a);
  int ret2 = lengthOfLongestSubstring(b);
  int ret3 = lengthOfLongestSubstring(c);
  int ret4 = lengthOfLongestSubstring(d);
  int ret5 = lengthOfLongestSubstring(e);
  printf("%d, %d, %d, %d, %d.\n", ret1, ret2, ret3, ret4, ret5);
  char *f = "abc'\"#$5acefgh";
  int ret6 = lengthOfLongestSubstring(f);
  printf("%d.\n", ret6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,-0x44(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x44(%rbp),%r9d
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,%r14d
lea    0xecc(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,%r15d
lea    0xec4(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,%ebx
lea    0xebd(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,%ebp
lea    0xeb4(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xead(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"abcabcbb\00"
@.str.1 = [7 x i8] c"bbbbbb\00"
@.str.2 = [7 x i8] c"pwwkew\00"
@.str.3 = [5 x i8] c"dvdf\00"
@.str.4 = [5 x i8] c"abba\00"
@.str.5 = [21 x i8] c"%d, %d, %d, %d, %d.\0A\00"
@.str.6 = [15 x i8] c"abc'\22#$5acefgh\00"
@.str.7 = [5 x i8] c"%d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %6
%14 = load i8*, i8** %2
%15 = call i32 @lengthOfLongestSubstring(i8* %14)
store i32 %15, i32* %7
%16 = load i8*, i8** %3
%17 = call i32 @lengthOfLongestSubstring(i8* %16)
store i32 %17, i32* %8
%18 = load i8*, i8** %4
%19 = call i32 @lengthOfLongestSubstring(i8* %18)
store i32 %19, i32* %9
%20 = load i8*, i8** %5
%21 = call i32 @lengthOfLongestSubstring(i8* %20)
store i32 %21, i32* %10
%22 = load i8*, i8** %6
%23 = call i32 @lengthOfLongestSubstring(i8* %22)
store i32 %23, i32* %11
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %24, i32 %25, i32 %26, i32 %27, i32 %28)
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8** %12
%30 = load i8*, i8** %12
%31 = call i32 @lengthOfLongestSubstring(i8* %30)
store i32 %31, i32* %13
%32 = load i32, i32* %13
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"abcabcbb\00"
@.str.1 = [7 x i8] c"bbbbbb\00"
@.str.2 = [7 x i8] c"pwwkew\00"
@.str.3 = [5 x i8] c"dvdf\00"
@.str.4 = [5 x i8] c"abba\00"
@.str.5 = [21 x i8] c"%d, %d, %d, %d, %d.\0A\00"
@.str.6 = [15 x i8] c"abc'\22#$5acefgh\00"
@.str.7 = [5 x i8] c"%d.\0A\00"
define i32 @main() {
%1 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%7 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %7)
ret i32 0
}