#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*/ clientfr(char *);
int /*<<< orphan*/ do_room_tag(char *);
int /*<<< orphan*/ get_string(char *, char *, int);
scalar_t__ isdigit(char);
int /*<<< orphan*/ sprintf(char *, char *, ...);
void do_room_mark(char *arg) {
  char buf[256];
  char buf2[256];
  get_string(arg, buf, 256);
  if (isdigit(buf[0]))
    sprintf(buf2, "%s mark", buf);
  else
    sprintf(buf2, "mark");
  do_room_tag(buf2);
  clientfr("Using 'map config save' will make it permanent.");
}


x86 assembly (clang, -O0):
<do_room_mark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1050 <get_string@plt>
movsbl -0x110(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11ab <do_room_mark+0x5b>
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rdx
lea    0xe61(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    11c0 <do_room_mark+0x70>
lea    -0x210(%rbp),%rdi
lea    0xe4a(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <do_room_tag@plt>
lea    0xe35(%rip),%rdi
call   1070 <clientfr@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_room_mark>:
sub    $0x208,%rsp
lea    0x100(%rsp),%rsi
mov    $0x100,%edx
call   1050 <get_string@plt>
movsbl 0x100(%rsp),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1196 <do_room_mark+0x46>
lea    0xe7e(%rip),%rsi
mov    %rsp,%rdi
lea    0x100(%rsp),%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
jmp    11a2 <do_room_mark+0x52>
movb   $0x0,0x4(%rsp)
movl   $0x6b72616d,(%rsp)
mov    %rsp,%rdi
call   1040 <do_room_tag@plt>
lea    0xe57(%rip),%rdi
call   1070 <clientfr@plt>
add    $0x208,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s mark\00"
@.str.1 = [5 x i8] c"mark\00"
@.str.2 = [48 x i8] c"Using 'map config save' will make it permanent.\00"
define void @do_room_mark(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = call i32 @get_string(i8* %5, i8* %6, i32 256)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = load i8, i8* %8
%10 = call i64 @isdigit(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %19
16: ; preds = %1
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %16, %12
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%21 = call i32 @do_room_tag(i8* %20)
%22 = call i32 @clientfr(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s mark\00"
@.str.1 = [5 x i8] c"mark\00"
@.str.2 = [48 x i8] c"Using 'map config save' will make it permanent.\00"
define void @do_room_mark(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i32 @get_string(i8* %0, i8* %4, i32 256)
%7 = load i8, i8* %4
%8 = call i64 @isdigit(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %10
%14 = call i32 @do_room_tag(i8* %5)
%15 = call i32 @clientfr(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
ret void
}