#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*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void primes_1(void) {
  int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};
  int x;
  int *p;
  printf("The first 10 primes numbers are %c\n", 31);
  p = primes;
  for (x = 0; x < 10; x++) {
    printf("\t\t\t\t%d\n", *p++);
  }
  p = primes;
  printf("The fifth prime number is %d", *(p + 4));
  printf("\n\t and the seventh prime number is %d", *(p + 6));
  puts("\n\n");
  getchar();
}


x86 assembly (clang, -O0):
<primes_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    0xec4(%rip),%rdi
mov    $0x1f,%esi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11b2 <primes_1+0x72>
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x40(%rbp)
mov    (%rax),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    117d <primes_1+0x3d>
lea    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    0x10(%rax),%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
mov    0x18(%rax),%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primes_1>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x1f,%esi
call   1040 <printf@plt>
lea    0xedb(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x17,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1d,%esi
call   1040 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
mov    $0x11,%esi
call   1040 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <getchar@plt>

LLVM IR (-O0):
@__const.primes_1.primes = [10 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29]
@.str = [36 x i8] c"The first 10 primes numbers are %c\0A\00"
@.str.1 = [8 x i8] c"\09\09\09\09%d\0A\00"
@.str.2 = [29 x i8] c"The fifth prime number is %d\00"
@.str.3 = [38 x i8] c"\0A\09 and the seventh prime number is %d\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define void @primes_1() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32*
%4 = bitcast [10 x i32]* %1 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 31)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32* %6, i32** %3
store i32 0, i32* %2
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
%13 = load i32, i32* %11
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %7
18: ; preds = %7
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32* %19, i32** %3
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 4
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 6
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"The first 10 primes numbers are %c\0A\00"
@.str.1 = [8 x i8] c"\09\09\09\09%d\0A\00"
@.str.2 = [29 x i8] c"The fifth prime number is %d\00"
@.str.3 = [38 x i8] c"\0A\09 and the seventh prime number is %d\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define void @primes_1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 31)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 11)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 13)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 17)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 19)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 23)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 29)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 11)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 17)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%15 = tail call i32 (...) @getchar()
ret void
}