#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);
int /*<<< orphan*/ puts(char *);
int main(void) {
  size_t i = 1;
  unsigned ii = 1;
  puts("size_t:");
  i = -i;
  printf("\t%d\n", (int)i);
  printf("\t%u\n", (unsigned)i);
  puts("unsigned:");
  ii = -ii;
  printf("\t%d\n", (int)ii);
  printf("\t%u\n", (unsigned)ii);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%r14
mov    %r14,%rdi
mov    $0xffffffff,%esi
call   1040 <printf@plt>
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0xffffffff,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"size_t:\00"
@.str.1 = [5 x i8] c"\09%d\0A\00"
@.str.2 = [5 x i8] c"\09%u\0A\00"
@.str.3 = [10 x i8] c"unsigned:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 -1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 -1)
ret i32 0
}