#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 */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ libgamma_perror(char *, int);
int /*<<< orphan*/ printf(char *, char const *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void print_crtc_information_signed(int do_print, const char *description,
                                   int error, signed value) {
  char buf[256];
  if (do_print) {
    if (error) {
      snprintf(buf, sizeof(buf), "  (error) %s", description);
      libgamma_perror(buf, error);
    } else {
      printf("  %s: %"
             "i"
             "\n",
             description, value);
    }
  }
}


x86 assembly (clang, -O0):
<print_crtc_information_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11a4 <print_crtc_information_signed+0x74>
cmpl   $0x0,-0x14(%rbp)
je     118c <print_crtc_information_signed+0x5c>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xe8d(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <libgamma_perror@plt>
jmp    119f <print_crtc_information_signed+0x6f>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    11a4 <print_crtc_information_signed+0x74>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_crtc_information_signed>:
push   %r14
push   %rbx
sub    $0x108,%rsp
test   %edi,%edi
je     116b <print_crtc_information_signed+0x3b>
mov    %edx,%ebx
mov    %rsi,%rax
test   %edx,%edx
je     1176 <print_crtc_information_signed+0x46>
lea    0xeb2(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rax,%rcx
call   1040 <snprintf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <libgamma_perror@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe90(%rip),%rdi
mov    %rax,%rsi
mov    %ecx,%edx
add    $0x108,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c" (error) %s\00"
@.str.1 = [10 x i8] c" %s: %i\0A\00"
define void @print_crtc_information_signed(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [256 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %4
%13 = load i32, i32* %7
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = load i8*, i8** %6
%18 = call i32 @snprintf(i8* %16, i32 256, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%20 = load i32, i32* %7
%21 = call i32 @libgamma_perror(i8* %19, i32 %20)
br label %26
22: ; preds = %12
%23 = load i8*, i8** %6
%24 = load i32, i32* %8
%25 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %23, i32 %24)
br label %26
26: ; preds = %22, %15
br label %27
27: ; preds = %26, %4
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c" (error) %s\00"
@.str.1 = [10 x i8] c" %s: %i\0A\00"
define void @print_crtc_information_signed(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = icmp eq i32 %0, 0
br i1 %7, label %15, label %8
8: ; preds = %4
%9 = icmp eq i32 %2, 0
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = call i32 @snprintf(i8* %6, i32 256, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
%12 = call i32 @libgamma_perror(i8* %6, i32 %2)
br label %15
13: ; preds = %8
%14 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %3)
br label %15
15: ; preds = %10, %13, %4
ret void
}