#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, int, ...);
int main(void) {
  int i, j, sum, dif, pro, quo, res;
  double x, y, rat;
  for (i = 1; i < 5; i++) {
    for (j = 1; j < 5; j++) {
      x = (double)i;
      y = (double)j;
      sum = i + j;
      dif = i - j;
      pro = i * j;
      quo = i / j;
      res = i % j;
      rat = x / y;
      printf("i = %d, j = %d: ", i, j);
      printf("%2d %2d %2d %2d %2d %5.2f\n", sum, dif, pro, quo, res, rat);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11ed <main+0xdd>
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11da <main+0xca>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
movsd  -0x38(%rbp),%xmm0
lea    0xe4c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    11df <main+0xcf>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0x1,%ebp
movsd  0xed5(%rip),%xmm1
mov    $0x4,%r15d
movl   $0x2,0x14(%rsp)
mov    $0x3,%r12d
movapd %xmm1,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm1,0x8(%rsp)
mov    %ebp,%r13d
mov    $0xaaaaaaab,%eax
imul   %rax,%r13
shr    $0x21,%r13
lea    0x0(%r13,%r13,2),%eax
mov    %eax,0x18(%rsp)
addsd  0xe89(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0xe9c(%rip),%rdi
mov    %ebp,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rbp),%esi
mov    %esi,0x24(%rsp)
lea    -0x1(%rbp),%edx
lea    0xe8e(%rip),%rdi
mov    %ebp,%ecx
mov    %ebp,%r8d
xor    %r9d,%r9d
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r15d,%ebx
mov    %ebp,%r15d
shr    %r15d
mov    %ebp,%r14d
and    $0x1,%r14d
movsd  0x8(%rsp),%xmm0
mulsd  0xe32(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0xe3d(%rip),%rdi
mov    %ebp,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2(%rbp),%esi
lea    -0x2(%rbp),%edx
lea    0xe33(%rip),%rdi
mov    0x14(%rsp),%ecx
mov    %r15d,%r8d
mov    %ebx,%r15d
mov    %r14d,%r9d
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    %ebp,%ebx
sub    0x18(%rsp),%ebx
movsd  0x8(%rsp),%xmm0
divsd  0xde4(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0xde7(%rip),%rdi
mov    %ebp,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x3(%rbp),%esi
lea    -0x3(%rbp),%edx
lea    0xddd(%rip),%rdi
mov    %r12d,%ecx
mov    %r13d,%r8d
mov    %ebx,%r9d
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    %ebp,%r14d
shr    $0x2,%r14d
cmp    $0x4,%ebp
mov    %ebp,%ebx
mov    $0x0,%eax
cmove  %eax,%ebx
movsd  0x8(%rsp),%xmm0
mulsd  0xd8c(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xd87(%rip),%rdi
mov    %ebp,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rbp),%esi
add    $0xfffffffc,%ebp
lea    0xd7d(%rip),%rdi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %ebx,%r9d
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm0
add    $0x4,%r15d
addl   $0x2,0x14(%rsp)
add    $0x3,%r12d
movapd %xmm0,%xmm1
mov    0x24(%rsp),%eax
mov    %eax,%ebp
cmp    $0x5,%eax
jne    1150 <main+0x40>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"i = %d, j = %d: \00"
@.str.1 = [27 x i8] c"%2d %2d %2d %2d %2d %5.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %1
store i32 1, i32* %2
br label %12
12: ; preds = %56, %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %59
15: ; preds = %12
store i32 1, i32* %3
br label %16
16: ; preds = %52, %15
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 5
br i1 %18, label %19, label %55
19: ; preds = %16
%20 = load i32, i32* %2
%21 = sitofp i32 %20 to double
store double %21, double* %9
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
store double %23, double* %10
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = add nsw i32 %24, %25
store i32 %26, i32* %4
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = sub nsw i32 %27, %28
store i32 %29, i32* %5
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = mul nsw i32 %30, %31
store i32 %32, i32* %6
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = sdiv i32 %33, %34
store i32 %35, i32* %7
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = srem i32 %36, %37
store i32 %38, i32* %8
%39 = load double, double* %9
%40 = load double, double* %10
%41 = fdiv double %39, %40
store double %41, double* %11
%42 = load i32, i32* %2
%43 = load i32, i32* %3
%44 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %42, i32 %43)
%45 = load i32, i32* %4
%46 = load i32, i32* %5
%47 = load i32, i32* %6
%48 = load i32, i32* %7
%49 = load i32, i32* %8
%50 = load double, double* %11
%51 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %45, i32 %46, i32 %47, i32 %48, i32 %49, double %50)
br label %52
52: ; preds = %19
%53 = load i32, i32* %3
%54 = add nsw i32 %53, 1
store i32 %54, i32* %3
br label %16
55: ; preds = %16
br label %56
56: ; preds = %55
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 1
store i32 %58, i32* %2
br label %12
59: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"i = %d, j = %d: \00"
@.str.1 = [27 x i8] c"%2d %2d %2d %2d %2d %5.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = sitofp i32 %2 to double
%4 = add nuw nsw i32 %2, 1
%5 = add nsw i32 %2, -1
%6 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1)
%7 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5, i32 %2, i32 %2, i32 0, double %3)
%8 = add nuw nsw i32 %2, 2
%9 = add nsw i32 %2, -2
%10 = shl nuw nsw i32 %2, 1
%11 = lshr i32 %2, 1
%12 = and i32 %2, 1
%13 = fmul double %3, 5.000000e-01
%14 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i32 2)
%15 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, double %13)
%16 = add nuw nsw i32 %2, 3
%17 = add nsw i32 %2, -3
%18 = mul nuw nsw i32 %2, 3
%19 = udiv i32 %2, 3
%20 = urem i32 %2, 3
%21 = fdiv double %3, 3.000000e+00
%22 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i32 3)
%23 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, double %21)
%24 = add nuw nsw i32 %2, 4
%25 = add nsw i32 %2, -4
%26 = shl nuw nsw i32 %2, 2
%27 = lshr i32 %2, 2
%28 = icmp eq i32 %2, 4
%29 = select i1 %28, i32 0, i32 %2
%30 = fmul double %3, 2.500000e-01
%31 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i32 4)
%32 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %25, i32 %26, i32 %27, i32 %29, double %30)
%33 = icmp eq i32 %4, 5
br i1 %33, label %34, label %1
34: ; preds = %1
ret i32 0
}