void WrEvalOrder(void) {
  int result;
  int order;
  int int_val;
  float float_val;
  int idx;
  int array_a[2];
  int array_b[2];
  static char found_order[][40] = {"Evaluation from left to right",
                                   "Evaluation seemingly arbitrary",
                                   "Evaluation from right to left"};
  WrMessage("@ARITHMETIC-EVALUATION");
  order = 0;
  WrMessage("@ARITHMETIC-TWO-SUM");
  result = OperandValue((-9), 0);
  result = OperandValue(1, 1) + OperandValue(2, 1);
  result = OperandValue((-999), 0);
  order += result;
  printf("Note: %s\n\n", found_order[result + 1]);
  WrMessage("@ARITHMETIC-THREE-SUM");
  result = OperandValue((-9), 0);
  result = OperandValue(1, 1) + OperandValue(2, 1) + OperandValue(3, 1);
  result = OperandValue((-999), 0);
  order += result;
  printf("Note: %s\n\n", found_order[result + 1]);
  WrMessage("@ARITHMETIC-FOUR-SUM");
  result = OperandValue((-9), 0);
  result = OperandValue(1, 1) + OperandValue(2, 1) + OperandValue(3, 1) +
           OperandValue(4, 1);
  result = OperandValue((-999), 0);
  order += result;
  printf("Note: %s\n\n", found_order[result + 1]);
  if (order != -3 && order != 3) {
    WrMessage("@ARITHMETIC-INDECISIVE");
  }
  WrMessage("@ARITHMETIC-MIXED-TYPE-CALC");
  int_val = 10;
  float_val = 1.4;
  (void)OperandValue((-9), 0);
  result = 1.7 + int_val + float_val;
  printf("Expected result is 13, it is %d\n\n", result);
  WrMessage("@ARITHMETIC-SIDE-EFFECTS");
  idx = 0;
  array_b[0] = 1;
  array_b[1] = 2;
  array_a[0] = 3;
  array_a[1] = 4;
  array_a[idx++] = array_b[idx];
  if (array_a[0] == array_b[0]) {
    printf("Statement equivalent to: a[i] = b[i] ; i ++ ;\n\n");
  }
  if (array_a[0] == array_b[1]) {
    printf("Statement equivalent to: a[i] = b[i+1] ; i ++ ;\n\n");
  }
  if (array_a[1] == array_b[0]) {
    printf("Statement equivalent to: a[i+1] = b[i] ; i ++ ;\n\n");
  }
  if (array_a[1] == array_b[1]) {
    printf("Statement equivalent to: i ++ ; a[i] = b[i] ;\n\n");
  }
  return;
}


