#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 get_steps(int);
int /*<<< orphan*/ printf(char *, int, ...);
void my_test(int steps, int expected, int test_no) {
  if (get_steps(steps) == expected) {
    printf("Test%d passed\n", test_no);
  } else {
    printf("Test%d failed for steps = %d,\t expected = %d, your result = %d\n",
           test_no, steps, expected, get_steps(steps));
  }
}


x86 assembly (clang, -O0):
<my_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_steps@plt>
cmp    -0x8(%rbp),%eax
jne    1158 <my_test+0x38>
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    118c <my_test+0x6c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_steps@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    %eax,%r8d
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_test>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <get_steps@plt>
cmp    %ebp,%eax
jne    1149 <my_test+0x29>
lea    0xec5(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>
mov    %ebx,%edi
call   1030 <get_steps@plt>
lea    0xeb8(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Test%d passed\0A\00"
@.str.1 = [64 x i8] c"Test%d failed for steps = %d,\09 expected = %d, your result = %d\0A\00"
define void @my_test(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @get_steps(i32 %7)
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* %6
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %21
14: ; preds = %3
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = call i32 @get_steps(i32 %18)
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %19)
br label %21
21: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Test%d passed\0A\00"
@.str.1 = [64 x i8] c"Test%d failed for steps = %d,\09 expected = %d, your result = %d\0A\00"
define void @my_test(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @get_steps(i32 %0)
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %11
8: ; preds = %3
%9 = tail call i32 @get_steps(i32 %0)
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %0, i32 %1, i32 %9)
br label %11
11: ; preds = %8, %6
ret void
}