#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 *, char *, int);
int main() {
  char *s = "pwwkew";
  printf("%s %d\n", s, lengthOfLongestSubstring(s));
  char *s1 = "bbbbb";
  printf("%s %d\n", s1, lengthOfLongestSubstring(s1));
  char *s2 = "abcabcbb";
  printf("%s %d\n", s2, lengthOfLongestSubstring(s2));
  char *s3 = "";
  printf("%s %d\n", s3, lengthOfLongestSubstring(s3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
lea    0xe89(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe54(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xecd(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xec0(%rip),%rbx
mov    %rbx,%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xeaa(%rip),%rbx
mov    %rbx,%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xe87(%rip),%rbx
mov    %rbx,%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"pwwkew\00"
@.str.1 = [7 x i8] c"%s %d\0A\00"
@.str.2 = [6 x i8] c"bbbbb\00"
@.str.3 = [9 x i8] c"abcabcbb\00"
@.str.4 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%5 = load i8*, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 @lengthOfLongestSubstring(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %7)
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @lengthOfLongestSubstring(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %11)
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %3
%15 = call i32 @lengthOfLongestSubstring(i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15)
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8** %4
%17 = load i8*, i8** %4
%18 = load i8*, i8** %4
%19 = call i32 @lengthOfLongestSubstring(i8* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %17, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"pwwkew\00"
@.str.1 = [7 x i8] c"%s %d\0A\00"
@.str.2 = [6 x i8] c"bbbbb\00"
@.str.3 = [9 x i8] c"abcabcbb\00"
@.str.4 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = tail call i32 @lengthOfLongestSubstring(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i32 %7)
ret i32 0
}