#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 CHAR_MAX;
int CHAR_MIN;
double FLT_MAX;
double FLT_MIN;
int INT_MAX;
int INT_MIN;
int my_strlen(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strlen(char *);
int main() {
  int my_oct = 023;
  int my_hex = 0x1a;
  int my_dec = 15;
  enum boolean { NO, YES };
  enum months {
    JAN = 1,
    FEB,
    MAR,
    APR,
    MAY,
    JUN,
    JUL,
    AUG,
    SEP,
    OCT,
    NOV,
    DEC
  };
  printf("Test: %d, %s\n", 5, "cat");
  printf("FLT_MAX: %f\n", FLT_MAX);
  printf("FLT_MIN: %f\n", FLT_MIN);
  printf("INT_MAX: %d\n", INT_MAX);
  printf("INT_MIN: %d\n", INT_MIN);
  printf("CHAR_MAX: %d\n", CHAR_MAX);
  printf("CHAR_MIN: %d\n", CHAR_MIN);
  printf("my_oct: %d\n", my_oct);
  printf("my_hex: %d\n", my_hex);
  printf("my_dec: %d\n", my_dec);
  printf("character constant \\0 is the null character, the character with "
         "value zero which numeric value is %d\n",
         '\0');
  printf("hello, "
         "I will use "
         "many lines to split and concatenate a long string"
         "\n");
  printf("Using strlen from standard library, length of %s is %ld\n", "mono",
         strlen("mono"));
  printf("Using my_strlen, length of %s is %d\n", "mono", my_strlen("mono"));
  printf("YES is %d\n", YES);
  printf("Value of month FEB is %d\n", FEB);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x13,-0x8(%rbp)
movl   $0x1a,-0xc(%rbp)
movl   $0xf,-0x10(%rbp)
lea    0xea5(%rip),%rdi
mov    $0x5,%esi
lea    0xea7(%rip),%rdx
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e4b(%rip),%rax
movsd  (%rax),%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x2e4a(%rip),%rax
movsd  (%rax),%xmm0
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe50(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf16(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
lea    0xecf(%rip),%rdi
lea    0xf01(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xef3(%rip),%rdi
call   1030 <my_strlen@plt>
mov    %eax,%edx
lea    0xeea(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xebf(%rip),%rdx
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e5e(%rip),%rax
movsd  (%rax),%xmm0
lea    0xea5(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0x2e5d(%rip),%rax
movsd  (%rax),%xmm0
lea    0xe99(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e1d(%rip),%rax
mov    (%rax),%esi
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%esi
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%esi
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe72(%rip),%rdi
mov    $0x13,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe6b(%rip),%rdi
mov    $0x1a,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe64(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe5d(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf3b(%rip),%rdi
call   1040 <puts@plt>
lea    0xee0(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1030 <my_strlen@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Test: %d, %s\0A\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [13 x i8] c"FLT_MAX: %f\0A\00"
@FLT_MAX = global double 0.000000e+00
@.str.3 = [13 x i8] c"FLT_MIN: %f\0A\00"
@FLT_MIN = global double 0.000000e+00
@.str.4 = [13 x i8] c"INT_MAX: %d\0A\00"
@INT_MAX = global i32 0
@.str.5 = [13 x i8] c"INT_MIN: %d\0A\00"
@INT_MIN = global i32 0
@.str.6 = [14 x i8] c"CHAR_MAX: %d\0A\00"
@CHAR_MAX = global i32 0
@.str.7 = [14 x i8] c"CHAR_MIN: %d\0A\00"
@CHAR_MIN = global i32 0
@.str.8 = [12 x i8] c"my_oct: %d\0A\00"
@.str.9 = [12 x i8] c"my_hex: %d\0A\00"
@.str.10 = [12 x i8] c"my_dec: %d\0A\00"
@.str.11 = [102 x i8] c"character constant \\0 is the null character, the character with value zero which numeric value is %d\0A\00"
@.str.12 = [69 x i8] c"hello, I will use many lines to split and concatenate a long string\0A\00"
@.str.13 = [57 x i8] c"Using strlen from standard library, length of %s is %ld\0A\00"
@.str.14 = [5 x i8] c"mono\00"
@.str.15 = [37 x i8] c"Using my_strlen, length of %s is %d\0A\00"
@.str.16 = [11 x i8] c"YES is %d\0A\00"
@.str.17 = [26 x i8] c"Value of month FEB is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 19, i32* %2
store i32 26, i32* %3
store i32 15, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = load double, double* @FLT_MAX
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = load double, double* @FLT_MIN
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %8)
%10 = load i32, i32* @INT_MAX
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @INT_MIN
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @CHAR_MAX
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @CHAR_MIN
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.11, i64 0, i64 0), i32 0)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.12, i64 0, i64 0))
%26 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 %26)
%28 = call i32 @my_strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 1)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Test: %d, %s\0A\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [13 x i8] c"FLT_MAX: %f\0A\00"
@FLT_MAX = global double 0.000000e+00
@.str.3 = [13 x i8] c"FLT_MIN: %f\0A\00"
@FLT_MIN = global double 0.000000e+00
@.str.4 = [13 x i8] c"INT_MAX: %d\0A\00"
@INT_MAX = global i32 0
@.str.5 = [13 x i8] c"INT_MIN: %d\0A\00"
@INT_MIN = global i32 0
@.str.6 = [14 x i8] c"CHAR_MAX: %d\0A\00"
@CHAR_MAX = global i32 0
@.str.7 = [14 x i8] c"CHAR_MIN: %d\0A\00"
@CHAR_MIN = global i32 0
@.str.8 = [12 x i8] c"my_oct: %d\0A\00"
@.str.9 = [12 x i8] c"my_hex: %d\0A\00"
@.str.10 = [12 x i8] c"my_dec: %d\0A\00"
@.str.11 = [102 x i8] c"character constant \\0 is the null character, the character with value zero which numeric value is %d\0A\00"
@.str.13 = [57 x i8] c"Using strlen from standard library, length of %s is %ld\0A\00"
@.str.14 = [5 x i8] c"mono\00"
@.str.15 = [37 x i8] c"Using my_strlen, length of %s is %d\0A\00"
@.str.16 = [11 x i8] c"YES is %d\0A\00"
@.str.17 = [26 x i8] c"Value of month FEB is %d\0A\00"
@str = [68 x i8] c"hello, I will use many lines to split and concatenate a long string\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = load double, double* @FLT_MAX
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %2)
%4 = load double, double* @FLT_MIN
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %4)
%6 = load i32, i32* @INT_MAX
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @INT_MIN
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @CHAR_MAX
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @CHAR_MIN
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 19)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 26)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @.str.11, i64 0, i64 0), i32 0)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%19 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 %19)
%21 = tail call i32 @my_strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 %21)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 1)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0), i32 2)
ret i32 0
}