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

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ unlink(char *);
void IceUnlockAuthFile(const char *file_name) {
  char creat_name[1025];
  char link_name[1025];
  if ((int)strlen(file_name) > 1022)
    return;
  snprintf(creat_name, sizeof(creat_name), "%s-c", file_name);
  unlink(creat_name);
  snprintf(link_name, sizeof(link_name), "%s-l", file_name);
  unlink(link_name);
}


x86 assembly (clang, -O0):
<IceUnlockAuthFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x3fe,%eax
jle    1158 <IceUnlockAuthFile+0x28>
jmp    11a8 <IceUnlockAuthFile+0x78>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x401,%esi
lea    0xe91(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x820(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x401,%esi
lea    0xe6e(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x820(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IceUnlockAuthFile>:
push   %r14
push   %rbx
sub    $0x818,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x3fe,%eax
jg     1192 <IceUnlockAuthFile+0x62>
lea    0xeb0(%rip),%rdx
lea    0x410(%rsp),%r14
mov    %r14,%rdi
mov    $0x401,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
lea    0xe8e(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x401,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
add    $0x818,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s-c\00"
@.str.1 = [5 x i8] c"%s-l\00"
define void @IceUnlockAuthFile(i8* %0) {
%2 = alloca i8*
%3 = alloca [1025 x i8]
%4 = alloca [1025 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = icmp sgt i32 %7, 1022
br i1 %8, label %9, label %10
9: ; preds = %1
br label %21
10: ; preds = %1
%11 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 0
%12 = load i8*, i8** %2
%13 = call i32 @snprintf(i8* %11, i32 1025, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 0
%15 = call i32 @unlink(i8* %14)
%16 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 0
%17 = load i8*, i8** %2
%18 = call i32 @snprintf(i8* %16, i32 1025, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [1025 x i8], [1025 x i8]* %4, i64 0, i64 0
%20 = call i32 @unlink(i8* %19)
br label %21
21: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s-c\00"
@.str.1 = [5 x i8] c"%s-l\00"
define void @IceUnlockAuthFile(i8* %0) {
%2 = alloca [1025 x i8]
%3 = alloca [1025 x i8]
%4 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 0
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = trunc i64 %6 to i32
%8 = icmp sgt i32 %7, 1022
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = call i32 @snprintf(i8* %4, i32 1025, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%11 = call i32 @unlink(i8* %4)
%12 = call i32 @snprintf(i8* %5, i32 1025, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%13 = call i32 @unlink(i8* %5)
br label %14
14: ; preds = %1, %9
ret void
}