#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 sio_timer {
  int dummy;
};
struct sio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sio_start_timer(struct sio *, struct sio_timer *, int,
                                   void (*)(struct sio *, struct sio_timer *,
                                            void *),
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void timer_callback(struct sio *sio, struct sio_timer *timer, void *arg) {
  fprintf(stderr,
          "-------------------[timer]2 seconds passed------------------\n");
  sio_start_timer(sio, timer, 2000, timer_callback, NULL);
}


x86 assembly (clang, -O0):
<timer_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x7d0,%edx
mov    0x2e8b(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <sio_start_timer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_callback>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7d0,%edx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sio_start_timer@plt>

LLVM IR (-O0):
%struct.sio = type { i32 }
%struct.sio_timer = type { i32 }
@stderr = global i32 0
@.str = [62 x i8] c"-------------------[timer]2 seconds passed------------------\0A\00"
define void @timer_callback(%struct.sio* %0, %struct.sio_timer* %1, i8* %2) {
%4 = alloca %struct.sio*
%5 = alloca %struct.sio_timer*
%6 = alloca i8*
store %struct.sio* %0, %struct.sio** %4
store %struct.sio_timer* %1, %struct.sio_timer** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%9 = load %struct.sio*, %struct.sio** %4
%10 = load %struct.sio_timer*, %struct.sio_timer** %5
%11 = call i32 @sio_start_timer(%struct.sio* %9, %struct.sio_timer* %10, i32 2000, void (%struct.sio*, %struct.sio_timer*, i8*)* @timer_callback, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sio = type { i32 }
%struct.sio_timer = type { i32 }
@stderr = global i32 0
@.str = [62 x i8] c"-------------------[timer]2 seconds passed------------------\0A\00"
define void @timer_callback(%struct.sio* %0, %struct.sio_timer* %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sio_start_timer(%struct.sio* %0, %struct.sio_timer* %1, i32 2000, void (%struct.sio*, %struct.sio_timer*, i8*)* @timer_callback, i32* null)
ret void
}