#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*/ oopsx(char *);
char *getre(char **lb) {
  char *lb0 = *lb;
  char *re;
  if (*lb0 != '/')
    return NULL;
  lb0++;
  re = lb0;
  while (*lb0 && *lb0 != '/')
    lb0++;
  if (*lb0 != '/')
    oopsx("badre");
  *lb0 = '\0';
  lb0++;
  *lb = lb0;
  return re;
}


x86 assembly (clang, -O0):
<getre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1144 <getre+0x34>
movq   $0x0,-0x8(%rbp)
jmp    11e0 <getre+0xd0>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     117d <getre+0x6d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    118d <getre+0x7d>
jmp    119e <getre+0x8e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <getre+0x48>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     11ba <getre+0xaa>
lea    0xe4b(%rip),%rdi
call   1030 <oopsx@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getre>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%rbx
cmpb   $0x2f,(%rbx)
jne    1142 <getre+0x32>
mov    %rdi,%r15
lea    0x1(%rbx),%r14
add    $0x2,%rbx
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%rbx),%eax
test   %al,%al
je     1147 <getre+0x37>
cmp    $0x2f,%al
je     1153 <getre+0x43>
add    $0x1,%rbx
jmp    1130 <getre+0x20>
xor    %r14d,%r14d
jmp    115a <getre+0x4a>
lea    0xeb2(%rip),%rdi
call   1030 <oopsx@plt>
movb   $0x0,-0x1(%rbx)
mov    %rbx,(%r15)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"badre\00"
define i8* @getre(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 47
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %46
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8*, i8** %4
store i8* %16, i8** %5
br label %17
17: ; preds = %29, %13
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %17
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 47
br label %27
27: ; preds = %22, %17
%28 = phi i1 [ false, %17 ], [ %26, %22 ]
br i1 %28, label %29, label %32
29: ; preds = %27
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
br label %17
32: ; preds = %27
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 47
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 @oopsx(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %39
39: ; preds = %37, %32
%40 = load i8*, i8** %4
store i8 0, i8* %40
%41 = load i8*, i8** %4
%42 = getelementptr inbounds i8, i8* %41, i32 1
store i8* %42, i8** %4
%43 = load i8*, i8** %4
%44 = load i8**, i8*** %3
store i8* %43, i8** %44
%45 = load i8*, i8** %5
store i8* %45, i8** %2
br label %46
46: ; preds = %39, %12
%47 = load i8*, i8** %2
ret i8* %47
}

LLVM IR (-O2):
@.str = [6 x i8] c"badre\00"
define i8* @getre(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 47
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
br label %7
7: ; preds = %10, %5
%8 = phi i8* [ %6, %5 ], [ %11, %10 ]
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 47, label %14
i8 0, label %12
]
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
br label %7
12: ; preds = %7
%13 = tail call i32 @oopsx(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %7, %12
store i8 0, i8* %8
%15 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %15, i8** %0
br label %16
16: ; preds = %1, %14
%17 = phi i8* [ %6, %14 ], [ null, %1 ]
ret i8* %17
}