#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 udev_queue {
  int dummy;
};
struct udev_list_entry {
  int dummy;
};
struct udev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned long long strtoull(char *, int /*<<< orphan*/ *, int);
char *udev_list_entry_get_name(struct udev_list_entry *);
struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *);
char *udev_list_entry_get_value(struct udev_list_entry *);
struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *);
unsigned long long udev_queue_get_kernel_seqnum(struct udev_queue *);
scalar_t__ udev_queue_get_queue_is_empty(struct udev_queue *);
struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *);
scalar_t__ udev_queue_get_seqnum_is_finished(struct udev_queue *,
                                             unsigned long long);
unsigned long long udev_queue_get_udev_seqnum(struct udev_queue *);
struct udev_queue *udev_queue_new(struct udev *);
int /*<<< orphan*/ udev_queue_unref(struct udev_queue *);
int test_queue(struct udev *udev) {
  struct udev_queue *udev_queue;
  unsigned long long int seqnum;
  struct udev_list_entry *list_entry;
  udev_queue = udev_queue_new(udev);
  if (udev_queue == NULL)
    return -1;
  seqnum = udev_queue_get_kernel_seqnum(udev_queue);
  printf("seqnum kernel: %llu\n", seqnum);
  seqnum = udev_queue_get_udev_seqnum(udev_queue);
  printf("seqnum udev  : %llu\n", seqnum);
  if (udev_queue_get_queue_is_empty(udev_queue))
    printf("queue is empty\n");
  printf("get queue list\n");
  for (list_entry = udev_queue_get_queued_list_entry(udev_queue);
       list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry))
    printf("queued: '%s' [%s]\n", udev_list_entry_get_name(list_entry),
           udev_list_entry_get_value(list_entry));
  printf("\n");
  printf("get queue list again\n");
  for (list_entry = udev_queue_get_queued_list_entry(udev_queue);
       list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry))
    printf("queued: '%s' [%s]\n", udev_list_entry_get_name(list_entry),
           udev_list_entry_get_value(list_entry));
  printf("\n");
  printf("get failed list\n");
  for (list_entry = udev_queue_get_failed_list_entry(udev_queue);
       list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry))
    printf("failed: '%s'\n", udev_list_entry_get_name(list_entry));
  printf("\n");
  list_entry = udev_queue_get_queued_list_entry(udev_queue);
  if (list_entry != NULL) {
    printf("event [%llu] is queued\n", seqnum);
    seqnum = strtoull(udev_list_entry_get_value(list_entry), NULL, 10);
    if (udev_queue_get_seqnum_is_finished(udev_queue, seqnum))
      printf("event [%llu] is not finished\n", seqnum);
    else
      printf("event [%llu] is finished\n", seqnum);
  }
  printf("\n");
  udev_queue_unref(udev_queue);
  return 0;
}


