SP_CASE(imacro, imetamacro_tail) {
  int total = __ii_idx_i(0, 10, 200) + __ii_idx_i(1, 10, 300) +
              __ii_idx_i(2, 10, 400) + __ii_idx_i(3, 10, 500);
  SP_TRUE(total == 1446);
}


x86 assembly (clang, -O0):
<SP_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
mov    $0xa,%esi
mov    $0xc8,%edx
mov    $0x0,%al
call   1040 <__ii_idx_i@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x12c,%edx
mov    $0x0,%al
call   1040 <__ii_idx_i@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x190,%edx
mov    $0x0,%al
call   1040 <__ii_idx_i@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x3,%edi
mov    $0xa,%esi
mov    $0x1f4,%edx
mov    $0x0,%al
call   1040 <__ii_idx_i@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x5a6,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SP_CASE>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
mov    $0xa,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1040 <__ii_idx_i@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x12c,%edx
xor    %eax,%eax
call   1040 <__ii_idx_i@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x190,%edx
xor    %eax,%eax
call   1040 <__ii_idx_i@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x3,%edi
mov    $0xa,%esi
mov    $0x1f4,%edx
xor    %eax,%eax
call   1040 <__ii_idx_i@plt>
add    %ebx,%eax
xor    %edi,%edi
cmp    $0x5a6,%eax
sete   %dil
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SP_TRUE@plt>

LLVM IR (-O0):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 0, i32 10, i32 200)
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 1, i32 10, i32 300)
%9 = add nsw i32 %7, %8
%10 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 2, i32 10, i32 400)
%11 = add nsw i32 %9, %10
%12 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 3, i32 10, i32 500)
%13 = add nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 1446
%16 = zext i1 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %16)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 0, i32 10, i32 200)
%4 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 1, i32 10, i32 300)
%5 = add nsw i32 %4, %3
%6 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 2, i32 10, i32 400)
%7 = add nsw i32 %5, %6
%8 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @__ii_idx_i to i32 (i32, i32, i32, ...)*)(i32 3, i32 10, i32 500)
%9 = add nsw i32 %7, %8
%10 = icmp eq i32 %9, 1446
%11 = zext i1 %10 to i32
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %11)
ret i32 undef
}