#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 S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWGRP;
int S_IWOTH;
int S_IWUSR;
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
int /*<<< orphan*/ printf(char *);
void print_permisos(int mode) {
  printf("\n\t mode: ");
  mode &S_IRUSR ? printf("r") : printf("-");
  mode &S_IWUSR ? printf("w") : printf("-");
  mode &S_IXUSR ? printf("x") : printf("-");
  mode &S_IRGRP ? printf("r") : printf("-");
  mode &S_IWGRP ? printf("w") : printf("-");
  mode &S_IXGRP ? printf("x") : printf("-");
  mode &S_IROTH ? printf("r") : printf("-");
  mode &S_IWOTH ? printf("w") : printf("-");
  mode &S_IXOTH ? printf("x") : printf("-");
}


x86 assembly (clang, -O0):
<print_permisos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e77(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     114d <print_permisos+0x3d>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <print_permisos+0x49>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e6d(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     117f <print_permisos+0x6f>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    118b <print_permisos+0x7b>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e4b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11b1 <print_permisos+0xa1>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
jmp    11bd <print_permisos+0xad>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2df1(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11e3 <print_permisos+0xd3>
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
jmp    11ef <print_permisos+0xdf>
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2ddf(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1215 <print_permisos+0x105>
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <print_permisos+0x111>
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2d9d(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1247 <print_permisos+0x137>
lea    0xdd3(%rip),%rdi
call   1030 <printf@plt>
jmp    1253 <print_permisos+0x143>
lea    0xdbe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2d53(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1279 <print_permisos+0x169>
lea    0xd9b(%rip),%rdi
call   1030 <printf@plt>
jmp    1285 <print_permisos+0x175>
lea    0xd8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2d09(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12ab <print_permisos+0x19b>
lea    0xd6d(%rip),%rdi
call   1030 <printf@plt>
jmp    12b7 <print_permisos+0x1a7>
lea    0xd5a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2d27(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12dd <print_permisos+0x1cd>
lea    0xd3d(%rip),%rdi
call   1030 <printf@plt>
jmp    12e9 <print_permisos+0x1d9>
lea    0xd28(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_permisos>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%ebx
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
mov    $0x2d,%r12d
mov    $0x72,%r14d
mov    $0x72,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
mov    $0x77,%r15d
mov    $0x77,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
mov    $0x78,%ebp
mov    $0x78,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
mov    $0x72,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
mov    $0x77,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    0x2df7(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
mov    $0x78,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
cmove  %r12d,%r14d
mov    %r14d,%edi
call   1030 <putchar@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%eax
and    %ebx,%eax
cmove  %r12d,%r15d
mov    %r15d,%edi
call   1030 <putchar@plt>
mov    0x2dd0(%rip),%rax
and    (%rax),%ebx
cmove  %r12d,%ebp
mov    %ebp,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0A\09 mode: \00"
@S_IRUSR = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"-\00"
@S_IWUSR = global i32 0
@.str.3 = [2 x i8] c"w\00"
@S_IXUSR = global i32 0
@.str.4 = [2 x i8] c"x\00"
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IXOTH = global i32 0
define void @print_permisos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = load i32, i32* @S_IRUSR
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = load i32, i32* %2
%15 = load i32, i32* @S_IWUSR
%16 = and i32 %14, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %22
20: ; preds = %12
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ]
%24 = load i32, i32* %2
%25 = load i32, i32* @S_IXUSR
%26 = and i32 %24, %25
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %32
30: ; preds = %22
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
%33 = phi i32 [ %29, %28 ], [ %31, %30 ]
%34 = load i32, i32* %2
%35 = load i32, i32* @S_IRGRP
%36 = and i32 %34, %35
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %32
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %42
40: ; preds = %32
%41 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %40, %38
%43 = phi i32 [ %39, %38 ], [ %41, %40 ]
%44 = load i32, i32* %2
%45 = load i32, i32* @S_IWGRP
%46 = and i32 %44, %45
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %52
50: ; preds = %42
%51 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50, %48
%53 = phi i32 [ %49, %48 ], [ %51, %50 ]
%54 = load i32, i32* %2
%55 = load i32, i32* @S_IXGRP
%56 = and i32 %54, %55
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %52
%59 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %62
60: ; preds = %52
%61 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %62
62: ; preds = %60, %58
%63 = phi i32 [ %59, %58 ], [ %61, %60 ]
%64 = load i32, i32* %2
%65 = load i32, i32* @S_IROTH
%66 = and i32 %64, %65
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %62
%69 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %72
70: ; preds = %62
%71 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %72
72: ; preds = %70, %68
%73 = phi i32 [ %69, %68 ], [ %71, %70 ]
%74 = load i32, i32* %2
%75 = load i32, i32* @S_IWOTH
%76 = and i32 %74, %75
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %72
%79 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %82
80: ; preds = %72
%81 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %82
82: ; preds = %80, %78
%83 = phi i32 [ %79, %78 ], [ %81, %80 ]
%84 = load i32, i32* %2
%85 = load i32, i32* @S_IXOTH
%86 = and i32 %84, %85
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %82
%89 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %92
90: ; preds = %82
%91 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %92
92: ; preds = %90, %88
%93 = phi i32 [ %89, %88 ], [ %91, %90 ]
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0A\09 mode: \00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_IXOTH = global i32 0
define void @print_permisos(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @S_IRUSR
%4 = and i32 %3, %0
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 45, i32 114
%7 = tail call i32 @putchar(i32 %6)
%8 = load i32, i32* @S_IWUSR
%9 = and i32 %8, %0
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 45, i32 119
%12 = tail call i32 @putchar(i32 %11)
%13 = load i32, i32* @S_IXUSR
%14 = and i32 %13, %0
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i32 45, i32 120
%17 = tail call i32 @putchar(i32 %16)
%18 = load i32, i32* @S_IRGRP
%19 = and i32 %18, %0
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i32 45, i32 114
%22 = tail call i32 @putchar(i32 %21)
%23 = load i32, i32* @S_IWGRP
%24 = and i32 %23, %0
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i32 45, i32 119
%27 = tail call i32 @putchar(i32 %26)
%28 = load i32, i32* @S_IXGRP
%29 = and i32 %28, %0
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i32 45, i32 120
%32 = tail call i32 @putchar(i32 %31)
%33 = load i32, i32* @S_IROTH
%34 = and i32 %33, %0
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i32 45, i32 114
%37 = tail call i32 @putchar(i32 %36)
%38 = load i32, i32* @S_IWOTH
%39 = and i32 %38, %0
%40 = icmp eq i32 %39, 0
%41 = select i1 %40, i32 45, i32 119
%42 = tail call i32 @putchar(i32 %41)
%43 = load i32, i32* @S_IXOTH
%44 = and i32 %43, %0
%45 = icmp eq i32 %44, 0
%46 = select i1 %45, i32 45, i32 120
%47 = tail call i32 @putchar(i32 %46)
ret void
}