#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 */
struct rlimit {
  char *rlim_cur;
};

/* Variables and functions */
char *RLIM_INFINITY;
int /*<<< orphan*/ printf(char *, ...);
void printLimits(char *M, char *U, struct rlimit *L) {
  printf("Limites %-10s : ", M);
  if (L->rlim_cur == RLIM_INFINITY)
    printf("infini");
  else
    printf("%ld", L->rlim_cur);
  if (L->rlim_cur == RLIM_INFINITY)
    printf("/infini");
  else
    printf("/%ld", L->rlim_cur);
  printf(" %s\n", U);
}


x86 assembly (clang, -O0):
<printLimits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
jne    1160 <printLimits+0x50>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1175 <printLimits+0x65>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2e5d(%rip),%rcx
cmp    (%rcx),%rax
jne    119f <printLimits+0x8f>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b4 <printLimits+0xa4>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLimits>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%rsi
mov    0x2eaa(%rip),%r15
cmp    (%r15),%rsi
je     114b <printLimits+0x3b>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1159 <printLimits+0x49>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%rsi
cmp    (%r15),%rsi
je     1171 <printLimits+0x61>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    117f <printLimits+0x6f>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.rlimit = type { i8* }
@.str = [17 x i8] c"Limites %-10s : \00"
@RLIM_INFINITY = global i8* null
@.str.1 = [7 x i8] c"infini\00"
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [8 x i8] c"/infini\00"
@.str.4 = [5 x i8] c"/%ld\00"
@.str.5 = [5 x i8] c" %s\0A\00"
define void @printLimits(i8* %0, i8* %1, %struct.rlimit* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.rlimit*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.rlimit* %2, %struct.rlimit** %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load %struct.rlimit*, %struct.rlimit** %6
%10 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %9, i32 0, i32 0
%11 = load i8*, i8** %10
%12 = load i8*, i8** @RLIM_INFINITY
%13 = icmp eq i8* %11, %12
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %21
16: ; preds = %3
%17 = load %struct.rlimit*, %struct.rlimit** %6
%18 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %17, i32 0, i32 0
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %16, %14
%22 = load %struct.rlimit*, %struct.rlimit** %6
%23 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %22, i32 0, i32 0
%24 = load i8*, i8** %23
%25 = load i8*, i8** @RLIM_INFINITY
%26 = icmp eq i8* %24, %25
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %34
29: ; preds = %21
%30 = load %struct.rlimit*, %struct.rlimit** %6
%31 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %30, i32 0, i32 0
%32 = load i8*, i8** %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %29, %27
%35 = load i8*, i8** %5
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %35)
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i8* }
@.str = [17 x i8] c"Limites %-10s : \00"
@RLIM_INFINITY = global i8* null
@.str.1 = [7 x i8] c"infini\00"
@.str.2 = [4 x i8] c"%ld\00"
@.str.3 = [8 x i8] c"/infini\00"
@.str.4 = [5 x i8] c"/%ld\00"
@.str.5 = [5 x i8] c" %s\0A\00"
define void @printLimits(i8* %0, i8* %1, %struct.rlimit* nocapture %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = load i8*, i8** @RLIM_INFINITY
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %3
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %13
13: ; preds = %11, %9
%14 = load i8*, i8** %5
%15 = load i8*, i8** @RLIM_INFINITY
%16 = icmp eq i8* %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %21
19: ; preds = %13
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %14)
br label %21
21: ; preds = %19, %17
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %1)
ret void
}