x86 assembly (clang, -O0):
<test_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   10d0 <udev_queue_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1200 <test_queue+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    144c <test_queue+0x27c>
mov    -0x18(%rbp),%rdi
call   1080 <udev_queue_get_kernel_seqnum@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <udev_queue_get_udev_seqnum@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <udev_queue_get_queue_is_empty@plt>
cmp    $0x0,%rax
je     125f <test_queue+0x8f>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <udev_queue_get_queued_list_entry@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     12c2 <test_queue+0xf2>
mov    -0x28(%rbp),%rdi
call   10e0 <udev_list_entry_get_name@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <udev_list_entry_get_value@plt>
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <udev_list_entry_get_next@plt>
mov    %rax,-0x28(%rbp)
jmp    127a <test_queue+0xaa>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <udev_queue_get_queued_list_entry@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1333 <test_queue+0x163>
mov    -0x28(%rbp),%rdi
call   10e0 <udev_list_entry_get_name@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <udev_list_entry_get_value@plt>
mov    -0x38(%rbp),%rsi
mov    %rax,%rdx
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <udev_list_entry_get_next@plt>
mov    %rax,-0x28(%rbp)
jmp    12eb <test_queue+0x11b>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <udev_queue_get_failed_list_entry@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1393 <test_queue+0x1c3>
mov    -0x28(%rbp),%rdi
call   10e0 <udev_list_entry_get_name@plt>
mov    %rax,%rsi
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <udev_list_entry_get_next@plt>
mov    %rax,-0x28(%rbp)
jmp    135c <test_queue+0x18c>
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <udev_queue_get_queued_list_entry@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     142e <test_queue+0x25e>
mov    -0x20(%rbp),%rsi
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <udev_list_entry_get_value@plt>
mov    %rax,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <udev_queue_get_seqnum_is_finished@plt>
cmp    $0x0,%rax
je     1417 <test_queue+0x247>
mov    -0x20(%rbp),%rsi
lea    0xc9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1429 <test_queue+0x259>
mov    -0x20(%rbp),%rsi
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    142e <test_queue+0x25e>
lea    0xc5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <udev_queue_unref@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_queue>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
call   10f0 <udev_queue_new@plt>
test   %rax,%rax
je     13ea <test_queue+0x1fa>
mov    %rax,%r15
mov    %rax,%rdi
call   10a0 <udev_queue_get_kernel_seqnum@plt>
lea    0xde7(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   10e0 <udev_queue_get_udev_seqnum@plt>
mov    %rax,%r14
lea    0xde0(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1110 <udev_queue_get_queue_is_empty@plt>
test   %rax,%rax
je     1258 <test_queue+0x68>
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe3c(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1050 <udev_queue_get_queued_list_entry@plt>
test   %rax,%rax
je     12b3 <test_queue+0xc3>
mov    %rax,%rbx
lea    0xdaf(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1100 <udev_list_entry_get_name@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1070 <udev_list_entry_get_value@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10c0 <udev_list_entry_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1280 <test_queue+0x90>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xde6(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1050 <udev_queue_get_queued_list_entry@plt>
test   %rax,%rax
je     1313 <test_queue+0x123>
mov    %rax,%rbx
lea    0xd4a(%rip),%r12
mov    %rbx,%rdi
call   1100 <udev_list_entry_get_name@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1070 <udev_list_entry_get_value@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10c0 <udev_list_entry_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    12e0 <test_queue+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd9b(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   10d0 <udev_queue_get_failed_list_entry@plt>
test   %rax,%rax
je     1365 <test_queue+0x175>
mov    %rax,%rbx
lea    0xcfd(%rip),%r12
mov    %rbx,%rdi
call   1100 <udev_list_entry_get_name@plt>
mov    %r12,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10c0 <udev_list_entry_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1340 <test_queue+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1050 <udev_queue_get_queued_list_entry@plt>
test   %rax,%rax
je     13d4 <test_queue+0x1e4>
mov    %rax,%rbx
lea    0xcc5(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1070 <udev_list_entry_get_value@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1090 <strtoull@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   10b0 <udev_queue_get_seqnum_is_finished@plt>
test   %rax,%rax
lea    0xcc2(%rip),%rax
lea    0xc9d(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1080 <udev_queue_unref@plt>
xor    %eax,%eax
jmp    13ef <test_queue+0x1ff>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.udev = type { i32 }
%struct.udev_queue = type { i32 }
%struct.udev_list_entry = type { i32 }
@.str = [21 x i8] c"seqnum kernel: %llu\0A\00"
@.str.1 = [21 x i8] c"seqnum udev : %llu\0A\00"
@.str.2 = [16 x i8] c"queue is empty\0A\00"
@.str.3 = [16 x i8] c"get queue list\0A\00"
@.str.4 = [19 x i8] c"queued: '%s' [%s]\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [22 x i8] c"get queue list again\0A\00"
@.str.7 = [17 x i8] c"get failed list\0A\00"
@.str.8 = [14 x i8] c"failed: '%s'\0A\00"
@.str.9 = [24 x i8] c"event [%llu] is queued\0A\00"
@.str.10 = [30 x i8] c"event [%llu] is not finished\0A\00"
@.str.11 = [26 x i8] c"event [%llu] is finished\0A\00"
define i32 @test_queue(%struct.udev* %0) {
%2 = alloca i32
%3 = alloca %struct.udev*
%4 = alloca %struct.udev_queue*
%5 = alloca i64
%6 = alloca %struct.udev_list_entry*
store %struct.udev* %0, %struct.udev** %3
%7 = load %struct.udev*, %struct.udev** %3
%8 = call %struct.udev_queue* @udev_queue_new(%struct.udev* %7)
store %struct.udev_queue* %8, %struct.udev_queue** %4
%9 = load %struct.udev_queue*, %struct.udev_queue** %4
%10 = icmp eq %struct.udev_queue* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %101
12: ; preds = %1
%13 = load %struct.udev_queue*, %struct.udev_queue** %4
%14 = call i64 @udev_queue_get_kernel_seqnum(%struct.udev_queue* %13)
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = load %struct.udev_queue*, %struct.udev_queue** %4
%18 = call i64 @udev_queue_get_udev_seqnum(%struct.udev_queue* %17)
store i64 %18, i64* %5
%19 = load i64, i64* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i64 %19)
%21 = load %struct.udev_queue*, %struct.udev_queue** %4
%22 = call i64 @udev_queue_get_queue_is_empty(%struct.udev_queue* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %12
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %12
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%28 = load %struct.udev_queue*, %struct.udev_queue** %4
%29 = call %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* %28)
store %struct.udev_list_entry* %29, %struct.udev_list_entry** %6
br label %30
30: ; preds = %39, %26
%31 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%32 = icmp ne %struct.udev_list_entry* %31, null
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%35 = call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %34)
%36 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%37 = call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %35, i8* %37)
br label %39
39: ; preds = %33
%40 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%41 = call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %40)
store %struct.udev_list_entry* %41, %struct.udev_list_entry** %6
br label %30
42: ; preds = %30
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%45 = load %struct.udev_queue*, %struct.udev_queue** %4
%46 = call %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* %45)
store %struct.udev_list_entry* %46, %struct.udev_list_entry** %6
br label %47
47: ; preds = %56, %42
%48 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%49 = icmp ne %struct.udev_list_entry* %48, null
br i1 %49, label %50, label %59
50: ; preds = %47
%51 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%52 = call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %51)
%53 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%54 = call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %53)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %52, i8* %54)
br label %56
56: ; preds = %50
%57 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%58 = call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %57)
store %struct.udev_list_entry* %58, %struct.udev_list_entry** %6
br label %47
59: ; preds = %47
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%62 = load %struct.udev_queue*, %struct.udev_queue** %4
%63 = call %struct.udev_list_entry* @udev_queue_get_failed_list_entry(%struct.udev_queue* %62)
store %struct.udev_list_entry* %63, %struct.udev_list_entry** %6
br label %64
64: ; preds = %71, %59
%65 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%66 = icmp ne %struct.udev_list_entry* %65, null
br i1 %66, label %67, label %74
67: ; preds = %64
%68 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%69 = call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %67
%72 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%73 = call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %72)
store %struct.udev_list_entry* %73, %struct.udev_list_entry** %6
br label %64
74: ; preds = %64
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%76 = load %struct.udev_queue*, %struct.udev_queue** %4
%77 = call %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* %76)
store %struct.udev_list_entry* %77, %struct.udev_list_entry** %6
%78 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%79 = icmp ne %struct.udev_list_entry* %78, null
br i1 %79, label %80, label %97
80: ; preds = %74
%81 = load i64, i64* %5
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i64 %81)
%83 = load %struct.udev_list_entry*, %struct.udev_list_entry** %6
%84 = call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %83)
%85 = call i64 @strtoull(i8* %84, i32* null, i32 10)
store i64 %85, i64* %5
%86 = load %struct.udev_queue*, %struct.udev_queue** %4
%87 = load i64, i64* %5
%88 = call i64 @udev_queue_get_seqnum_is_finished(%struct.udev_queue* %86, i64 %87)
%89 = icmp ne i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %80
%91 = load i64, i64* %5
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i64 %91)
br label %96
93: ; preds = %80
%94 = load i64, i64* %5
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i64 %94)
br label %96
96: ; preds = %93, %90
br label %97
97: ; preds = %96, %74
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%99 = load %struct.udev_queue*, %struct.udev_queue** %4
%100 = call i32 @udev_queue_unref(%struct.udev_queue* %99)
store i32 0, i32* %2
br label %101
101: ; preds = %97, %11
%102 = load i32, i32* %2
ret i32 %102
}

