#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*/ sprintf(char *, char *, char *);
void bitmap_cpc_name(int num, char *dir, char *out) {
  if (num == 0)
    sprintf(out, "%stitle.pic", dir);
  else if (num == 1)
    sprintf(out, "%s1.pic", dir);
  else
    sprintf(out, "%sallpics.pic", dir);
}


x86 assembly (clang, -O0):
<bitmap_cpc_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1146 <bitmap_cpc_name+0x36>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec4(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1182 <bitmap_cpc_name+0x72>
cmpl   $0x1,-0x4(%rbp)
jne    1169 <bitmap_cpc_name+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xead(%rip),%rsi
call   1030 <sprintf@plt>
jmp    117d <bitmap_cpc_name+0x6d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1182 <bitmap_cpc_name+0x72>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_cpc_name>:
mov    %rdx,%rax
mov    %rsi,%rdx
cmp    $0x1,%edi
lea    0xeec(%rip),%rsi
lea    0xeed(%rip),%rcx
cmove  %rsi,%rcx
test   %edi,%edi
lea    0xecc(%rip),%rsi
cmovne %rcx,%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%stitle.pic\00"
@.str.1 = [8 x i8] c"%s1.pic\00"
@.str.2 = [14 x i8] c"%sallpics.pic\00"
define void @bitmap_cpc_name(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %25
13: ; preds = %3
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i8*, i8** %5
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %24
20: ; preds = %13
%21 = load i8*, i8** %6
%22 = load i8*, i8** %5
%23 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %20, %16
br label %25
25: ; preds = %24, %9
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%stitle.pic\00"
@.str.1 = [8 x i8] c"%s1.pic\00"
@.str.2 = [14 x i8] c"%sallpics.pic\00"
define void @bitmap_cpc_name(i32 %0, i8* %1, i8* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) %7, i8* %1)
ret void
}