#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 */
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf(char *, char, ...);
int /*<<< orphan*/ puts(char *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
unsigned int strtoul(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srand(time(NULL));
  unsigned int u = 0;
  puts("Arguments:");
  for (int i = 0; i < argc; ++i) {
    printf("Argument %d: %s\n", i, argv[i]);
    if ((u = strtoul(argv[i], NULL, 10)) > 0) {
      printf("   This appears to be the number %d\n", u);
    }
    int loc = 0;
    while (argv[i][loc] != 0) {
      if (isdigit(argv[i][loc]))
        printf("I found the digit %c at location %d\n", argv[i][loc], loc);
      loc++;
    }
  }
  char s1[] = {'a', 'b', 'c', 0};
  char s2[] = "abc";
  char notans[] = {'a', 'b', 'c'};
  puts(s1);
  puts(s2);
  puts(notans);
  int vals[10];
  for (int i = 0; i < 10; ++i) {
    vals[i] = rand() % 100;
  }
  printf("%d\n", 'c' - 'a');
  printf("%d\n", 'a' + 9);
  printf("%c\n", 'a' + 9);
  printf("%c\n", 'a' + ('y' - 'a' + 9) % 26);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movl   $0x0,-0x14(%rbp)
lea    0xe5c(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12a5 <main+0x135>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdx
lea    0xe39(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtoul@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jbe    1216 <main+0xa6>
mov    -0x14(%rbp),%eax
lea    0xe10(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1292 <main+0x122>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1284 <main+0x114>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x1c(%rbp),%edx
lea    0xdc7(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    121d <main+0xad>
jmp    1297 <main+0x127>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b0 <main+0x40>
mov    0xdbb(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xdb2(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    0xdb0(%rip),%ax
mov    %ax,-0x27(%rbp)
mov    0xda8(%rip),%al
mov    %al,-0x25(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x24(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x27(%rbp),%rdi
call   1040 <puts@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0xa,-0x54(%rbp)
jge    131c <main+0x1ac>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
movslq -0x54(%rbp),%rax
mov    %edx,-0x50(%rbp,%rax,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12ed <main+0x17d>
lea    0xd3f(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd2c(%rip),%rdi
mov    $0x6a,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd21(%rip),%rdi
mov    $0x6a,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd0e(%rip),%rdi
mov    $0x68,%esi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r13
mov    %edi,%ebx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
test   %ebx,%ebx
jle    1256 <main+0xe6>
mov    %ebx,%ebp
lea    0xe5d(%rip),%r14
lea    0xe8c(%rip),%r15
xor    %r12d,%r12d
jmp    11cd <main+0x5d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %rbp,%r12
je     1256 <main+0xe6>
mov    0x0(%r13,%r12,8),%rdx
movsbl %r12b,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13,%r12,8),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtoul@plt>
test   %eax,%eax
je     1206 <main+0x96>
movsbl %al,%esi
lea    0xe1d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13,%r12,8),%rax
mov    (%rax),%al
test   %al,%al
je     11c0 <main+0x50>
xor    %ebx,%ebx
jmp    1232 <main+0xc2>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%r13,%r12,8),%rax
movzbl 0x1(%rax,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
je     11c0 <main+0x50>
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1220 <main+0xb0>
mov    0x0(%r13,%r12,8),%rax
movsbl (%rax,%rbx,1),%esi
mov    %r15,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1220 <main+0xb0>
movl   $0x636261,0x14(%rsp)
movl   $0x636261,0x10(%rsp)
movb   $0x63,0xe(%rsp)
movw   $0x6261,0xc(%rsp)
lea    0x14(%rsp),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
lea    0xd85(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6a,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd64(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6a,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x68,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Arguments:\00"
@.str.1 = [17 x i8] c"Argument %d: %s\0A\00"
@.str.2 = [37 x i8] c" This appears to be the number %d\0A\00"
@.str.3 = [37 x i8] c"I found the digit %c at location %d\0A\00"
@__const.main.s1 = [4 x i8] c"abc\00"
@__const.main.s2 = [4 x i8] c"abc\00"
@__const.main.notans = [3 x i8] c"abc"
@.str.4 = [4 x i8] c"%d\0A\00"
@.str.5 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i8]
%10 = alloca [4 x i8]
%11 = alloca [3 x i8]
%12 = alloca [10 x i32]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 @time(i32* null)
%15 = call i32 @srand(i32 %14)
store i32 0, i32* %6
%16 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %17
17: ; preds = %82, %2
%18 = load i32, i32* %7
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %85
21: ; preds = %17
%22 = load i32, i32* %7
%23 = trunc i32 %22 to i8
%24 = load i8**, i8*** %5
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8 signext %23, i8* %28)
%30 = load i8**, i8*** %5
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @strtoul(i8* %34, i32* null, i32 10)
store i32 %35, i32* %6
%36 = icmp ugt i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %21
%38 = load i32, i32* %6
%39 = trunc i32 %38 to i8
%40 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8 signext %39)
br label %41
41: ; preds = %37, %21
store i32 0, i32* %8
br label %42
42: ; preds = %78, %41
%43 = load i8**, i8*** %5
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %81
54: ; preds = %42
%55 = load i8**, i8*** %5
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %59, i64 %61
%63 = load i8, i8* %62
%64 = call i64 @isdigit(i8 signext %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %78
66: ; preds = %54
%67 = load i8**, i8*** %5
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = load i32, i32* %8
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
%75 = load i8, i8* %74
%76 = load i32, i32* %8
%77 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8 signext %75, i32 %76)
br label %78
78: ; preds = %66, %54
%79 = load i32, i32* %8
%80 = add nsw i32 %79, 1
store i32 %80, i32* %8
br label %42
81: ; preds = %42
br label %82
82: ; preds = %81
%83 = load i32, i32* %7
%84 = add nsw i32 %83, 1
store i32 %84, i32* %7
br label %17
85: ; preds = %17
%86 = bitcast [4 x i8]* %9 to i8*
%87 = bitcast [4 x i8]* %10 to i8*
%88 = bitcast [3 x i8]* %11 to i8*
%89 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%90 = call i32 @puts(i8* %89)
%91 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%92 = call i32 @puts(i8* %91)
%93 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%94 = call i32 @puts(i8* %93)
store i32 0, i32* %13
br label %95
95: ; preds = %104, %85
%96 = load i32, i32* %13
%97 = icmp slt i32 %96, 10
br i1 %97, label %98, label %107
98: ; preds = %95
%99 = call i32 (...) @rand()
%100 = srem i32 %99, 100
%101 = load i32, i32* %13
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [10 x i32], [10 x i32]* %12, i64 0, i64 %102
store i32 %100, i32* %103
br label %104
104: ; preds = %98
%105 = load i32, i32* %13
%106 = add nsw i32 %105, 1
store i32 %106, i32* %13
br label %95
107: ; preds = %95
%108 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext 2)
%109 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext 106)
%110 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext 106)
%111 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext 104)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Arguments:\00"
@.str.1 = [17 x i8] c"Argument %d: %s\0A\00"
@.str.2 = [37 x i8] c" This appears to be the number %d\0A\00"
@.str.3 = [37 x i8] c"I found the digit %c at location %d\0A\00"
@__const.main.notans = [3 x i8] c"abc"
@.str.4 = [4 x i8] c"%d\0A\00"
@.str.5 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i8]
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 @srand(i32 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = icmp sgt i32 %0, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = zext i32 %0 to i64
br label %33
12: ; preds = %66, %2
%13 = bitcast i32* %3 to i8*
store i32 6513249, i32* %3
%14 = bitcast i32* %4 to i8*
store i32 6513249, i32* %4
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%16 = call i32 @puts(i8* %13)
%17 = call i32 @puts(i8* %14)
%18 = call i32 @puts(i8* %15)
%19 = tail call i32 (...) @rand()
%20 = tail call i32 (...) @rand()
%21 = tail call i32 (...) @rand()
%22 = tail call i32 (...) @rand()
%23 = tail call i32 (...) @rand()
%24 = tail call i32 (...) @rand()
%25 = tail call i32 (...) @rand()
%26 = tail call i32 (...) @rand()
%27 = tail call i32 (...) @rand()
%28 = tail call i32 (...) @rand()
%29 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext 2)
%30 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext 106)
%31 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext 106)
%32 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8 signext 104)
ret i32 0
33: ; preds = %10, %66
%34 = phi i64 [ 0, %10 ], [ %67, %66 ]
%35 = trunc i64 %34 to i8
%36 = getelementptr inbounds i8*, i8** %1, i64 %34
%37 = load i8*, i8** %36
%38 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8 signext %35, i8* %37)
%39 = load i8*, i8** %36
%40 = tail call i32 @strtoul(i8* nocapture %39, i32* null, i32 10)
%41 = icmp eq i32 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %33
%43 = trunc i32 %40 to i8
%44 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i8 signext %43)
br label %45
45: ; preds = %42, %33
%46 = load i8*, i8** %36
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 0
br i1 %48, label %66, label %49
49: ; preds = %45, %60
%50 = phi i64 [ %61, %60 ], [ 0, %45 ]
%51 = phi i8 [ %64, %60 ], [ %47, %45 ]
%52 = tail call i64 @isdigit(i8 signext %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %60, label %54
54: ; preds = %49
%55 = load i8*, i8** %36
%56 = getelementptr inbounds i8, i8* %55, i64 %50
%57 = load i8, i8* %56
%58 = trunc i64 %50 to i32
%59 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8 signext %57, i32 %58)
br label %60
60: ; preds = %54, %49
%61 = add nuw i64 %50, 1
%62 = load i8*, i8** %36
%63 = getelementptr inbounds i8, i8* %62, i64 %61
%64 = load i8, i8* %63
%65 = icmp eq i8 %64, 0
br i1 %65, label %66, label %49
66: ; preds = %60, %45
%67 = add nuw nsw i64 %34, 1
%68 = icmp eq i64 %67, %11
br i1 %68, label %12, label %33
}