LLVM IR (-O2):
%struct.udev = type { i32 }
%struct.udev_queue = type { i32 }
%struct.udev_list_entry = type { i32 }
@.str = [21 x i8] c"seqnum kernel: %llu\0A\00"
@.str.1 = [21 x i8] c"seqnum udev : %llu\0A\00"
@.str.4 = [19 x i8] c"queued: '%s' [%s]\0A\00"
@.str.8 = [14 x i8] c"failed: '%s'\0A\00"
@.str.9 = [24 x i8] c"event [%llu] is queued\0A\00"
@.str.10 = [30 x i8] c"event [%llu] is not finished\0A\00"
@.str.11 = [26 x i8] c"event [%llu] is finished\0A\00"
@str = [15 x i8] c"get queue list\00"
@str.12 = [21 x i8] c"get queue list again\00"
@str.13 = [16 x i8] c"get failed list\00"
@str.14 = [15 x i8] c"queue is empty\00"
define i32 @test_queue(%struct.udev* %0) {
%2 = tail call %struct.udev_queue* @udev_queue_new(%struct.udev* %0)
%3 = icmp eq %struct.udev_queue* %2, null
br i1 %3, label %62, label %4
4: ; preds = %1
%5 = tail call i64 @udev_queue_get_kernel_seqnum(%struct.udev_queue* %2)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = tail call i64 @udev_queue_get_udev_seqnum(%struct.udev_queue* %2)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i64 %7)
%9 = tail call i64 @udev_queue_get_queue_is_empty(%struct.udev_queue* %2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %4
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.14, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%15 = tail call %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* %2)
%16 = icmp eq %struct.udev_list_entry* %15, null
br i1 %16, label %24, label %17
17: ; preds = %13, %17
%18 = phi %struct.udev_list_entry* [ %22, %17 ], [ %15, %13 ]
%19 = tail call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %18)
%20 = tail call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %18)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %19, i8* %20)
%22 = tail call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %18)
%23 = icmp eq %struct.udev_list_entry* %22, null
br i1 %23, label %24, label %17
24: ; preds = %17, %13
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0))
%27 = tail call %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* %2)
%28 = icmp eq %struct.udev_list_entry* %27, null
br i1 %28, label %36, label %29
29: ; preds = %24, %29
%30 = phi %struct.udev_list_entry* [ %34, %29 ], [ %27, %24 ]
%31 = tail call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %30)
%32 = tail call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %30)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %31, i8* %32)
%34 = tail call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %30)
%35 = icmp eq %struct.udev_list_entry* %34, null
br i1 %35, label %36, label %29
36: ; preds = %29, %24
%37 = tail call i32 @putchar(i32 10)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.13, i64 0, i64 0))
%39 = tail call %struct.udev_list_entry* @udev_queue_get_failed_list_entry(%struct.udev_queue* %2)
%40 = icmp eq %struct.udev_list_entry* %39, null
br i1 %40, label %47, label %41
41: ; preds = %36, %41
%42 = phi %struct.udev_list_entry* [ %45, %41 ], [ %39, %36 ]
%43 = tail call i8* @udev_list_entry_get_name(%struct.udev_list_entry* %42)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %43)
%45 = tail call %struct.udev_list_entry* @udev_list_entry_get_next(%struct.udev_list_entry* %42)
%46 = icmp eq %struct.udev_list_entry* %45, null
br i1 %46, label %47, label %41
47: ; preds = %41, %36
%48 = tail call i32 @putchar(i32 10)
%49 = tail call %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* %2)
%50 = icmp eq %struct.udev_list_entry* %49, null
br i1 %50, label %59, label %51
51: ; preds = %47
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i64 %7)
%53 = tail call i8* @udev_list_entry_get_value(%struct.udev_list_entry* %49)
%54 = tail call i64 @strtoull(i8* nocapture %53, i32* null, i32 10)
%55 = tail call i64 @udev_queue_get_seqnum_is_finished(%struct.udev_queue* %2, i64 %54)
%56 = icmp eq i64 %55, 0
%57 = select i1 %56, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0)
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %57, i64 %54)
br label %59
59: ; preds = %51, %47
%60 = tail call i32 @putchar(i32 10)
%61 = tail call i32 @udev_queue_unref(%struct.udev_queue* %2)
br label %62
62: ; preds = %1, %59
%63 = phi i32 [ 0, %59 ], [ -1, %1 ]
ret i32 %63
}