#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 /*<<< orphan*/ longvalue;
typedef int /*<<< orphan*/ intvalue;
typedef int /*<<< orphan*/ floatvalue;
typedef int /*<<< orphan*/ doublevalue;
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int EXIT_SUCCESS;
int print_bit(char *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int intvalue = 0x12345678;
  if (print_bit((char *)&intvalue, sizeof(intvalue)) != -1) {
    printf("print INT success!\n\n");
  }
  long longvalue = 0x87654321;
  if (print_bit((char *)&longvalue, sizeof(longvalue)) != -1) {
    printf("print LONG success!\n\n");
  }
  float floatvalue = 0.12345678;
  if (print_bit((char *)&floatvalue, sizeof(floatvalue)) != -1) {
    printf("printf FLOAT success!\n\n");
  }
  double doublevalue = 0.12345678;
  if (print_bit((char *)&doublevalue, sizeof(doublevalue)) != -1) {
    printf("printf DOUBLE success!\n\n");
  }
  int array[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 1234};
  if (print_bit((char *)array, sizeof(array)) != -1) {
    printf("printf ARRAY success!\n\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1050 <print_bit@plt>
cmp    $0xffffffff,%eax
je     1169 <main+0x39>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x87654321,%eax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1050 <print_bit@plt>
cmp    $0xffffffff,%eax
je     1195 <main+0x65>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movss  0xe63(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1050 <print_bit@plt>
cmp    $0xffffffff,%eax
je     11c5 <main+0x95>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe3b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1050 <print_bit@plt>
cmp    $0xffffffff,%eax
je     11f5 <main+0xc5>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    0xe90(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x28,%esi
call   1050 <print_bit@plt>
cmp    $0xffffffff,%eax
je     122d <main+0xfd>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movl   $0x12345678,0xc(%rsp)
12
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
call   1040 <print_bit@plt>
cmp    $0xffffffff,%eax
je     114c <main+0x2c>
lea    0xf3c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x87654321,%eax
mov    %rax,0x18(%rsp)
lea    0x18(%rsp),%rdi
mov    $0x8,%esi
call   1040 <print_bit@plt>
cmp    $0xffffffff,%eax
je     1176 <main+0x56>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
movl   $0x3dfcd6e9,0x8(%rsp)
3d
lea    0x8(%rsp),%rdi
mov    $0x4,%esi
call   1040 <print_bit@plt>
cmp    $0xffffffff,%eax
je     119e <main+0x7e>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
movabs $0x3fbf9add1091c895,%rax
9a bf 3f
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x8,%esi
call   1040 <print_bit@plt>
cmp    $0xffffffff,%eax
je     11cd <main+0xad>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
mov    0xe4c(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xe30(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe14(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x28,%esi
call   1040 <print_bit@plt>
cmp    $0xffffffff,%eax
je     1211 <main+0xf1>
lea    0xe1c(%rip),%rdi
call   1030 <puts@plt>
mov    0x2dc8(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"print INT success!\0A\0A\00"
@.str.1 = [22 x i8] c"print LONG success!\0A\0A\00"
@.str.2 = [24 x i8] c"printf FLOAT success!\0A\0A\00"
@.str.3 = [25 x i8] c"printf DOUBLE success!\0A\0A\00"
@__const.main.array = [10 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 1234]
@.str.4 = [24 x i8] c"printf ARRAY success!\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca float
%5 = alloca double
%6 = alloca [10 x i32]
store i32 0, i32* %1
store i32 305419896, i32* %2
%7 = bitcast i32* %2 to i8*
%8 = call i32 @print_bit(i8* %7, i32 4)
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
store i64 2271560481, i64* %3
%13 = bitcast i64* %3 to i8*
%14 = call i32 @print_bit(i8* %13, i32 8)
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %12
store float 0x3FBF9ADD20000000, float* %4
%19 = bitcast float* %4 to i8*
%20 = call i32 @print_bit(i8* %19, i32 4)
%21 = icmp ne i32 %20, -1
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %18
store double 0x3FBF9ADD1091C895, double* %5
%25 = bitcast double* %5 to i8*
%26 = call i32 @print_bit(i8* %25, i32 8)
%27 = icmp ne i32 %26, -1
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %24
%31 = bitcast [10 x i32]* %6 to i8*
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%33 = bitcast i32* %32 to i8*
%34 = call i32 @print_bit(i8* %33, i32 40)
%35 = icmp ne i32 %34, -1
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %36, %30
%39 = load i32, i32* @EXIT_SUCCESS
ret i32 %39
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 1234]
@EXIT_SUCCESS = global i32 0
@str = [23 x i8] c"printf ARRAY success!\0A\00"
@str.5 = [24 x i8] c"printf DOUBLE success!\0A\00"
@str.6 = [23 x i8] c"printf FLOAT success!\0A\00"
@str.7 = [21 x i8] c"print LONG success!\0A\00"
@str.8 = [20 x i8] c"print INT success!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca float
%4 = alloca double
%5 = alloca [10 x i32]
%6 = bitcast i32* %1 to i8*
store i32 305419896, i32* %1
%7 = call i32 @print_bit(i8* %6, i32 4)
%8 = icmp eq i32 %7, -1
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = bitcast i64* %2 to i8*
store i64 2271560481, i64* %2
%13 = call i32 @print_bit(i8* %12, i32 8)
%14 = icmp eq i32 %13, -1
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
%18 = bitcast float* %3 to i8*
store float 0x3FBF9ADD20000000, float* %3
%19 = call i32 @print_bit(i8* %18, i32 4)
%20 = icmp eq i32 %19, -1
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
br label %23
23: ; preds = %21, %17
%24 = bitcast double* %4 to i8*
store double 0x3FBF9ADD1091C895, double* %4
%25 = call i32 @print_bit(i8* %24, i32 8)
%26 = icmp eq i32 %25, -1
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
br label %29
29: ; preds = %27, %23
%30 = bitcast [10 x i32]* %5 to i8*
%31 = call i32 @print_bit(i8* %30, i32 40)
%32 = icmp eq i32 %31, -1
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %35
35: ; preds = %33, %29
%36 = load i32, i32* @EXIT_SUCCESS
ret i32 %36
}