#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 *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(void) {
  int a;
  a = 12345;
  printf("Decimal Value:%d\n", a);
  printf("Octal Value:%o\n", a);
  printf("Hexa-Decimal Value:%x\n", a);
  printf("\n");
  a = 04567;
  printf("Decimal Value:%d\n", a);
  printf("Octal Value:%o\n", a);
  printf("Hexa-Decimal Value:%x\n", a);
  printf("\n");
  a = 0x789ab;
  printf("Decimal Value:%d\n", a);
  printf("Octal Value:%o\n", a);
  printf("Hexa-Decimal Value:%x\n", a);
  printf("\n");
  a = 12345 + 04567 + 0x789ab;
  printf("Decimal Value:%d\n", a);
  printf("Octal Value:%o\n", a);
  printf("Hexa-Decimal Value:%x\n", a);
  printf("\n");
  unsigned int u;
  printf("Enter value of unsigned int in decimal:");
  scanf("%u", &u);
  printf("%u", u);
  printf("Enter value of unsigned int in octal:");
  scanf("%o", &u);
  printf("%o", u);
  printf("Enter value of unsigned int in hexa-decimal:");
  scanf("%x", &u);
  printf("%x", u);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3039,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x977,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x789ab,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x7c35b,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdfd(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
mov    %r14,%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%r15
mov    %r15,%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    $0x977,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x977,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x977,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    $0x789ab,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x789ab,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x789ab,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    $0x7c35b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x7c35b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7c35b,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe08(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe22(%rip),%rbx
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe00(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe18(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe1a(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Decimal Value:%d\0A\00"
@.str.1 = [16 x i8] c"Octal Value:%o\0A\00"
@.str.2 = [23 x i8] c"Hexa-Decimal Value:%x\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [40 x i8] c"Enter value of unsigned int in decimal:\00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [38 x i8] c"Enter value of unsigned int in octal:\00"
@.str.7 = [3 x i8] c"%o\00"
@.str.8 = [45 x i8] c"Enter value of unsigned int in hexa-decimal:\00"
@.str.9 = [3 x i8] c"%x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 12345, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 2423, i32* %2
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 493995, i32* %2
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 508763, i32* %2
%25 = load i32, i32* %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%38 = load i32, i32* %3
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %3)
%42 = load i32, i32* %3
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %42)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Decimal Value:%d\0A\00"
@.str.1 = [16 x i8] c"Octal Value:%o\0A\00"
@.str.2 = [23 x i8] c"Hexa-Decimal Value:%x\0A\00"
@.str.4 = [40 x i8] c"Enter value of unsigned int in decimal:\00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [38 x i8] c"Enter value of unsigned int in octal:\00"
@.str.7 = [3 x i8] c"%o\00"
@.str.8 = [45 x i8] c"Enter value of unsigned int in hexa-decimal:\00"
@.str.9 = [3 x i8] c"%x\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 12345)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 12345)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 12345)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2423)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 2423)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 2423)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 493995)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 493995)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 493995)
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 508763)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 508763)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 508763)
%17 = tail call i32 @putchar(i32 10)
%18 = bitcast i32* %1 to i8*
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%21 = load i32, i32* %1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %1)
%25 = load i32, i32* %1
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%29 = load i32, i32* %1
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %29)
ret i32 0
}