#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 */
double convert_to_scientific_notation(double);
short *find_mantissa(unsigned long, int);
short find_sign(float);
int /*<<< orphan*/ free(short *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float number = -0.75;
  short sign = find_sign(number);
  short *exponent;
  exponent = (short *)malloc(8 * sizeof(short));
  double sci_notation = convert_to_scientific_notation(173.7);
  printf("%lf\n", sci_notation);
  short *mantissa;
  mantissa = (short *)malloc(23 * sizeof(short));
  mantissa = find_mantissa(135703125ul, 9);
  int i;
  printf("mantissa = ");
  for (i = 0; i < 23; i++) {
    printf("%d", mantissa[i]);
  }
  printf("\n");
  short result[32];
  free(exponent);
  free(mantissa);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xe91(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1070 <find_sign@plt>
mov    %ax,-0xa(%rbp)
mov    $0x10,%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
movsd  0xe60(%rip),%xmm0
call   1060 <convert_to_scientific_notation@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe56(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x2e,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x816aa55,%edi
mov    $0x9,%esi
call   1040 <find_mantissa@plt>
mov    %rax,-0x28(%rbp)
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x17,-0x2c(%rbp)
jge    1225 <main+0xc5>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movswl (%rax,%rcx,2),%esi
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11f3 <main+0x93>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
movss  0xe83(%rip),%xmm0
call   1080 <find_sign@plt>
mov    $0x10,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
movsd  0xe71(%rip),%xmm0
call   1070 <convert_to_scientific_notation@plt>
lea    0xe6d(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0x2e,%edi
call   1090 <malloc@plt>
mov    $0x816aa55,%edi
mov    $0x9,%esi
call   1050 <find_mantissa@plt>
mov    %rax,%rbx
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl (%rbx),%esi
lea    0xe43(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x2(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x4(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x6(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x8(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0xa(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0xc(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0xe(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x10(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x12(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x14(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x16(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x18(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x1a(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x1c(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x1e(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x20(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x22(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x24(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x26(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x28(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x2a(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movswl 0x2c(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
@.str.1 = [12 x i8] c"mantissa = \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i16
%4 = alloca i16*
%5 = alloca double
%6 = alloca i16*
%7 = alloca i32
%8 = alloca [32 x i16]
store i32 0, i32* %1
store float -7.500000e-01, float* %2
%9 = load float, float* %2
%10 = call signext i16 @find_sign(float %9)
store i16 %10, i16* %3
%11 = call i64 @malloc(i32 16)
%12 = inttoptr i64 %11 to i16*
store i16* %12, i16** %4
%13 = call double @convert_to_scientific_notation(double 1.737000e+02)
store double %13, double* %5
%14 = load double, double* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %14)
%16 = call i64 @malloc(i32 46)
%17 = inttoptr i64 %16 to i16*
store i16* %17, i16** %6
%18 = call i16* @find_mantissa(i64 135703125, i32 9)
store i16* %18, i16** %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %7
br label %20
20: ; preds = %31, %0
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 23
br i1 %22, label %23, label %34
23: ; preds = %20
%24 = load i16*, i16** %6
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i16, i16* %24, i64 %26
%28 = load i16, i16* %27
%29 = sext i16 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %23
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %20
34: ; preds = %20
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = load i16*, i16** %4
%37 = call i32 @free(i16* %36)
%38 = load i16*, i16** %6
%39 = call i32 @free(i16* %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
@.str.1 = [12 x i8] c"mantissa = \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call signext i16 @find_sign(float -7.500000e-01)
%2 = tail call i64 @malloc(i32 16)
%3 = tail call double @convert_to_scientific_notation(double 1.737000e+02)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call i64 @malloc(i32 46)
%6 = tail call i16* @find_mantissa(i64 135703125, i32 9)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = load i16, i16* %6
%9 = sext i16 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds i16, i16* %6, i64 1
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds i16, i16* %6, i64 2
%16 = load i16, i16* %15
%17 = sext i16 %16 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds i16, i16* %6, i64 3
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds i16, i16* %6, i64 4
%24 = load i16, i16* %23
%25 = sext i16 %24 to i32
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds i16, i16* %6, i64 5
%28 = load i16, i16* %27
%29 = sext i16 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds i16, i16* %6, i64 6
%32 = load i16, i16* %31
%33 = sext i16 %32 to i32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds i16, i16* %6, i64 7
%36 = load i16, i16* %35
%37 = sext i16 %36 to i32
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds i16, i16* %6, i64 8
%40 = load i16, i16* %39
%41 = sext i16 %40 to i32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds i16, i16* %6, i64 9
%44 = load i16, i16* %43
%45 = sext i16 %44 to i32
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds i16, i16* %6, i64 10
%48 = load i16, i16* %47
%49 = sext i16 %48 to i32
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds i16, i16* %6, i64 11
%52 = load i16, i16* %51
%53 = sext i16 %52 to i32
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds i16, i16* %6, i64 12
%56 = load i16, i16* %55
%57 = sext i16 %56 to i32
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds i16, i16* %6, i64 13
%60 = load i16, i16* %59
%61 = sext i16 %60 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %61)
%63 = getelementptr inbounds i16, i16* %6, i64 14
%64 = load i16, i16* %63
%65 = sext i16 %64 to i32
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = getelementptr inbounds i16, i16* %6, i64 15
%68 = load i16, i16* %67
%69 = sext i16 %68 to i32
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %69)
%71 = getelementptr inbounds i16, i16* %6, i64 16
%72 = load i16, i16* %71
%73 = sext i16 %72 to i32
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %73)
%75 = getelementptr inbounds i16, i16* %6, i64 17
%76 = load i16, i16* %75
%77 = sext i16 %76 to i32
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %77)
%79 = getelementptr inbounds i16, i16* %6, i64 18
%80 = load i16, i16* %79
%81 = sext i16 %80 to i32
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %81)
%83 = getelementptr inbounds i16, i16* %6, i64 19
%84 = load i16, i16* %83
%85 = sext i16 %84 to i32
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %85)
%87 = getelementptr inbounds i16, i16* %6, i64 20
%88 = load i16, i16* %87
%89 = sext i16 %88 to i32
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %89)
%91 = getelementptr inbounds i16, i16* %6, i64 21
%92 = load i16, i16* %91
%93 = sext i16 %92 to i32
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %93)
%95 = getelementptr inbounds i16, i16* %6, i64 22
%96 = load i16, i16* %95
%97 = sext i16 %96 to i32
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %97)
%99 = inttoptr i64 %2 to i16*
%100 = tail call i32 @putchar(i32 10)
%101 = tail call i32 @free(i16* %99)
%102 = tail call i32 @free(i16* %6)
ret i32 0
}