#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 *, char const *, int, char const *, char *,
                          char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void conv(const char *srt_name, const char *ssd_name, int num) {
  char numbuf[10];
  int i;
  for (i = 0; i < num; i++) {
    if (num <= 99)
      sprintf(numbuf, "%02d", i);
    else
      sprintf(numbuf, "%03d", i);
    printf("zwsrt.exe"
           " %s %d %s_%s.aif.ssd %s_%s.zwdsp\n",
           srt_name, i, ssd_name, numbuf, ssd_name, numbuf);
  }
}


x86 assembly (clang, -O0):
<conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b0 <conv+0x90>
cmpl   $0x63,-0x14(%rbp)
jg     1168 <conv+0x48>
lea    -0x1e(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xea2(%rip),%rsi
call   1040 <sprintf@plt>
jmp    117b <conv+0x5b>
lea    -0x1e(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xe8f(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    -0x1e(%rbp),%r8
mov    -0x10(%rbp),%r9
lea    -0x1e(%rbp),%rax
lea    0xe71(%rip),%rdi
mov    %rax,(%rsp)
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113a <conv+0x1a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edx,%edx
jle    1193 <conv+0x73>
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r14
cmp    $0x64,%edx
lea    0xebb(%rip),%rax
lea    0xeb9(%rip),%r12
cmovb  %rax,%r12
xor    %ebp,%ebp
lea    0xe(%rsp),%r13
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %r13,(%rsp)
lea    0xe92(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r13,%r8
mov    %rbx,%r9
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1160 <conv+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02d\00"
@.str.1 = [5 x i8] c"%03d\00"
@.str.2 = [43 x i8] c"zwsrt.exe %s %d %s_%s.aif.ssd %s_%s.zwdsp\0A\00"
define void @conv(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [10 x i8]
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %8
br label %9
9: ; preds = %32, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %35
13: ; preds = %9
%14 = load i32, i32* %6
%15 = icmp sle i32 %14, 99
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%18 = load i32, i32* %8
%19 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %24
20: ; preds = %13
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%22 = load i32, i32* %8
%23 = call i32 @sprintf(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20, %16
%25 = load i8*, i8** %4
%26 = load i32, i32* %8
%27 = load i8*, i8** %5
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%29 = load i8*, i8** %5
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %25, i32 %26, i8* %27, i8* %28, i8* %29, i8* %30)
br label %32
32: ; preds = %24
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %9
35: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02d\00"
@.str.1 = [5 x i8] c"%03d\00"
@.str.2 = [43 x i8] c"zwsrt.exe %s %d %s_%s.aif.ssd %s_%s.zwdsp\0A\00"
define void @conv(i8* %0, i8* %1, i32 %2) {
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = icmp sgt i32 %2, 0
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = icmp ult i32 %2, 100
%9 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
br label %10
10: ; preds = %7, %10
%11 = phi i32 [ 0, %7 ], [ %14, %10 ]
%12 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) %9, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 %11, i8* %1, i8* %5, i8* %1, i8* %5)
%14 = add nuw nsw i32 %11, 1
%15 = icmp eq i32 %14, %2
br i1 %15, label %16, label %10
16: ; preds = %10, %3
ret void
}