#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*/ clang_analyzer_eval(int);
int /*<<< orphan*/ strsep(char **, char *);
void strsep_changes_input_pointer(char *s) {
  char *original = s;
  strsep(&s, "");
  clang_analyzer_eval(s == original);
  clang_analyzer_eval(s == 0);
  if (s == 0) {
    clang_analyzer_eval(s == 0);
  }
}


x86 assembly (clang, -O0):
<strsep_changes_input_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strsep@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
cmpq   $0x0,-0x8(%rbp)
jne    1188 <strsep_changes_input_pointer+0x68>
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsep_changes_input_pointer>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
lea    0xecc(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strsep@plt>
xor    %edi,%edi
cmp    %rbx,0x8(%rsp)
sete   %dil
call   1040 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmpq   $0x0,0x8(%rsp)
sete   %dil
call   1040 <clang_analyzer_eval@plt>
cmpq   $0x0,0x8(%rsp)
jne    1171 <strsep_changes_input_pointer+0x51>
mov    $0x1,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @strsep_changes_input_pointer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = call i32 @strsep(i8** %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = icmp eq i8* %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @clang_analyzer_eval(i32 %9)
%11 = load i8*, i8** %2
%12 = icmp eq i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i8*, i8** %2
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %1
%18 = load i8*, i8** %2
%19 = icmp eq i8* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 @clang_analyzer_eval(i32 %20)
br label %22
22: ; preds = %17, %1
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @strsep_changes_input_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @strsep(i8** %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, %0
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
%8 = load i8*, i8** %2
%9 = icmp eq i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
%12 = load i8*, i8** %2
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 @clang_analyzer_eval(i32 1)
br label %16
16: ; preds = %14, %1
ret void
}