#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 EXIT_SUCCESS;
int /*<<< orphan*/ free(char *);
char *its(int *, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *, char *, ...);
int main(void) {
  int a;
  char *a_bin;
  char *a_bin_prefix;
  char *a_oct;
  char *a_oct_prefix;
  char *a_hex;
  char *a_hex_prefix;
  char *a_hex_upper;
  char *a_hex_upper_prefix;
  a = 123123;
  a_bin = its(&a, (sizeof(int) * 8), 0, 3);
  a_bin_prefix = its(&a, (sizeof(int) * 8), 0, 3 | 16);
  a_oct = its(&a, (sizeof(int) * 8), 0, 2);
  a_oct_prefix = its(&a, (sizeof(int) * 8), 0, 2 | 16);
  a_hex = its(&a, (sizeof(int) * 8), 0, 0);
  a_hex_prefix = its(&a, (sizeof(int) * 8), 0, 0 | 16);
  a_hex_upper = its(&a, (sizeof(int) * 8), 0, 0 | 32);
  a_hex_upper_prefix = its(&a, (sizeof(int) * 8), 0, 0 | 32 | 16);
  printf("bin:\n  %s\n  %s\n", a_bin, a_bin_prefix);
  printf("oct:\n  %s\n  %s\n", a_oct, a_oct_prefix);
  printf("hex:\n  %s\n  %s\n  %s\n  %s\n", a_hex, a_hex_prefix, a_hex_upper,
         a_hex_upper_prefix);
  free(a_bin);
  free(a_bin_prefix);
  free(a_oct);
  free(a_oct_prefix);
  free(a_hex);
  free(a_hex_prefix);
  free(a_hex_upper);
  free(a_hex_upper_prefix);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e0f3,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1050 <its@plt>
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x13,%ecx
call   1050 <its@plt>
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x2,%ecx
call   1050 <its@plt>
mov    %rax,-0x20(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x12,%ecx
call   1050 <its@plt>
mov    %rax,-0x28(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1050 <its@plt>
mov    %rax,-0x30(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x10,%ecx
call   1050 <its@plt>
mov    %rax,-0x38(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1050 <its@plt>
mov    %rax,-0x40(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x30,%ecx
call   1050 <its@plt>
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x1e0f3,0xc(%rsp)
lea    0xc(%rsp),%r14
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1050 <its@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x13,%ecx
call   1050 <its@plt>
mov    %rax,0x10(%rsp)
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x2,%ecx
call   1050 <its@plt>
mov    %rax,%r12
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x12,%ecx
call   1050 <its@plt>
mov    %rax,%r13
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <its@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x10,%ecx
call   1050 <its@plt>
mov    %rax,0x20(%rsp)
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x20,%ecx
call   1050 <its@plt>
mov    %rax,0x18(%rsp)
mov    %r14,%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x30,%ecx
call   1050 <its@plt>
mov    %rax,%rbx
lea    0xdf3(%rip),%rdi
mov    %rbp,%rsi
mov    0x10(%rsp),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xded(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xde9(%rip),%rdi
mov    %r15,%rsi
mov    0x20(%rsp),%r14
mov    %r14,%rdx
mov    0x18(%rsp),%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2d44(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"bin:\0A %s\0A %s\0A\00"
@.str.1 = [16 x i8] c"oct:\0A %s\0A %s\0A\00"
@.str.2 = [26 x i8] c"hex:\0A %s\0A %s\0A %s\0A %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32 0, i32* %1
store i32 123123, i32* %2
%11 = call i8* @its(i32* %2, i32 32, i32 0, i32 3)
store i8* %11, i8** %3
%12 = call i8* @its(i32* %2, i32 32, i32 0, i32 19)
store i8* %12, i8** %4
%13 = call i8* @its(i32* %2, i32 32, i32 0, i32 2)
store i8* %13, i8** %5
%14 = call i8* @its(i32* %2, i32 32, i32 0, i32 18)
store i8* %14, i8** %6
%15 = call i8* @its(i32* %2, i32 32, i32 0, i32 0)
store i8* %15, i8** %7
%16 = call i8* @its(i32* %2, i32 32, i32 0, i32 16)
store i8* %16, i8** %8
%17 = call i8* @its(i32* %2, i32 32, i32 0, i32 32)
store i8* %17, i8** %9
%18 = call i8* @its(i32* %2, i32 32, i32 0, i32 48)
store i8* %18, i8** %10
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i32 (i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i8*, i8** %5
%23 = load i8*, i8** %6
%24 = call i32 (i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %22, i8* %23)
%25 = load i8*, i8** %7
%26 = load i8*, i8** %8
%27 = load i8*, i8** %9
%28 = load i8*, i8** %10
%29 = call i32 (i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %25, i8* %26, i8* %27, i8* %28)
%30 = load i8*, i8** %3
%31 = call i32 @free(i8* %30)
%32 = load i8*, i8** %4
%33 = call i32 @free(i8* %32)
%34 = load i8*, i8** %5
%35 = call i32 @free(i8* %34)
%36 = load i8*, i8** %6
%37 = call i32 @free(i8* %36)
%38 = load i8*, i8** %7
%39 = call i32 @free(i8* %38)
%40 = load i8*, i8** %8
%41 = call i32 @free(i8* %40)
%42 = load i8*, i8** %9
%43 = call i32 @free(i8* %42)
%44 = load i8*, i8** %10
%45 = call i32 @free(i8* %44)
%46 = load i32, i32* @EXIT_SUCCESS
ret i32 %46
}

LLVM IR (-O2):
@.str = [16 x i8] c"bin:\0A %s\0A %s\0A\00"
@.str.1 = [16 x i8] c"oct:\0A %s\0A %s\0A\00"
@.str.2 = [26 x i8] c"hex:\0A %s\0A %s\0A %s\0A %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 123123, i32* %1
%3 = call i8* @its(i32* %1, i32 32, i32 0, i32 3)
%4 = call i8* @its(i32* %1, i32 32, i32 0, i32 19)
%5 = call i8* @its(i32* %1, i32 32, i32 0, i32 2)
%6 = call i8* @its(i32* %1, i32 32, i32 0, i32 18)
%7 = call i8* @its(i32* %1, i32 32, i32 0, i32 0)
%8 = call i8* @its(i32* %1, i32 32, i32 0, i32 16)
%9 = call i8* @its(i32* %1, i32 32, i32 0, i32 32)
%10 = call i8* @its(i32* %1, i32 32, i32 0, i32 48)
%11 = call i32 (i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%12 = call i32 (i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%13 = call i32 (i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8, i8* %9, i8* %10)
%14 = call i32 @free(i8* %3)
%15 = call i32 @free(i8* %4)
%16 = call i32 @free(i8* %5)
%17 = call i32 @free(i8* %6)
%18 = call i32 @free(i8* %7)
%19 = call i32 @free(i8* %8)
%20 = call i32 @free(i8* %9)
%21 = call i32 @free(i8* %10)
%22 = load i32, i32* @EXIT_SUCCESS
ret i32 %22
}