#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 timer_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __CPROVER_assert(int, char *);
int mod_timer(struct timer_list *timer, unsigned long expires) {
  unsigned long __cil_tmp3;
  unsigned long __cil_tmp4;
  short __cil_tmp5;
  int __cil_tmp6;
  unsigned long __cil_tmp7;
  unsigned long __cil_tmp8;
  {
    {
      __cil_tmp3 = (unsigned long)timer;
      __cil_tmp4 = __cil_tmp3 + 26;
      __cil_tmp5 = *((short *)__cil_tmp4);
      __cil_tmp6 = (int)__cil_tmp5;
      __CPROVER_assert(__cil_tmp6, "Timer is initialized");
      *((unsigned long *)timer) = expires;
      __cil_tmp7 = (unsigned long)timer;
      __cil_tmp8 = __cil_tmp7 + 24;
      *((short *)__cil_tmp8) = (short)1;
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<mod_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1a,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x22(%rbp)
movswl -0x22(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
lea    0xeb0(%rip),%rsi
call   1030 <__CPROVER_assert@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movw   $0x1,(%rax)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_timer>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movswl 0x1a(%rdi),%edi
lea    0xedb(%rip),%rsi
call   1030 <__CPROVER_assert@plt>
mov    %r14,(%rbx)
movw   $0x1,0x18(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timer_list = type { i32 }
@.str = [21 x i8] c"Timer is initialized\00"
define i32 @mod_timer(%struct.timer_list* %0, i64 %1) {
%3 = alloca %struct.timer_list*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i16
%8 = alloca i32
%9 = alloca i64
%10 = alloca i64
store %struct.timer_list* %0, %struct.timer_list** %3
store i64 %1, i64* %4
%11 = load %struct.timer_list*, %struct.timer_list** %3
%12 = ptrtoint %struct.timer_list* %11 to i64
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = add i64 %13, 26
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = inttoptr i64 %15 to i16*
%17 = load i16, i16* %16
store i16 %17, i16* %7
%18 = load i16, i16* %7
%19 = sext i16 %18 to i32
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = call i32 @__CPROVER_assert(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%22 = load i64, i64* %4
%23 = load %struct.timer_list*, %struct.timer_list** %3
%24 = bitcast %struct.timer_list* %23 to i64*
store i64 %22, i64* %24
%25 = load %struct.timer_list*, %struct.timer_list** %3
%26 = ptrtoint %struct.timer_list* %25 to i64
store i64 %26, i64* %9
%27 = load i64, i64* %9
%28 = add i64 %27, 24
store i64 %28, i64* %10
%29 = load i64, i64* %10
%30 = inttoptr i64 %29 to i16*
store i16 1, i16* %30
ret i32 0
}

LLVM IR (-O2):
%struct.timer_list = type { i32 }
@.str = [21 x i8] c"Timer is initialized\00"
define i32 @mod_timer(%struct.timer_list* %0, i64 %1) {
%3 = ptrtoint %struct.timer_list* %0 to i64
%4 = add i64 %3, 26
%5 = inttoptr i64 %4 to i16*
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = tail call i32 @__CPROVER_assert(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = bitcast %struct.timer_list* %0 to i64*
store i64 %1, i64* %9
%10 = add i64 %3, 24
%11 = inttoptr i64 %10 to i16*
store i16 1, i16* %11
ret i32 0
}