x86 assembly (clang, -O0):
<WrEvalOrder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1050 <WrMessage@plt>
movl   $0x0,-0x8(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1050 <WrMessage@plt>
mov    $0xfffffff7,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0xfffffc19,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
lea    0x2e7f(%rip),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1050 <WrMessage@plt>
mov    $0xfffffff7,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x38(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0xfffffc19,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
lea    0x2ddb(%rip),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1050 <WrMessage@plt>
mov    $0xfffffff7,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x30(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0xfffffc19,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
lea    0x2d1c(%rip),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
lea    0xd05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xfffffffd,-0x8(%rbp)
je     135b <WrEvalOrder+0x22b>
cmpl   $0x3,-0x8(%rbp)
je     135b <WrEvalOrder+0x22b>
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1050 <WrMessage@plt>
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1050 <WrMessage@plt>
movl   $0xa,-0xc(%rbp)
movss  0xc90(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    $0xfffffff7,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <OperandValue@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xc68(%rip),%xmm0
addsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1050 <WrMessage@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x2,-0x20(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x4,-0x18(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x24(%rbp,%rax,4),%ecx
mov    -0x14(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
cltq
mov    %ecx,-0x1c(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    1425 <WrEvalOrder+0x2f5>
lea    0xcbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    143f <WrEvalOrder+0x30f>
lea    0xcd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    1459 <WrEvalOrder+0x329>
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1473 <WrEvalOrder+0x343>
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WrEvalOrder>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1060 <WrMessage@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1060 <WrMessage@plt>
mov    $0xfffffff7,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x2,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0xfffffc19,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%eax
cltq
lea    (%rax,%rax,4),%rax
lea    0x2e9f(%rip),%r15
lea    (%r15,%rax,8),%rsi
lea    0xe6f(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1060 <WrMessage@plt>
mov    $0xfffffff7,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x2,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x3,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0xfffffc19,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
add    %eax,%ebx
add    $0x1,%eax
cltq
lea    (%rax,%rax,4),%rax
lea    (%r15,%rax,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe09(%rip),%rdi
xor    %eax,%eax
call   1060 <WrMessage@plt>
mov    $0xfffffff7,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x2,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x3,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0x4,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
mov    $0xfffffc19,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
add    %eax,%ebx
add    $0x1,%eax
cltq
lea    (%rax,%rax,4),%rax
lea    (%r15,%rax,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0xfffffffd,%ebx
je     12db <WrEvalOrder+0x19b>
cmp    $0x3,%ebx
je     12db <WrEvalOrder+0x19b>
lea    0xd8d(%rip),%rdi
xor    %eax,%eax
call   1060 <WrMessage@plt>
lea    0xd96(%rip),%rdi
xor    %eax,%eax
call   1060 <WrMessage@plt>
mov    $0xfffffff7,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <OperandValue@plt>
lea    0xd96(%rip),%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xda5(%rip),%rdi
xor    %eax,%eax
call   1060 <WrMessage@plt>
lea    0xdb0(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@WrEvalOrder.found_order = internal global [3 x [40 x i8]] [[40 x i8] c"Evaluation from left to right\00\00\00\00\00\00\00\00\00\00\00", [40 x i8] c"Evaluation seemingly arbitrary\00\00\00\00\00\00\00\00\00\00", [40 x i8] c"Evaluation from right to left\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [23 x i8] c"@ARITHMETIC-EVALUATION\00"
@.str.1 = [20 x i8] c"@ARITHMETIC-TWO-SUM\00"
@.str.2 = [11 x i8] c"Note: %s\0A\0A\00"
@.str.3 = [22 x i8] c"@ARITHMETIC-THREE-SUM\00"
@.str.4 = [21 x i8] c"@ARITHMETIC-FOUR-SUM\00"
@.str.5 = [23 x i8] c"@ARITHMETIC-INDECISIVE\00"
@.str.6 = [28 x i8] c"@ARITHMETIC-MIXED-TYPE-CALC\00"
@.str.7 = [34 x i8] c"Expected result is 13, it is %d\0A\0A\00"
@.str.8 = [25 x i8] c"@ARITHMETIC-SIDE-EFFECTS\00"
@.str.9 = [48 x i8] c"Statement equivalent to: a[i] = b[i] ; i ++ ;\0A\0A\00"
@.str.10 = [50 x i8] c"Statement equivalent to: a[i] = b[i+1] ; i ++ ;\0A\0A\00"
@.str.11 = [50 x i8] c"Statement equivalent to: a[i+1] = b[i] ; i ++ ;\0A\0A\00"
@.str.12 = [48 x i8] c"Statement equivalent to: i ++ ; a[i] = b[i] ;\0A\0A\00"
define void @WrEvalOrder() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
store i32 %10, i32* %1
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 1, i32 1)
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 2, i32 1)
%13 = add nsw i32 %11, %12
store i32 %13, i32* %1
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -999, i32 0)
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = add nsw i32 %16, %15
store i32 %17, i32* %2
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x [40 x i8]], [3 x [40 x i8]]* @WrEvalOrder.found_order, i64 0, i64 %20
%22 = getelementptr inbounds [40 x i8], [40 x i8]* %21, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
store i32 %25, i32* %1
%26 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 1, i32 1)
%27 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 2, i32 1)
%28 = add nsw i32 %26, %27
%29 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 3, i32 1)
%30 = add nsw i32 %28, %29
store i32 %30, i32* %1
%31 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -999, i32 0)
store i32 %31, i32* %1
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = add nsw i32 %33, %32
store i32 %34, i32* %2
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [3 x [40 x i8]], [3 x [40 x i8]]* @WrEvalOrder.found_order, i64 0, i64 %37
%39 = getelementptr inbounds [40 x i8], [40 x i8]* %38, i64 0, i64 0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %39)
%41 = call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
store i32 %42, i32* %1
%43 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 1, i32 1)
%44 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 2, i32 1)
%45 = add nsw i32 %43, %44
%46 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 3, i32 1)
%47 = add nsw i32 %45, %46
%48 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 4, i32 1)
%49 = add nsw i32 %47, %48
store i32 %49, i32* %1
%50 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -999, i32 0)
store i32 %50, i32* %1
%51 = load i32, i32* %1
%52 = load i32, i32* %2
%53 = add nsw i32 %52, %51
store i32 %53, i32* %2
%54 = load i32, i32* %1
%55 = add nsw i32 %54, 1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [3 x [40 x i8]], [3 x [40 x i8]]* @WrEvalOrder.found_order, i64 0, i64 %56
%58 = getelementptr inbounds [40 x i8], [40 x i8]* %57, i64 0, i64 0
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %58)
%60 = load i32, i32* %2
%61 = icmp ne i32 %60, -3
br i1 %61, label %62, label %67
62: ; preds = %0
%63 = load i32, i32* %2
%64 = icmp ne i32 %63, 3
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %67
67: ; preds = %65, %62, %0
%68 = call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
store i32 10, i32* %3
store float 0x3FF6666660000000, float* %4
%69 = call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
%70 = load i32, i32* %3
%71 = sitofp i32 %70 to double
%72 = fadd double 1.700000e+00, %71
%73 = load float, float* %4
%74 = fpext float %73 to double
%75 = fadd double %72, %74
%76 = fptosi double %75 to i32
store i32 %76, i32* %1
%77 = load i32, i32* %1
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %77)
%79 = call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %5
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 1, i32* %80
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 2, i32* %81
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 3, i32* %82
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 4, i32* %83
%84 = load i32, i32* %5
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %85
%87 = load i32, i32* %86
%88 = load i32, i32* %5
%89 = add nsw i32 %88, 1
store i32 %89, i32* %5
%90 = sext i32 %88 to i64
%91 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %90
store i32 %87, i32* %91
%92 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%93 = load i32, i32* %92
%94 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%95 = load i32, i32* %94
%96 = icmp eq i32 %93, %95
br i1 %96, label %97, label %99
97: ; preds = %67
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.9, i64 0, i64 0))
br label %99
99: ; preds = %97, %67
%100 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%101 = load i32, i32* %100
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%103 = load i32, i32* %102
%104 = icmp eq i32 %101, %103
br i1 %104, label %105, label %107
105: ; preds = %99
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0))
br label %107
107: ; preds = %105, %99
%108 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%109 = load i32, i32* %108
%110 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%111 = load i32, i32* %110
%112 = icmp eq i32 %109, %111
br i1 %112, label %113, label %115
113: ; preds = %107
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0))
br label %115
115: ; preds = %113, %107
%116 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%117 = load i32, i32* %116
%118 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%119 = load i32, i32* %118
%120 = icmp eq i32 %117, %119
br i1 %120, label %121, label %123
121: ; preds = %115
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0))
br label %123
123: ; preds = %121, %115
ret void
}

