#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 */
int /*<<< orphan*/ mill_msleep(scalar_t__, char *);
scalar_t__ now();
int /*<<< orphan*/ printf(char *, char const *);
__attribute__((no)) void worker(int count, const char *text) {
  int i;
  for (i = 0; i != count; ++i) {
    printf("%s\n", text);
    mill_msleep((now() + 10), "/scratch/repos/new/home/jordi_armengol_estape/"
                              "c-scraper/outputs/2022-01-22/02-19-57/repos/"
                              "ebfe/libmill/refs/heads/master/tests/example.c"
                              ":"
                              "33");
  }
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     118a <worker+0x5a>
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <now@plt>
mov    %rax,%rdi
add    $0xa,%rdi
lea    0xe8d(%rip),%rsi
call   1040 <mill_msleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <worker+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1173 <worker+0x43>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb9(%rip),%r14
lea    0xeb6(%rip),%r15
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <now@plt>
lea    0xa(%rax),%rdi
mov    %r15,%rsi
call   1040 <mill_msleep@plt>
add    $0xffffffff,%ebp
jne    1150 <worker+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ebfe/libmill/refs/heads/master/tests/example.c:33\00"
define void @worker(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i64 (...) @now()
%14 = add nsw i64 %13, 10
%15 = call i32 @mill_msleep(i64 %14, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ebfe/libmill/refs/heads/master/tests/example.c:33\00"
define void @worker(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i64 (...) @now()
%8 = add nsw i64 %7, 10
%9 = tail call i32 @mill_msleep(i64 %8, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}