#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*/ printf(char *, ...);
unsigned long strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  unsigned long start;
  unsigned long skip;
  unsigned long end;
  unsigned long i;
  if (argc != 4) {
    printf("Counts in hexadecimal.  Usage:\n\n\t%s start skip end\n", argv[0]);
    return -1;
  }
  start = strtoul(argv[1], NULL, 16);
  skip = strtoul(argv[2], NULL, 16);
  end = strtoul(argv[3], NULL, 16);
  for (i = start; i <= end; i += skip) {
    printf("%08lx\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1161 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ef <main+0xcf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
ja     11e8 <main+0xc8>
mov    -0x30(%rbp),%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    11b7 <main+0x97>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r12
cmp    $0x4,%edi
jne    119a <main+0x7a>
mov    0x8(%r12),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %rax,%rbx
mov    0x10(%r12),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %rax,%r15
mov    0x18(%r12),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
cmp    %rax,%rbx
ja     11b2 <main+0x92>
mov    %rax,%r12
lea    0xeb8(%rip),%r13
nopl   0x0(%rax)
xor    %r14d,%r14d
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    %r15,%rbx
cmp    %r12,%rbx
jbe    1180 <main+0x60>
jmp    11b2 <main+0x92>
mov    (%r12),%rsi
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [52 x i8] c"Counts in hexadecimal. Usage:\0A\0A\09%s start skip end\0A\00"
@.str.1 = [7 x i8] c"%08lx\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 4
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %15)
store i32 -1, i32* %3
br label %43
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strtoul(i8* %20, i32* null, i32 16)
store i64 %21, i64* %6
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i64 @strtoul(i8* %24, i32* null, i32 16)
store i64 %25, i64* %7
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 3
%28 = load i8*, i8** %27
%29 = call i64 @strtoul(i8* %28, i32* null, i32 16)
store i64 %29, i64* %8
%30 = load i64, i64* %6
store i64 %30, i64* %9
br label %31
31: ; preds = %38, %17
%32 = load i64, i64* %9
%33 = load i64, i64* %8
%34 = icmp ule i64 %32, %33
br i1 %34, label %35, label %42
35: ; preds = %31
%36 = load i64, i64* %9
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %36)
br label %38
38: ; preds = %35
%39 = load i64, i64* %7
%40 = load i64, i64* %9
%41 = add i64 %40, %39
store i64 %41, i64* %9
br label %31
42: ; preds = %31
store i32 0, i32* %3
br label %43
43: ; preds = %42, %12
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [52 x i8] c"Counts in hexadecimal. Usage:\0A\0A\09%s start skip end\0A\00"
@.str.1 = [7 x i8] c"%08lx\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %23
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strtoul(i8* nocapture %9, i32* null, i32 16)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i64 @strtoul(i8* nocapture %12, i32* null, i32 16)
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
%16 = tail call i64 @strtoul(i8* nocapture %15, i32* null, i32 16)
%17 = icmp ugt i64 %10, %16
br i1 %17, label %23, label %18
18: ; preds = %7, %18
%19 = phi i64 [ %21, %18 ], [ %10, %7 ]
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %19)
%21 = add i64 %19, %13
%22 = icmp ugt i64 %21, %16
br i1 %22, label %23, label %18
23: ; preds = %18, %7, %4
%24 = phi i32 [ -1, %4 ], [ 0, %7 ], [ 0, %18 ]
ret i32 %24
}