#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*/ is_user_bookmark(char const);
int /*<<< orphan*/ set_mark(char const, char const *, char const *,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ status_bar_message(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int set_user_bookmark(const char mark, const char directory[],
                      const char file[]) {
  if (!is_user_bookmark(mark)) {
    status_bar_message("Invalid mark name");
    return 1;
  }
  set_mark(mark, directory, file, time(NULL), 0);
  return 0;
}


x86 assembly (clang, -O0):
<set_user_bookmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <is_user_bookmark@plt>
cmp    $0x0,%eax
jne    1180 <set_user_bookmark+0x40>
lea    0xe91(%rip),%rdi
call   1040 <status_bar_message@plt>
movl   $0x1,-0x4(%rbp)
jmp    11be <set_user_bookmark+0x7e>
mov    -0x5(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
mov    -0x19(%rbp),%al
xor    %r8d,%r8d
movsbl %al,%edi
call   1060 <set_mark@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_user_bookmark>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
call   1030 <is_user_bookmark@plt>
test   %eax,%eax
je     1177 <set_user_bookmark+0x37>
xor    %ebx,%ebx
xor    %edi,%edi
call   1050 <time@plt>
movsbl %bpl,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
call   1060 <set_mark@plt>
jmp    1188 <set_user_bookmark+0x48>
lea    0xe82(%rip),%rdi
call   1040 <status_bar_message@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Invalid mark name\00"
define i32 @set_user_bookmark(i8 signext %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8*
store i8 %0, i8* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8, i8* %5
%9 = call i32 @is_user_bookmark(i8 signext %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %3
%12 = call i32 @status_bar_message(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %4
br label %19
13: ; preds = %3
%14 = load i8, i8* %5
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = call i32 @time(i32* null)
%18 = call i32 @set_mark(i8 signext %14, i8* %15, i8* %16, i32 %17, i32 0)
store i32 0, i32* %4
br label %19
19: ; preds = %13, %11
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [18 x i8] c"Invalid mark name\00"
define i32 @set_user_bookmark(i8 signext %0, i8* %1, i8* %2) {
%4 = tail call i32 @is_user_bookmark(i8 signext %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @status_bar_message(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %3
%9 = tail call i32 @time(i32* null)
%10 = tail call i32 @set_mark(i8 signext %0, i8* %1, i8* %2, i32 %9, i32 0)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 0, %8 ], [ 1, %6 ]
ret i32 %12
}