#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*/ strcat(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ unlink(char *);
void f_delete(int argc, char **argv) {
  int i;
  char fname[20];
  for (i = 1; i < argc; i++) {
    if (*argv[i] == '\0')
      continue;
    strncpy(fname, argv[i], 8);
    fname[8] = '\0';
    strcat(fname, ".t");
    unlink(fname);
  }
}


x86 assembly (clang, -O0):
<f_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b4 <f_delete+0x84>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116f <f_delete+0x3f>
jmp    11a6 <f_delete+0x76>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0x8,%edx
call   1040 <strncpy@plt>
movb   $0x0,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x30(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <f_delete+0x16>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_delete>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
cmp    $0x2,%edi
jl     1199 <f_delete+0x69>
mov    %rsi,%r14
mov    %edi,%r13d
mov    $0x1,%ebx
mov    %rsp,%r12
lea    0xea9(%rip),%r15
jmp    1169 <f_delete+0x39>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    %rbx,%r13
je     1199 <f_delete+0x69>
mov    (%r14,%rbx,8),%rsi
cmpb   $0x0,(%rsi)
je     1160 <f_delete+0x30>
mov    %r12,%rdi
mov    $0x8,%edx
call   1040 <strncpy@plt>
movb   $0x0,0x8(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
mov    %r12,%rdi
call   1030 <unlink@plt>
jmp    1160 <f_delete+0x30>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c".t\00"
define void @f_delete(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca [20 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
br label %7
7: ; preds = %34, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %37
11: ; preds = %7
%12 = load i8**, i8*** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %11
br label %34
21: ; preds = %11
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%23 = load i8**, i8*** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = call i32 @strncpy(i8* %22, i8* %27, i32 8)
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 8
store i8 0, i8* %29
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%31 = call i32 @strcat(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%33 = call i32 @unlink(i8* %32)
br label %34
34: ; preds = %21, %20
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %7
37: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c".t\00"
define void @f_delete(i32 %0, i8** nocapture %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %22
6: ; preds = %2
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 8
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %6, %19
%10 = phi i64 [ 1, %6 ], [ %20, %19 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %9
%16 = call i32 @strncpy(i8* %4, i8* %12, i32 8)
store i8 0, i8* %7
%17 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @unlink(i8* %4)
br label %19
19: ; preds = %9, %15
%20 = add nuw nsw i64 %10, 1
%21 = icmp eq i64 %20, %8
br i1 %21, label %22, label %9
22: ; preds = %19, %2
ret void
}