#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*/ assert(int);
int /*<<< orphan*/ expect_call(char *, int);
int /*<<< orphan*/ expect_param(char *, char *, int, int);
int fun(char *);
int /*<<< orphan*/ g_mocks_reset();
int /*<<< orphan*/ verify_expectations();
int /*<<< orphan*/ will_return_always(char *, int);
void test_fun() {
  g_mocks_reset();
  expect_call("dep", 2);
  expect_param("dep", "in", 5, 2);
  will_return_always("dep", 1);
  assert(fun("hello") == 7);
  assert(fun("world") == 7);
  verify_expectations();
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <g_mocks_reset@plt>
lea    0xe7e(%rip),%rdi
mov    $0x2,%esi
call   1050 <expect_call@plt>
lea    0xe6d(%rip),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x5,%edx
mov    $0x2,%ecx
call   1090 <expect_param@plt>
lea    0xe50(%rip),%rdi
mov    $0x1,%esi
call   1080 <will_return_always@plt>
lea    0xe46(%rip),%rdi
call   1040 <fun@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe30(%rip),%rdi
call   1040 <fun@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x0,%al
call   1030 <verify_expectations@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
push   %rbx
xor    %eax,%eax
call   1070 <g_mocks_reset@plt>
lea    0xe81(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <expect_call@plt>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
mov    $0x2,%ecx
call   1090 <expect_param@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1080 <will_return_always@plt>
lea    0xe4e(%rip),%rdi
call   1040 <fun@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe3a(%rip),%rdi
call   1040 <fun@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1060 <assert@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <verify_expectations@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dep\00"
@.str.1 = [3 x i8] c"in\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [6 x i8] c"world\00"
define void @test_fun() {
%1 = call i32 (...) @g_mocks_reset()
%2 = call i32 @expect_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = call i32 @expect_param(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 2)
%4 = call i32 @will_return_always(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 @fun(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 7
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @fun(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32 %9, 7
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 (...) @verify_expectations()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dep\00"
@.str.1 = [3 x i8] c"in\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [6 x i8] c"world\00"
define void @test_fun() {
%1 = tail call i32 (...) @g_mocks_reset()
%2 = tail call i32 @expect_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @expect_param(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 2)
%4 = tail call i32 @will_return_always(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @fun(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i32 %5, 7
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @fun(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i32 %9, 7
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 (...) @verify_expectations()
ret void
}