int main() {
  double d;
  int i;
  long l;
  unsigned long ul;
  char *stringPtr;
  d = atof("99.0");
  printf("%s%.3f\n%s%.3f\n", "The string \"99.0\" converted to double is ", d,
         "The converted value divided by 2 is ", d / 2.0);
  i = atoi("2593");
  printf("\n%s%i\n%s%i\n", "The string \"2593\" converted to int is ", i,
         "The converted value minus 593 is ", i - 593);
  l = atol("1000000");
  printf("\n%s%ld\n%s%ld\n", "The string \"1000000\" converted to long int is ",
         l, "The converted value divided by 2 is ", l / 2);
  const char *string = "51.2% are admitted";
  d = strtod(string, &stringPtr);
  printf("\nThe string \"%s\" is converted to the\n", string);
  printf("double value %.2f and the string \"%s\"\n", d, stringPtr);
  const char *string1 = "51556 fans attended";
  l = strtol(string1, &stringPtr, 0);
  printf("\nThe string \"%s\" is converted to the\n", string1);
  printf("long value %ld and the string \"%s\"\n", l, stringPtr);
  const char *string2 = "655642 sheep in Sweden like pillows";
  ul = strtoul(string2, &stringPtr, 0);
  printf("\nThe string \"%s\" is converted to the\n", string2);
  printf("unsigned long value %lu and the string \"%s\"\n", ul, stringPtr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe58(%rip),%xmm2
divsd  %xmm2,%xmm1
lea    0xe5a(%rip),%rdi
lea    0xe62(%rip),%rsi
lea    0xe85(%rip),%rdx
mov    $0x2,%al
call   1050 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%r8d
sub    $0x251,%r8d
lea    0xe82(%rip),%rdi
lea    0xe87(%rip),%rsi
lea    0xea7(%rip),%rcx
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1070 <atol@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x50(%rbp),%rdx
mov    %rax,%r8
lea    0xe92(%rip),%rdi
lea    0xe99(%rip),%rsi
lea    0xdfd(%rip),%rcx
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb3(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mov    -0x30(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xecd(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1060 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xebf(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1080 <strtoul@plt>
mov    %rax,-0x28(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1040 <atof@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe6b(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xe6d(%rip),%rdi
lea    0xe75(%rip),%rsi
lea    0xe98(%rip),%rbx
mov    %rbx,%rdx
mov    $0x2,%al
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1090 <atoi@plt>
lea    -0x251(%rax),%r8d
lea    0xe9c(%rip),%rdi
lea    0xea1(%rip),%rsi
lea    0xec1(%rip),%rcx
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1070 <atol@plt>
movslq %eax,%rdx
mov    %edx,%eax
shr    $0x1f,%eax
add    %edx,%eax
sar    %eax
movslq %eax,%r8
lea    0xebe(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee3(%rip),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strtod@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xed9(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xee6(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xef9(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1060 <strtol@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rdx
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xef7(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1080 <strtoul@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rdx
lea    0xef2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"99.0\00"
@.str.1 = [15 x i8] c"%s%.3f\0A%s%.3f\0A\00"
@.str.2 = [42 x i8] c"The string \2299.0\22 converted to double is \00"
@.str.3 = [37 x i8] c"The converted value divided by 2 is \00"
@.str.4 = [5 x i8] c"2593\00"
@.str.5 = [12 x i8] c"\0A%s%i\0A%s%i\0A\00"
@.str.6 = [39 x i8] c"The string \222593\22 converted to int is \00"
@.str.7 = [34 x i8] c"The converted value minus 593 is \00"
@.str.8 = [8 x i8] c"1000000\00"
@.str.9 = [14 x i8] c"\0A%s%ld\0A%s%ld\0A\00"
@.str.10 = [47 x i8] c"The string \221000000\22 converted to long int is \00"
@.str.11 = [19 x i8] c"51.2% are admitted\00"
@.str.12 = [38 x i8] c"\0AThe string \22%s\22 is converted to the\0A\00"
@.str.13 = [39 x i8] c"double value %.2f and the string \22%s\22\0A\00"
@.str.14 = [20 x i8] c"51556 fans attended\00"
@.str.15 = [36 x i8] c"long value %ld and the string \22%s\22\0A\00"
@.str.16 = [36 x i8] c"655642 sheep in Sweden like pillows\00"
@.str.17 = [45 x i8] c"unsigned long value %lu and the string \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = sitofp i32 %10 to double
store double %11, double* %2
%12 = load double, double* %2
%13 = load double, double* %2
%14 = fdiv double %13, 2.000000e+00
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), double %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), double %14)
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 593
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %17, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %19)
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%22 = sext i32 %21 to i64
store i64 %22, i64* %4
%23 = load i64, i64* %4
%24 = load i64, i64* %4
%25 = sdiv i64 %24, 2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i64 %23, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i64 %25)
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8** %7
%27 = load i8*, i8** %7
%28 = call double @strtod(i8* %27, i8** %6)
store double %28, double* %2
%29 = load i8*, i8** %7
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i8* %29)
%31 = load double, double* %2
%32 = load i8*, i8** %6
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), double %31, i8* %32)
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8** %8
%34 = load i8*, i8** %8
%35 = call i64 @strtol(i8* %34, i8** %6, i32 0)
store i64 %35, i64* %4
%36 = load i8*, i8** %8
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i8* %36)
%38 = load i64, i64* %4
%39 = load i8*, i8** %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0), i64 %38, i8* %39)
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0), i8** %9
%41 = load i8*, i8** %9
%42 = call i64 @strtoul(i8* %41, i8** %6, i32 0)
store i64 %42, i64* %5
%43 = load i8*, i8** %9
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i8* %43)
%45 = load i64, i64* %5
%46 = load i8*, i8** %6
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0), i64 %45, i8* %46)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"99.0\00"
@.str.1 = [15 x i8] c"%s%.3f\0A%s%.3f\0A\00"
@.str.2 = [42 x i8] c"The string \2299.0\22 converted to double is \00"
@.str.3 = [37 x i8] c"The converted value divided by 2 is \00"
@.str.4 = [5 x i8] c"2593\00"
@.str.5 = [12 x i8] c"\0A%s%i\0A%s%i\0A\00"
@.str.6 = [39 x i8] c"The string \222593\22 converted to int is \00"
@.str.7 = [34 x i8] c"The converted value minus 593 is \00"
@.str.8 = [8 x i8] c"1000000\00"
@.str.9 = [14 x i8] c"\0A%s%ld\0A%s%ld\0A\00"
@.str.10 = [47 x i8] c"The string \221000000\22 converted to long int is \00"
@.str.11 = [19 x i8] c"51.2% are admitted\00"
@.str.12 = [38 x i8] c"\0AThe string \22%s\22 is converted to the\0A\00"
@.str.13 = [39 x i8] c"double value %.2f and the string \22%s\22\0A\00"
@.str.14 = [20 x i8] c"51556 fans attended\00"
@.str.15 = [36 x i8] c"long value %ld and the string \22%s\22\0A\00"
@.str.16 = [36 x i8] c"655642 sheep in Sweden like pillows\00"
@.str.17 = [45 x i8] c"unsigned long value %lu and the string \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 5.000000e-01
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), double %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), double %5)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%8 = add nsw i32 %7, -593
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %8)
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%11 = sext i32 %10 to i64
%12 = sdiv i32 %10, 2
%13 = sext i32 %12 to i64
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), i64 %11, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i64 %13)
%15 = call double @strtod(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8** %1)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
%17 = load i8*, i8** %1
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), double %15, i8* %17)
%19 = call i64 @strtol(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i8** %1, i32 0)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%21 = load i8*, i8** %1
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0), i64 %19, i8* %21)
%23 = call i64 @strtoul(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0), i8** %1, i32 0)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0))
%25 = load i8*, i8** %1
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.17, i64 0, i64 0), i64 %23, i8* %25)
ret i32 0
}