#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 */
typedef int /*<<< orphan*/ myuser;

/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
char *read_file(char *);
int /*<<< orphan*/ readn(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ *strchr(char *, char);
char *__attribute__((no)) user_func(void) {
  char myuser[3 + 128 + 1] = {'d', 'b', '/'};
  readn(0, &myuser[3], sizeof(myuser) - 1 - 3);
  if (strchr(&myuser[3], '/') != NULL)
    _exit(0);
  return read_file(myuser);
}


x86 assembly (clang, -O0):
<user_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x84,%edx
call   1050 <memset@plt>
movb   $0x64,-0x90(%rbp)
movb   $0x62,-0x8f(%rbp)
movb   $0x2f,-0x8e(%rbp)
lea    -0x90(%rbp),%rsi
add    $0x3,%rsi
xor    %edi,%edi
mov    $0x80,%edx
call   1060 <readn@plt>
lea    -0x90(%rbp),%rdi
add    $0x3,%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     11c0 <user_func+0x70>
xor    %edi,%edi
call   1030 <_exit@plt>
lea    -0x90(%rbp),%rdi
call   1070 <read_file@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_func>:
push   %rbx
sub    $0x90,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x80(%rsp)
movw   $0x6264,(%rsp)
movb   $0x2f,0x2(%rsp)
lea    0x3(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x80,%edx
call   1050 <readn@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    11bf <user_func+0x7f>
mov    %rsp,%rdi
call   1060 <read_file@plt>
add    $0x90,%rsp
pop    %rbx
ret
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i8* @user_func() {
%1 = alloca [132 x i8]
%2 = bitcast [132 x i8]* %1 to i8*
%3 = bitcast i8* %2 to <{ i8, i8, i8, [129 x i8] }>*
%4 = getelementptr inbounds <{ i8, i8, i8, [129 x i8] }>, <{ i8, i8, i8, [129 x i8] }>* %3, i32 0, i32 0
store i8 100, i8* %4
%5 = getelementptr inbounds <{ i8, i8, i8, [129 x i8] }>, <{ i8, i8, i8, [129 x i8] }>* %3, i32 0, i32 1
store i8 98, i8* %5
%6 = getelementptr inbounds <{ i8, i8, i8, [129 x i8] }>, <{ i8, i8, i8, [129 x i8] }>* %3, i32 0, i32 2
store i8 47, i8* %6
%7 = getelementptr inbounds [132 x i8], [132 x i8]* %1, i64 0, i64 3
%8 = call i32 @readn(i32 0, i8* %7, i32 128)
%9 = getelementptr inbounds [132 x i8], [132 x i8]* %1, i64 0, i64 3
%10 = call i32* @strchr(i8* %9, i8 signext 47)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @_exit(i32 0)
unreachable
14: ; preds = %0
%15 = getelementptr inbounds [132 x i8], [132 x i8]* %1, i64 0, i64 0
%16 = call i8* @read_file(i8* %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @user_func() {
%1 = alloca [132 x i8]
%2 = getelementptr inbounds [132 x i8], [132 x i8]* %1, i64 0, i64 0
store i8 100, i8* %2
%3 = getelementptr inbounds [132 x i8], [132 x i8]* %1, i64 0, i64 1
store i8 98, i8* %3
%4 = getelementptr inbounds [132 x i8], [132 x i8]* %1, i64 0, i64 2
store i8 47, i8* %4
%5 = getelementptr inbounds [132 x i8], [132 x i8]* %1, i64 0, i64 3
%6 = call i32 @readn(i32 0, i8* %5, i32 128)
%7 = call i32* @strchr(i8* %5, i8 signext 47)
%8 = icmp eq i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @_exit(i32 0)
unreachable
11: ; preds = %0
%12 = call i8* @read_file(i8* %2)
ret i8* %12
}