#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 get_mode();
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  char c;
  int sz;
  unsigned int uz;
  uz = 0;
  printf("unsigned:\t%x %u\n", uz - 1, uz - 1);
  sz = 0;
  printf("signed  :\t%x %d\n", sz - 1, sz - 1);
  c = 0xff;
  uz = (unsigned char)c;
  sz = c;
  printf("%x %x\n", uz, sz);
  sz = get_mode();
  printf("%X\n", sz);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_mode@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0xff,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <get_mode@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"unsigned:\09%x %u\0A\00"
@.str.1 = [17 x i8] c"signed :\09%x %d\0A\00"
@.str.2 = [7 x i8] c"%x %x\0A\00"
@.str.3 = [4 x i8] c"%X\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 -1, i32 -1)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 -1)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 255, i32 -1)
%4 = tail call i32 (...) @get_mode()
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %4)
ret i32 0
}