#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*/ printf(char *, ...);
void _log_failures(int failures, char *cache_dir) {
  if (failures) {
    printf("\n");
    printf("Some user environments could not be loaded.\n");
    printf("Manually run 'env' for those %d users.\n", failures);
    printf("Write the output to a file with the same name as "
           "the user in the\n %s directory\n",
           cache_dir);
  } else {
    printf("\n");
    printf("All user environments successfully loaded.\n");
    printf("Files written to the %s directory\n", cache_dir);
  }
}


x86 assembly (clang, -O0):
<_log_failures>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116d <_log_failures+0x5d>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <_log_failures+0x8b>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xf3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_log_failures>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
je     116b <_log_failures+0x3b>
lea    0xf79(%rip),%rdi
call   1040 <puts@plt>
lea    0xea7(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebf(%rip),%rdi
jmp    117e <_log_failures+0x4e>
lea    0xf29(%rip),%rdi
call   1040 <puts@plt>
lea    0xefa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [45 x i8] c"Some user environments could not be loaded.\0A\00"
@.str.2 = [40 x i8] c"Manually run 'env' for those %d users.\0A\00"
@.str.3 = [80 x i8] c"Write the output to a file with the same name as the user in the\0A %s directory\0A\00"
@.str.4 = [44 x i8] c"All user environments successfully loaded.\0A\00"
@.str.5 = [35 x i8] c"Files written to the %s directory\0A\00"
define void @_log_failures(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.3, i64 0, i64 0), i8* %12)
br label %19
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%17 = load i8*, i8** %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
@.str.2 = [40 x i8] c"Manually run 'env' for those %d users.\0A\00"
@.str.3 = [80 x i8] c"Write the output to a file with the same name as the user in the\0A %s directory\0A\00"
@.str.5 = [35 x i8] c"Files written to the %s directory\0A\00"
@str = [43 x i8] c"All user environments successfully loaded.\00"
@str.6 = [44 x i8] c"Some user environments could not be loaded.\00"
define void @_log_failures(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
%4 = tail call i32 @putchar(i32 10)
br i1 %3, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.6, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([80 x i8], [80 x i8]* @.str.3, i64 0, i64 0), %5 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %11, i8* %1)
ret void
}