#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 */
unsigned int executeBatch(void *, char **, unsigned int);
int /*<<< orphan*/ freeCommands(char **, unsigned int);
unsigned int handleTimers(void *, char **, unsigned int *, void **);
unsigned int assertTimers(void *handle) {
  char *commands[10000];
  unsigned int commandCount = 0;
  void *rulesBinding = NULL;
  unsigned int result =
      handleTimers(handle, commands, &commandCount, &rulesBinding);
  if (result != 0) {
    freeCommands(commands, commandCount);
    return result;
  }
  return executeBatch(rulesBinding, commands, commandCount);
}


x86 assembly (clang, -O0):
<assertTimers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x138b0,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x13894(%rbp)
movq   $0x0,-0x138a0(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x13890(%rbp),%rsi
lea    -0x13894(%rbp),%rdx
lea    -0x138a0(%rbp),%rcx
call   1030 <handleTimers@plt>
mov    %eax,-0x138a4(%rbp)
cmpl   $0x0,-0x138a4(%rbp)
je     11a5 <assertTimers+0x75>
lea    -0x13890(%rbp),%rdi
mov    -0x13894(%rbp),%esi
call   1050 <freeCommands@plt>
mov    -0x138a4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11c1 <assertTimers+0x91>
mov    -0x138a0(%rbp),%rdi
lea    -0x13890(%rbp),%rsi
mov    -0x13894(%rbp),%edx
call   1040 <executeBatch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x138b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertTimers>:
push   %rbx
sub    $0x13890,%rsp
movl   $0x0,0x4(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <handleTimers@plt>
test   %eax,%eax
je     1173 <assertTimers+0x43>
mov    %eax,%ebx
mov    0x4(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1050 <freeCommands@plt>
jmp    1188 <assertTimers+0x58>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%edx
lea    0x10(%rsp),%rsi
call   1040 <executeBatch@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x13890,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @assertTimers(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [10000 x i8*]
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %5
store i8* null, i8** %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [10000 x i8*], [10000 x i8*]* %4, i64 0, i64 0
%10 = call i32 @handleTimers(i8* %8, i8** %9, i32* %5, i8** %6)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = getelementptr inbounds [10000 x i8*], [10000 x i8*]* %4, i64 0, i64 0
%15 = load i32, i32* %5
%16 = call i32 @freeCommands(i8** %14, i32 %15)
%17 = load i32, i32* %7
store i32 %17, i32* %2
br label %23
18: ; preds = %1
%19 = load i8*, i8** %6
%20 = getelementptr inbounds [10000 x i8*], [10000 x i8*]* %4, i64 0, i64 0
%21 = load i32, i32* %5
%22 = call i32 @executeBatch(i8* %19, i8** %20, i32 %21)
store i32 %22, i32* %2
br label %23
23: ; preds = %18, %13
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @assertTimers(i8* %0) {
%2 = alloca [10000 x i8*]
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast [10000 x i8*]* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%8 = getelementptr inbounds [10000 x i8*], [10000 x i8*]* %2, i64 0, i64 0
%9 = call i32 @handleTimers(i8* %0, i8** %8, i32* %3, i8** %4)
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @freeCommands(i8** %8, i32 %12)
br label %18
14: ; preds = %1
%15 = load i8*, i8** %4
%16 = load i32, i32* %3
%17 = call i32 @executeBatch(i8* %15, i8** %8, i32 %16)
br label %18
18: ; preds = %14, %11
%19 = phi i32 [ %9, %11 ], [ %17, %14 ]
ret i32 %19
}