#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 */
typedef int uintmax_t;
typedef int intmax_t;

/* Variables and functions */
int EXIT_SUCCESS;
int INTMAX_MAX;
int UINTMAX_MAX;
int /*<<< orphan*/ free(char *);
char *its(int *, int, int, int);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int main(void) {
  intmax_t a;
  intmax_t b;
  uintmax_t c;
  char *a_str;
  char *b_str;
  char *c_str;
  a = INTMAX_MAX - 5;
  b = -INTMAX_MAX + 7;
  c = UINTMAX_MAX - 100;
  a_str = its(&a, (sizeof(intmax_t) * 8), 0, 3);
  b_str = its(&b, (sizeof(intmax_t) * 8), 0, 0 | 16);
  c_str = its(&c, (sizeof(intmax_t) * 8), 1, 1);
  printf("%s\n%s\n%s\n", a_str, b_str, c_str);
  free(a_str);
  free(b_str);
  free(c_str);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    0x2e89(%rip),%rcx
sub    (%rcx),%eax
add    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
sub    $0x64,%eax
mov    %eax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1050 <its@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x10,%ecx
call   1050 <its@plt>
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x20,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1050 <its@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe34(%rip),%rdi
call   1040 <printf@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    0x2ddd(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
lea    -0x5(%rax),%ecx
mov    %ecx,0xc(%rsp)
mov    $0x7,%ecx
sub    %eax,%ecx
mov    %ecx,0x8(%rsp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0xffffff9c,%eax
mov    %eax,0x4(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x3,%ecx
call   1050 <its@plt>
mov    %rax,%r14
lea    0x8(%rsp),%rdi
mov    $0x20,%esi
xor    %edx,%edx
mov    $0x10,%ecx
call   1050 <its@plt>
mov    %rax,%r15
lea    0x4(%rsp),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1050 <its@plt>
mov    %rax,%rbx
lea    0xe47(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rax,%rcx
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2dea(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@INTMAX_MAX = global i32 0
@UINTMAX_MAX = global i32 0
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %1
%8 = load i32, i32* @INTMAX_MAX
%9 = sub nsw i32 %8, 5
store i32 %9, i32* %2
%10 = load i32, i32* @INTMAX_MAX
%11 = sub nsw i32 0, %10
%12 = add nsw i32 %11, 7
store i32 %12, i32* %3
%13 = load i32, i32* @UINTMAX_MAX
%14 = sub nsw i32 %13, 100
store i32 %14, i32* %4
%15 = call i8* @its(i32* %2, i32 32, i32 0, i32 3)
store i8* %15, i8** %5
%16 = call i8* @its(i32* %3, i32 32, i32 0, i32 16)
store i8* %16, i8** %6
%17 = call i8* @its(i32* %4, i32 32, i32 1, i32 1)
store i8* %17, i8** %7
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = load i8*, i8** %7
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19, i8* %20)
%22 = load i8*, i8** %5
%23 = call i32 @free(i8* %22)
%24 = load i8*, i8** %6
%25 = call i32 @free(i8* %24)
%26 = load i8*, i8** %7
%27 = call i32 @free(i8* %26)
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}

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