#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 /*<<< orphan*/ assert(int);
int get_length_longest_substr_without_repeating_chars(char *);
int main() {
  char *str2 = "abcabcbb";
  int exp_longest_len2 = 3;
  int act_longest_len2 =
      get_length_longest_substr_without_repeating_chars(str2);
  assert(exp_longest_len2 == act_longest_len2);
  char *str3 = "bbbbb";
  int exp_longest_len3 = 1;
  int act_longest_len3 =
      get_length_longest_substr_without_repeating_chars(str3);
  assert(exp_longest_len3 == act_longest_len3);
  char *str4 = "pwwkwe";
  int exp_longest_len4 = 3;
  int act_longest_len4 =
      get_length_longest_substr_without_repeating_chars(str4);
  assert(exp_longest_len4 == act_longest_len4);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_length_longest_substr_without_repeating_chars@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea2(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <get_length_longest_substr_without_repeating_chars@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe77(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x3,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <get_length_longest_substr_without_repeating_chars@plt>
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <get_length_longest_substr_without_repeating_chars@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xec7(%rip),%rdi
call   1030 <get_length_longest_substr_without_repeating_chars@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb3(%rip),%rdi
call   1030 <get_length_longest_substr_without_repeating_chars@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"abcabcbb\00"
@.str.1 = [6 x i8] c"bbbbb\00"
@.str.2 = [7 x i8] c"pwwkwe\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = 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 i32 3, i32* %3
%11 = load i8*, i8** %2
%12 = call i32 @get_length_longest_substr_without_repeating_chars(i8* %11)
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %5
store i32 1, i32* %6
%18 = load i8*, i8** %5
%19 = call i32 @get_length_longest_substr_without_repeating_chars(i8* %18)
store i32 %19, i32* %7
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = icmp eq i32 %20, %21
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %8
store i32 3, i32* %9
%25 = load i8*, i8** %8
%26 = call i32 @get_length_longest_substr_without_repeating_chars(i8* %25)
store i32 %26, i32* %10
%27 = load i32, i32* %9
%28 = load i32, i32* %10
%29 = icmp eq i32 %27, %28
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"abcabcbb\00"
@.str.1 = [6 x i8] c"bbbbb\00"
@.str.2 = [7 x i8] c"pwwkwe\00"
define i32 @main() {
%1 = tail call i32 @get_length_longest_substr_without_repeating_chars(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @get_length_longest_substr_without_repeating_chars(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @get_length_longest_substr_without_repeating_chars(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}