#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*/ stackarg(int /*<<< orphan*/, int, char const *);
const char *pushstr(const char *str) {
  stackarg(0, 0x08, str);
  while (*str && *str != '\"')
    ++str;
  if (*str == '\"')
    ++str;
  return str;
}


x86 assembly (clang, -O0):
<pushstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
mov    $0x8,%esi
call   1030 <stackarg@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1151 <pushstr+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1161 <pushstr+0x51>
jmp    1172 <pushstr+0x62>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <pushstr+0x1c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    118e <pushstr+0x7e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushstr>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0x8,%esi
mov    %rbx,%rdx
call   1030 <stackarg@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%eax
test   %al,%al
je     1141 <pushstr+0x31>
cmp    $0x22,%al
je     1141 <pushstr+0x31>
add    $0x1,%rbx
jmp    1130 <pushstr+0x20>
xor    %ecx,%ecx
cmp    $0x22,%al
sete   %cl
add    %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @pushstr(i8* %0) {
%2 = tail call i32 @stackarg(i32 0, i32 8, i8* %0)
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %0, %1 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 34, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3
%9 = icmp eq i8 %5, 34
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %4, i64 %10
ret i8* %11
}