LLVM IR (-O2):
@WrEvalOrder.found_order = internal global [3 x [40 x i8]] [[40 x i8] c"Evaluation from left to right\00\00\00\00\00\00\00\00\00\00\00", [40 x i8] c"Evaluation seemingly arbitrary\00\00\00\00\00\00\00\00\00\00", [40 x i8] c"Evaluation from right to left\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [23 x i8] c"@ARITHMETIC-EVALUATION\00"
@.str.1 = [20 x i8] c"@ARITHMETIC-TWO-SUM\00"
@.str.2 = [11 x i8] c"Note: %s\0A\0A\00"
@.str.3 = [22 x i8] c"@ARITHMETIC-THREE-SUM\00"
@.str.4 = [21 x i8] c"@ARITHMETIC-FOUR-SUM\00"
@.str.5 = [23 x i8] c"@ARITHMETIC-INDECISIVE\00"
@.str.6 = [28 x i8] c"@ARITHMETIC-MIXED-TYPE-CALC\00"
@.str.7 = [34 x i8] c"Expected result is 13, it is %d\0A\0A\00"
@.str.8 = [25 x i8] c"@ARITHMETIC-SIDE-EFFECTS\00"
@str.15 = [47 x i8] c"Statement equivalent to: a[i] = b[i] ; i ++ ;\0A\00"
define void @WrEvalOrder() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 1, i32 1)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 2, i32 1)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -999, i32 0)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [3 x [40 x i8]], [3 x [40 x i8]]* @WrEvalOrder.found_order, i64 0, i64 %8, i64 0
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
%13 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 1, i32 1)
%14 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 2, i32 1)
%15 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 3, i32 1)
%16 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -999, i32 0)
%17 = add nsw i32 %16, %6
%18 = add nsw i32 %16, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x [40 x i8]], [3 x [40 x i8]]* @WrEvalOrder.found_order, i64 0, i64 %19, i64 0
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%23 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
%24 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 1, i32 1)
%25 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 2, i32 1)
%26 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 3, i32 1)
%27 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 4, i32 1)
%28 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -999, i32 0)
%29 = add nsw i32 %17, %28
%30 = add nsw i32 %28, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x [40 x i8]], [3 x [40 x i8]]* @WrEvalOrder.found_order, i64 0, i64 %31, i64 0
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %32)
switch i32 %29, label %34 [
i32 -3, label %36
i32 3, label %36
]
34: ; preds = %0
%35 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %36
36: ; preds = %34, %0, %0
%37 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%38 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @OperandValue to i32 (i32, i32, ...)*)(i32 -9, i32 0)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 13)
%40 = tail call i32 (i8*, ...) bitcast (i32 (...)* @WrMessage to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.15, i64 0, i64 0))
ret void
}