#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*/ printf(char *, unsigned int, unsigned int);
void p(unsigned char v) {
  char c = v;
  unsigned uc = v;
  int i = v, j = uc;
  unsigned int ui = v, uj = uc;
  printf("c: %c %c\n", c, uc);
  printf("d: %d %d\n", i, j);
  printf("u: %u %u\n", ui, uj);
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsbl -0x2(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
push   %rbx
mov    %edi,%ebx
movsbl %bl,%esi
lea    0xee3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"c: %c %c\0A\00"
@.str.1 = [10 x i8] c"d: %d %d\0A\00"
@.str.2 = [10 x i8] c"u: %u %u\0A\00"
define void @p(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %2
%9 = load i8, i8* %2
store i8 %9, i8* %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
store i32 %11, i32* %4
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %4
store i32 %14, i32* %6
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
store i32 %16, i32* %7
%17 = load i32, i32* %4
store i32 %17, i32* %8
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23)
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %25, i32 %26)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"c: %c %c\0A\00"
@.str.1 = [10 x i8] c"d: %d %d\0A\00"
@.str.2 = [10 x i8] c"u: %u %u\0A\00"
define void @p(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = sext i8 %0 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %2, i32 %2)
ret void
}