#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*/ PHYSFS_permitSymbolicLinks(int);
int atoi(char *);
int /*<<< orphan*/ printf(char *, char *);
int strlen(char *);
int cmd_permitsyms(char *args) {
  int num;
  if (*args == '\"') {
    args++;
    args[strlen(args) - 1] = '\0';
  }
  num = atoi(args);
  PHYSFS_permitSymbolicLinks(num);
  printf("Symlinks are now %s.\n", num ? "permitted" : "forbidden");
  return (1);
}


x86 assembly (clang, -O0):
<cmd_permitsyms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1189 <cmd_permitsyms+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <PHYSFS_permitSymbolicLinks@plt>
mov    -0xc(%rbp),%ecx
lea    0xe79(%rip),%rsi
lea    0xe68(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe44(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_permitsyms>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmpb   $0x22,(%rdi)
jne    1161 <cmd_permitsyms+0x21>
lea    0x1(%rbx),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,(%rax,%rbx,1)
mov    %r14,%rbx
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <PHYSFS_permitSymbolicLinks@plt>
test   %ebx,%ebx
lea    0xea5(%rip),%rax
lea    0xe94(%rip),%rsi
cmove  %rax,%rsi
lea    0xe73(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Symlinks are now %s.\0A\00"
@.str.1 = [10 x i8] c"permitted\00"
@.str.2 = [10 x i8] c"forbidden\00"
define i32 @cmd_permitsyms(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 34
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
store i8 0, i8* %16
br label %17
17: ; preds = %8, %1
%18 = load i8*, i8** %2
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = call i32 @PHYSFS_permitSymbolicLinks(i32 %20)
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
%26 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %25)
ret i32 1
}

LLVM IR (-O2):
@.str = [22 x i8] c"Symlinks are now %s.\0A\00"
@.str.1 = [10 x i8] c"permitted\00"
@.str.2 = [10 x i8] c"forbidden\00"
define i32 @cmd_permitsyms(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 34
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %4, %1
%11 = phi i8* [ %5, %4 ], [ %0, %1 ]
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @PHYSFS_permitSymbolicLinks(i32 %12)
%14 = icmp eq i32 %12, 0
%15 = select i1 %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %15)
ret i32 1
}