#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 /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("\n\nQuestion 8\n\n");
  printf("*%20.10d*\n*%-20.10d*\n*%.10d*\n*%-20d*\n", 123456, 123456, -123456,
         -123456);
  printf("%.4f\n", 83.162);
  printf("%12.5e\n", 30.253);
  printf("%-6.2g\n", .0000009979);
  printf("\n\nQuestion 9\n\n");
  float a, b, c, d;
  a = 13 % 4;
  b = -13 % 4;
  c = 13 % -4;
  d = -13 % -4;
  printf("%f, %f, %f, %f\n", a, b, c, d);
  a = 13 / 4;
  b = -13 / 4;
  c = 13 / -4;
  d = -13 / -4;
  printf("%f, %f, %f, %f\n", a, b, c, d);
  printf("\n\nQuestion 10\n\n");
  int i = 1, j = 2;
  int k = 3, m = 4;
  i %= j++ % (k += --m);
  printf("%d %d %d %d\n", i++, ++j, k--, --m);
  printf("\n\nQuestion 11\n\n");
  i = 1, j = 2;
  k = 3, m = 4;
  i *= j / -(k -= ++m);
  printf("%d %d %d %d\n", i++, ++j, k--, --m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x1e240,%edx
mov    $0xfffe1dc0,%r8d
mov    %edx,%esi
mov    %r8d,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
movsd  0xecd(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
movsd  0xeaf(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
movsd  0xe91(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xe70(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xe5f(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe56(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe45(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x10(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe8f(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movss  0xdfe(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xdf5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xde8(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xdd7(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x10(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe29(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
mov    -0x20(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x20(%rbp)
add    -0x1c(%rbp),%ecx
mov    %ecx,-0x1c(%rbp)
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%r8d
add    $0xffffffff,%r8d
mov    %r8d,-0x20(%rbp)
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
mov    -0x1c(%rbp),%edx
sub    %ecx,%edx
mov    %edx,-0x1c(%rbp)
xor    %ecx,%ecx
sub    %edx,%ecx
cltd
idiv   %ecx
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%r8d
add    $0xffffffff,%r8d
mov    %r8d,-0x20(%rbp)
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf69(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
mov    $0x1e240,%esi
mov    $0x1e240,%edx
mov    $0xfffe1dc0,%ecx
mov    $0xfffe1dc0,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf07(%rip),%rdi
movsd  0xea1(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
movsd  0xe93(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
movsd  0xe85(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rbx
movsd  0xe6b(%rip),%xmm0
movsd  0xe6b(%rip),%xmm1
mov    %rbx,%rdi
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0xe5b(%rip),%xmm1
movsd  0xe5b(%rip),%xmm0
mov    %rbx,%rdi
movaps %xmm1,%xmm2
movaps %xmm0,%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x6,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0xfffffffe,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\0A\0AQuestion 8\0A\0A\00"
@.str.1 = [38 x i8] c"*%20.10d*\0A*%-20.10d*\0A*%.10d*\0A*%-20d*\0A\00"
@.str.2 = [6 x i8] c"%.4f\0A\00"
@.str.3 = [8 x i8] c"%12.5e\0A\00"
@.str.4 = [8 x i8] c"%-6.2g\0A\00"
@.str.5 = [15 x i8] c"\0A\0AQuestion 9\0A\0A\00"
@.str.6 = [16 x i8] c"%f, %f, %f, %f\0A\00"
@.str.7 = [16 x i8] c"\0A\0AQuestion 10\0A\0A\00"
@.str.8 = [13 x i8] c"%d %d %d %d\0A\00"
@.str.9 = [16 x i8] c"\0A\0AQuestion 11\0A\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 123456, i32 123456, i32 -123456, i32 -123456)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double 8.316200e+01)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double 3.025300e+01)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double 9.979000e-07)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store float 1.000000e+00, float* %1
store float -1.000000e+00, float* %2
store float 1.000000e+00, float* %3
store float -1.000000e+00, float* %4
%15 = load float, float* %1
%16 = fpext float %15 to double
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = load float, float* %4
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double %16, double %18, double %20, double %22)
store float 3.000000e+00, float* %1
store float -3.000000e+00, float* %2
store float -3.000000e+00, float* %3
store float 3.000000e+00, float* %4
%24 = load float, float* %1
%25 = fpext float %24 to double
%26 = load float, float* %2
%27 = fpext float %26 to double
%28 = load float, float* %3
%29 = fpext float %28 to double
%30 = load float, float* %4
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double %25, double %27, double %29, double %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %5
store i32 2, i32* %6
store i32 3, i32* %7
store i32 4, i32* %8
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
%36 = load i32, i32* %8
%37 = add nsw i32 %36, -1
store i32 %37, i32* %8
%38 = load i32, i32* %7
%39 = add nsw i32 %38, %37
store i32 %39, i32* %7
%40 = srem i32 %34, %39
%41 = load i32, i32* %5
%42 = srem i32 %41, %40
store i32 %42, i32* %5
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
%47 = load i32, i32* %7
%48 = add nsw i32 %47, -1
store i32 %48, i32* %7
%49 = load i32, i32* %8
%50 = add nsw i32 %49, -1
store i32 %50, i32* %8
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %43, i32 %46, i32 %47, i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %5
store i32 2, i32* %6
store i32 3, i32* %7
store i32 4, i32* %8
%53 = load i32, i32* %6
%54 = load i32, i32* %8
%55 = add nsw i32 %54, 1
store i32 %55, i32* %8
%56 = load i32, i32* %7
%57 = sub nsw i32 %56, %55
store i32 %57, i32* %7
%58 = sub nsw i32 0, %57
%59 = sdiv i32 %53, %58
%60 = load i32, i32* %5
%61 = mul nsw i32 %60, %59
store i32 %61, i32* %5
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
%66 = load i32, i32* %7
%67 = add nsw i32 %66, -1
store i32 %67, i32* %7
%68 = load i32, i32* %8
%69 = add nsw i32 %68, -1
store i32 %69, i32* %8
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %62, i32 %65, i32 %66, i32 %69)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"*%20.10d*\0A*%-20.10d*\0A*%.10d*\0A*%-20d*\0A\00"
@.str.2 = [6 x i8] c"%.4f\0A\00"
@.str.3 = [8 x i8] c"%12.5e\0A\00"
@.str.4 = [8 x i8] c"%-6.2g\0A\00"
@.str.6 = [16 x i8] c"%f, %f, %f, %f\0A\00"
@.str.8 = [13 x i8] c"%d %d %d %d\0A\00"
@str = [14 x i8] c"\0A\0AQuestion 8\0A\00"
@str.10 = [14 x i8] c"\0A\0AQuestion 9\0A\00"
@str.11 = [15 x i8] c"\0A\0AQuestion 10\0A\00"
@str.12 = [15 x i8] c"\0A\0AQuestion 11\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 123456, i32 123456, i32 -123456, i32 -123456)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double 8.316200e+01)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double 3.025300e+01)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double 9.979000e-07)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, double -1.000000e+00)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double 3.000000e+00, double -3.000000e+00, double -3.000000e+00, double 3.000000e+00)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 1, i32 4, i32 6, i32 2)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 1, i32 3, i32 -2, i32 4)
ret i32 0
}