#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*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void pr_int(const char *tpl_1, va_list *ap_1, const char *tpl_2,
            va_list *ap_2) {
  if (ap_1) {
    vprintf(tpl_1, *ap_1);
  } else {
    printf("%s", tpl_1);
  }
  if (ap_2) {
    vprintf(tpl_2, *ap_2);
  } else {
    printf("%s", tpl_2);
  }
}


x86 assembly (clang, -O0):
<pr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <pr_int+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <vprintf@plt>
jmp    1167 <pr_int+0x47>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x20(%rbp)
je     1186 <pr_int+0x66>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1040 <vprintf@plt>
jmp    1196 <pr_int+0x76>
mov    -0x18(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_int>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rdi,%rax
test   %rsi,%rsi
je     1152 <pr_int+0x32>
mov    (%rsi),%esi
mov    %rax,%rdi
call   1040 <vprintf@plt>
test   %rbx,%rbx
je     1166 <pr_int+0x46>
mov    (%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vprintf@plt>
lea    0xea7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
test   %rbx,%rbx
jne    1141 <pr_int+0x21>
lea    0xe93(%rip),%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @pr_int(i8* %0, i32* %1, i8* %2, i32* %3) {
%5 = icmp eq i32* %1, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = load i32, i32* %1
%8 = tail call i32 @vprintf(i8* %0, i32 %7)
br label %11
9: ; preds = %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %6
%12 = icmp eq i32* %3, null
br i1 %12, label %16, label %13
13: ; preds = %11
%14 = load i32, i32* %3
%15 = tail call i32 @vprintf(i8* %2, i32 %14)
br label %18
16: ; preds = %11
%17 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %18
18: ; preds = %16, %13
ret void
}