#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*/ add_numbers(short, short);
short test_condition_add_numbers(short, short, int /*<<< orphan*/);
short unit_test_add_numbers() {
  short i = 0, j = 0;
  short lFail = 0;
  for (i = -100; i < 100; i++)
    for (j = -100; j < 100; j++)
      lFail |= test_condition_add_numbers(i, j, add_numbers(i, j));
  return lFail;
}


x86 assembly (clang, -O0):
<unit_test_add_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
movw   $0x0,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
movw   $0xff9c,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x64,%eax
jge    11c9 <unit_test_add_numbers+0xa9>
movw   $0xff9c,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x64,%eax
jge    11b3 <unit_test_add_numbers+0x93>
mov    -0x2(%rbp),%ax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1030 <add_numbers@plt>
mov    -0xa(%rbp),%cx
mov    %eax,%edx
mov    -0x8(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
call   1040 <test_condition_add_numbers@plt>
movswl %ax,%ecx
movswl -0x6(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x4(%rbp)
jmp    1153 <unit_test_add_numbers+0x33>
jmp    11b8 <unit_test_add_numbers+0x98>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    1140 <unit_test_add_numbers+0x20>
movswl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unit_test_add_numbers>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0xff9c,%r15w
xor    %r14d,%r14d
mov    $0xff9c,%bx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movswl %r15w,%ebp
movswl %bx,%r12d
mov    %ebp,%edi
mov    %r12d,%esi
call   1030 <add_numbers@plt>
mov    %ebp,%edi
mov    %r12d,%esi
mov    %eax,%edx
call   1040 <test_condition_add_numbers@plt>
or     %eax,%r14d
add    $0x1,%ebx
cmp    $0x64,%bx
jne    1140 <unit_test_add_numbers+0x20>
add    $0x1,%r15d
cmp    $0x64,%r15w
jne    1130 <unit_test_add_numbers+0x10>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @unit_test_add_numbers() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i16
store i16 0, i16* %1
store i16 0, i16* %2
store i16 0, i16* %3
store i16 -100, i16* %1
br label %4
4: ; preds = %29, %0
%5 = load i16, i16* %1
%6 = sext i16 %5 to i32
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %32
8: ; preds = %4
store i16 -100, i16* %2
br label %9
9: ; preds = %25, %8
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
%12 = icmp slt i32 %11, 100
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i16, i16* %1
%15 = load i16, i16* %2
%16 = load i16, i16* %1
%17 = load i16, i16* %2
%18 = call i32 @add_numbers(i16 signext %16, i16 signext %17)
%19 = call signext i16 @test_condition_add_numbers(i16 signext %14, i16 signext %15, i32 %18)
%20 = sext i16 %19 to i32
%21 = load i16, i16* %3
%22 = sext i16 %21 to i32
%23 = or i32 %22, %20
%24 = trunc i32 %23 to i16
store i16 %24, i16* %3
br label %25
25: ; preds = %13
%26 = load i16, i16* %2
%27 = add i16 %26, 1
store i16 %27, i16* %2
br label %9
28: ; preds = %9
br label %29
29: ; preds = %28
%30 = load i16, i16* %1
%31 = add i16 %30, 1
store i16 %31, i16* %1
br label %4
32: ; preds = %4
%33 = load i16, i16* %3
ret i16 %33
}

LLVM IR (-O2):
define signext i16 @unit_test_add_numbers() {
br label %1
1: ; preds = %0, %12
%2 = phi i16 [ 0, %0 ], [ %9, %12 ]
%3 = phi i16 [ -100, %0 ], [ %13, %12 ]
br label %4
4: ; preds = %1, %4
%5 = phi i16 [ %2, %1 ], [ %9, %4 ]
%6 = phi i16 [ -100, %1 ], [ %10, %4 ]
%7 = tail call i32 @add_numbers(i16 signext %3, i16 signext %6)
%8 = tail call signext i16 @test_condition_add_numbers(i16 signext %3, i16 signext %6, i32 %7)
%9 = or i16 %8, %5
%10 = add nsw i16 %6, 1
%11 = icmp eq i16 %10, 100
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = add nsw i16 %3, 1
%14 = icmp eq i16 %13, 100
br i1 %14, label %15, label %1
15: ; preds = %12
ret i16 %9
}