#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int mantissa0;
  int mantissa1;
  int exponent;
  int negative;
};
union ieee754_double {
  double d;
  TYPE_1__ ieee;
};

/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ fprintf(char *, char *);
int /*<<< orphan*/ printf(char *, double, int, int, int, int);
int main(int argc, char *argv[]) {
  int i;
  if (argc < 2) {
    fprintf("usage: %s STRING ...\n", argv[0]);
    return 1;
  }
  for (i = 1; i < argc; i++) {
    union ieee754_double udouble;
    udouble.d = atof(argv[i]);
    printf("%g: mantissa0: %u, mantissa1: %u, exponent: %u, negative: %u\n",
           udouble.d, udouble.ieee.mantissa0, udouble.ieee.mantissa1,
           udouble.ieee.exponent, udouble.ieee.negative);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11cb <main+0x9b>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c4 <main+0x94>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
lea    0xe65(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1176 <main+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
cmp    $0x2,%edi
jge    1156 <main+0x26>
mov    (%r15),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <fprintf@plt>
mov    $0x1,%eax
jmp    1198 <main+0x68>
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xeb1(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
call   1030 <atof@plt>
movq   %xmm0,%rsi
mov    %rsi,%rdx
shr    $0x20,%rdx
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%union.ieee754_double = type { double, [8 x i8] }
%struct.TYPE_2__ = type { i32, i32, i32, i32 }
@.str = [22 x i8] c"usage: %s STRING ...\0A\00"
@.str.1 = [62 x i8] c"%g: mantissa0: %u, mantissa1: %u, exponent: %u, negative: %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %union.ieee754_double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 1, i32* %3
br label %47
15: ; preds = %2
store i32 1, i32* %6
br label %16
16: ; preds = %43, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %46
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call double @atof(i8* %25)
%27 = bitcast %union.ieee754_double* %7 to double*
store double %26, double* %27
%28 = bitcast %union.ieee754_double* %7 to double*
%29 = load double, double* %28
%30 = bitcast %union.ieee754_double* %7 to %struct.TYPE_2__*
%31 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %30, i32 0, i32 0
%32 = load i32, i32* %31
%33 = bitcast %union.ieee754_double* %7 to %struct.TYPE_2__*
%34 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %33, i32 0, i32 1
%35 = load i32, i32* %34
%36 = bitcast %union.ieee754_double* %7 to %struct.TYPE_2__*
%37 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %36, i32 0, i32 2
%38 = load i32, i32* %37
%39 = bitcast %union.ieee754_double* %7 to %struct.TYPE_2__*
%40 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %39, i32 0, i32 3
%41 = load i32, i32* %40
%42 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), double %29, i32 %32, i32 %35, i32 %38, i32 %41)
br label %43
43: ; preds = %20
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %16
46: ; preds = %16
store i32 0, i32* %3
br label %47
47: ; preds = %46, %10
%48 = load i32, i32* %3
ret i32 %48
}

LLVM IR (-O2):
@.str = [22 x i8] c"usage: %s STRING ...\0A\00"
@.str.1 = [62 x i8] c"%g: mantissa0: %u, mantissa1: %u, exponent: %u, negative: %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %9
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @fprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %21
9: ; preds = %4, %9
%10 = phi i64 [ 1, %4 ], [ %19, %9 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call double @atof(i8* %12)
%14 = bitcast double %13 to i64
%15 = trunc i64 %14 to i32
%16 = lshr i64 %14, 32
%17 = trunc i64 %16 to i32
%18 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), double %13, i32 %15, i32 %17, i32 undef, i32 undef)
%19 = add nuw nsw i64 %10, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %21, label %9
21: ; preds = %9, %6
%22 = phi i32 [ 1, %6 ], [ 0, %9 ]
ret i32 %22
}