#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*/ time_t;

/* Variables and functions */
scalar_t__ is_user_bookmark(char const);
int /*<<< orphan*/ set_mark(char const, char const *, char const *,
                            int /*<<< orphan*/, int);
int /*<<< orphan*/ status_bar_errorf(char *, char const);
void setup_user_bookmark(const char mark, const char directory[],
                         const char file[], time_t timestamp) {
  if (is_user_bookmark(mark)) {
    set_mark(mark, directory, file, timestamp, 1);
  } else {
    status_bar_errorf("Only user's bookmarks can be loaded, but got: %c", mark);
  }
}


x86 assembly (clang, -O0):
<setup_user_bookmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_user_bookmark@plt>
cmp    $0x0,%rax
je     117d <setup_user_bookmark+0x4d>
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%r8d
movsbl %al,%edi
call   1050 <set_mark@plt>
jmp    118d <setup_user_bookmark+0x5d>
lea    0xe7c(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <status_bar_errorf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_user_bookmark>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
call   1030 <is_user_bookmark@plt>
test   %rax,%rax
je     116d <setup_user_bookmark+0x3d>
movsbl %bl,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <set_mark@plt>
movsbl %bl,%esi
lea    0xe89(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <status_bar_errorf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Only user's bookmarks can be loaded, but got: %c\00"
define void @setup_user_bookmark(i8 signext %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8 %0, i8* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8, i8* %5
%10 = call i64 @is_user_bookmark(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i8, i8* %5
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i32, i32* %8
%17 = call i32 @set_mark(i8 signext %13, i8* %14, i8* %15, i32 %16, i32 1)
br label %21
18: ; preds = %4
%19 = load i8, i8* %5
%20 = call i32 @status_bar_errorf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8 signext %19)
br label %21
21: ; preds = %18, %12
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Only user's bookmarks can be loaded, but got: %c\00"
define void @setup_user_bookmark(i8 signext %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i64 @is_user_bookmark(i8 signext %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @set_mark(i8 signext %0, i8* %1, i8* %2, i32 %3, i32 1)
br label %11
9: ; preds = %4
%10 = tail call i32 @status_bar_errorf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %11
11: ; preds = %9, %7
ret void
}