#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 /*<<< orphan*/);
void ignore_extra(const char chr, char **string_ptr) {
  assert(string_ptr != NULL);
  while (*string_ptr != NULL && **string_ptr == chr) {
    *string_ptr += 1;
  }
}


x86 assembly (clang, -O0):
<ignore_extra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
je     115d <ignore_extra+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116d <ignore_extra+0x5d>
jmp    1180 <ignore_extra+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1134 <ignore_extra+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_extra>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%rax
test   %rax,%rax
je     114f <ignore_extra+0x3f>
cmp    %bpl,(%rax)
jne    114f <ignore_extra+0x3f>
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rbx)
lea    0x1(%rax),%rcx
cmp    %bpl,(%rax)
mov    %rcx,%rax
je     1140 <ignore_extra+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ignore_extra(i8 signext %0, i8** %1) {
%3 = alloca i8
%4 = alloca i8**
store i8 %0, i8* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = icmp ne i8** %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
br label %9
9: ; preds = %23, %2
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %17, %19
br label %21
21: ; preds = %13, %9
%22 = phi i1 [ false, %9 ], [ %20, %13 ]
br i1 %22, label %23, label %27
23: ; preds = %21
%24 = load i8**, i8*** %4
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i64 1
store i8* %26, i8** %24
br label %9
27: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @ignore_extra(i8 signext %0, i8** %1) {
%3 = icmp ne i8** %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i8*, i8** %1
%7 = icmp eq i8* %6, null
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, %0
br i1 %10, label %11, label %16
11: ; preds = %8, %11
%12 = phi i8* [ %13, %11 ], [ %6, %8 ]
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, %0
br i1 %15, label %11, label %16
16: ; preds = %11, %8, %2
ret void
}