#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 *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void pennies_part(char *destination, int decimal_part) {
  char pennies[3];
  if (!decimal_part)
    strcpy(pennies, "0");
  else
    sprintf(pennies, "%d", decimal_part);
  strcat(destination, " and ");
  strcat(destination, pennies);
  strcat(destination, "/100");
}


x86 assembly (clang, -O0):
<pennies_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    115e <pennies_part+0x2e>
lea    -0xf(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1171 <pennies_part+0x41>
lea    -0xf(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe94(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0xf(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe70(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pennies_part>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
test   %esi,%esi
je     1151 <pennies_part+0x21>
mov    %esi,%edx
lea    0xebb(%rip),%rsi
lea    0xd(%rsp),%rdi
call   1050 <sprintf@plt>
jmp    1162 <pennies_part+0x32>
lea    0xeb4(%rip),%rsi
lea    0xd(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xd(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xe84(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c" and \00"
@.str.3 = [5 x i8] c"/100\00"
define void @pennies_part(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [3 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
11: ; preds = %2
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%13 = load i32, i32* %4
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %8
%16 = load i8*, i8** %3
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = load i8*, i8** %3
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %3
%22 = call i32 @strcat(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c" and \00"
@.str.3 = [5 x i8] c"/100\00"
define void @pennies_part(i8* %0, i32 %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %1, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
br label %10
10: ; preds = %8, %6
%11 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @strcat(i8* %0, i8* %4)
%13 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}