#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 get_num(char **);
int handle_backslash(char **reglol) {
  int res;
  ++(*reglol);
  if (**reglol == '\\' || **reglol == '*')
    return (1 << 8 | **reglol);
  if ((res = get_num(reglol)) < 0)
    return (-1);
  res |= 1 << 8;
  return (res);
}


x86 assembly (clang, -O0):
<handle_backslash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     1150 <handle_backslash+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1167 <handle_backslash+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
or     $0x100,%eax
mov    %eax,-0x4(%rbp)
jmp    1199 <handle_backslash+0x89>
mov    -0x10(%rbp),%rdi
call   1030 <get_num@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1188 <handle_backslash+0x78>
movl   $0xffffffff,-0x4(%rbp)
jmp    1199 <handle_backslash+0x89>
mov    -0x14(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_backslash>:
push   %rax
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movzbl 0x1(%rax),%eax
cmp    $0x5c,%eax
je     1128 <handle_backslash+0x18>
cmp    $0x2a,%al
jne    112f <handle_backslash+0x1f>
or     $0x100,%eax
pop    %rcx
ret
call   1030 <get_num@plt>
mov    %eax,%ecx
or     $0x100,%ecx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @handle_backslash(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %5
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 92
br i1 %12, label %19, label %13
13: ; preds = %1
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 42
br i1 %18, label %19, label %25
19: ; preds = %13, %1
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = or i32 256, %23
store i32 %24, i32* %2
br label %34
25: ; preds = %13
%26 = load i8**, i8*** %3
%27 = call i32 @get_num(i8** %26)
store i32 %27, i32* %4
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 -1, i32* %2
br label %34
30: ; preds = %25
%31 = load i32, i32* %4
%32 = or i32 %31, 256
store i32 %32, i32* %4
%33 = load i32, i32* %4
store i32 %33, i32* %2
br label %34
34: ; preds = %30, %29, %19
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @handle_backslash(i8** %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 92, label %5
i8 42, label %5
]
5: ; preds = %1, %1
%6 = zext i8 %4 to i32
%7 = or i32 %6, 256
br label %13
8: ; preds = %1
%9 = tail call i32 @get_num(i8** %0)
%10 = or i32 %9, 256
%11 = icmp sgt i32 %9, -1
%12 = select i1 %11, i32 %10, i32 -1
br label %13
13: ; preds = %8, %5
%14 = phi i32 [ %7, %5 ], [ %12, %8 ]
ret i32 %14
}