#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*/ primary(char const *, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void first(char const *fname, int perms) {
  char buf[80 - 1];
  char buf2[80 - 1];
  for (int i = 0; i < 80; i++)
    buf[i] = 0;
  primary(fname, perms, buf);
  for (int i = 0; i < 80; i++)
    buf2[i] = 0;
  sprintf(buf2, "        %s", buf);
  printf("%s", buf2);
}


x86 assembly (clang, -O0):
<first>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x50,-0xb4(%rbp)
jge    1179 <first+0x49>
movslq -0xb4(%rbp),%rax
movb   $0x0,-0x60(%rbp,%rax,1)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    114c <first+0x1c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   1040 <primary@plt>
movl   $0x0,-0xb8(%rbp)
cmpl   $0x50,-0xb8(%rbp)
jge    11c3 <first+0x93>
movslq -0xb8(%rbp),%rax
movb   $0x0,-0xb0(%rbp,%rax,1)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1193 <first+0x63>
lea    -0xb0(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xe2b(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0xb0(%rbp),%rsi
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
lea    0x50(%rsp),%r14
mov    %r14,%rdx
call   1040 <primary@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
lea    0xe75(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
lea    0xe68(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c" %s\00"
@.str.1 = [3 x i8] c"%s\00"
define void @first(i8* %0, i32 %1) {
%3 = alloca [79 x i8]
%4 = getelementptr inbounds [79 x i8], [79 x i8]* %3, i64 0, i64 0
%5 = alloca [79 x i8]
%6 = getelementptr inbounds [79 x i8], [79 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds [79 x i8], [79 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [79 x i8], [79 x i8]* %5, i64 0, i64 0
%9 = call i32 @primary(i8* %0, i32 %1, i8* %7)
%10 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}