#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 */
struct reconos_thread {
  int dummy;
};
struct reconos_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ reconos_thread_init(struct reconos_thread *, char *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ reconos_thread_setresources(struct reconos_thread *,
                                               struct reconos_resource *, int);
void __attribute__((deprecated))
reconos_hwt_setresources(struct reconos_thread *hwt,
                         struct reconos_resource *resource,
                         int resource_count) {
  reconos_thread_init(hwt, "HWT", 0);
  reconos_thread_setresources(hwt, resource, resource_count);
}


x86 assembly (clang, -O0):
<reconos_hwt_setresources>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
xor    %edx,%edx
call   1040 <reconos_thread_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <reconos_thread_setresources@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reconos_hwt_setresources>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xecc(%rip),%rsi
xor    %edx,%edx
call   1040 <reconos_thread_init@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <reconos_thread_setresources@plt>

LLVM IR (-O0):
%struct.reconos_thread = type { i32 }
%struct.reconos_resource = type { i32 }
@.str = [4 x i8] c"HWT\00"
define void @reconos_hwt_setresources(%struct.reconos_thread* %0, %struct.reconos_resource* %1, i32 %2) {
%4 = alloca %struct.reconos_thread*
%5 = alloca %struct.reconos_resource*
%6 = alloca i32
store %struct.reconos_thread* %0, %struct.reconos_thread** %4
store %struct.reconos_resource* %1, %struct.reconos_resource** %5
store i32 %2, i32* %6
%7 = load %struct.reconos_thread*, %struct.reconos_thread** %4
%8 = call i32 @reconos_thread_init(%struct.reconos_thread* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%9 = load %struct.reconos_thread*, %struct.reconos_thread** %4
%10 = load %struct.reconos_resource*, %struct.reconos_resource** %5
%11 = load i32, i32* %6
%12 = call i32 @reconos_thread_setresources(%struct.reconos_thread* %9, %struct.reconos_resource* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.reconos_thread = type { i32 }
%struct.reconos_resource = type { i32 }
@.str = [4 x i8] c"HWT\00"
define void @reconos_hwt_setresources(%struct.reconos_thread* %0, %struct.reconos_resource* %1, i32 %2) {
%4 = tail call i32 @reconos_thread_init(%struct.reconos_thread* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = tail call i32 @reconos_thread_setresources(%struct.reconos_thread* %0, %struct.reconos_resource* %1, i32 %2)
ret void
}