#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 *, ...);
int /*<<< orphan*/ sum(int *, int *, int *);
int main() {
  int i, p1[2], p2[2], n[2], flag = 0, term, c = 0, *ptr, *pt1, *pt2, *tmp;
  ptr = n;
  pt1 = p1;
  pt2 = p2;
  term = 2;
  for (i = 0; i < 2; i++) {
    pt2[i] = 0;
    pt1[i] = 0;
    ptr[i] = 0;
  }
  pt2[2 - 1] = pt1[2 - 1] = 1;
  while (!flag) {
    term++;
    sum(ptr, pt1, pt2);
    for (c = 0; !ptr[c]; c++)
      ;
    tmp = pt2;
    pt2 = pt1;
    pt1 = ptr;
    ptr = tmp;
    if (c == 0) {
      flag = 1;
      ptr = pt1;
    }
  }
  printf("\nThe no is : ");
  for (i = 0; i < 2; i++)
    printf("%d", ptr[i]);
  printf("\nThe term is : %d", term);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
movl   $0x2,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11a8 <main+0x88>
mov    -0x48(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x40(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <main+0x43>
mov    -0x40(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x48(%rbp),%rax
movl   $0x1,0x4(%rax)
cmpl   $0x0,-0x24(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11d4 <main+0xb4>
jmp    1264 <main+0x144>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
call   1040 <sum@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1213 <main+0xf3>
jmp    1226 <main+0x106>
jmp    1218 <main+0xf8>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11f5 <main+0xd5>
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    125f <main+0x13f>
movl   $0x1,-0x24(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    11be <main+0x9e>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    12aa <main+0x18a>
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1279 <main+0x159>
mov    -0x28(%rbp),%esi
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0x10(%rsp),%rbp
movabs $0x100000000,%rax
mov    %rax,0x8(%rsp)
mov    %rax,0x10(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%r15
mov    $0x2,%r14d
lea    0x8(%rsp),%rax
nopl   0x0(%rax)
mov    %r15,%rbx
mov    %rax,%r15
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %rax,%rdx
call   1040 <sum@plt>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cmpl   $0x0,(%rbx,%rcx,4)
lea    0x1(%rcx),%rcx
je     1180 <main+0x60>
add    $0x1,%r14d
mov    %rbp,%rax
mov    %rbx,%rbp
cmp    $0x1,%ecx
jne    1160 <main+0x40>
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xe6d(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe40(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"\0AThe no is : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"\0AThe term is : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %6
store i32 0, i32* %8
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32* %13, i32** %9
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %14, i32** %10
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32* %15, i32** %11
store i32 2, i32* %7
store i32 0, i32* %2
br label %16
16: ; preds = %32, %0
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = load i32*, i32** %11
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 0, i32* %23
%24 = load i32*, i32** %10
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
store i32 0, i32* %27
%28 = load i32*, i32** %9
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 0, i32* %31
br label %32
32: ; preds = %19
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %16
35: ; preds = %16
%36 = load i32*, i32** %10
%37 = getelementptr inbounds i32, i32* %36, i64 1
store i32 1, i32* %37
%38 = load i32*, i32** %11
%39 = getelementptr inbounds i32, i32* %38, i64 1
store i32 1, i32* %39
br label %40
40: ; preds = %72, %35
%41 = load i32, i32* %6
%42 = icmp ne i32 %41, 0
%43 = xor i1 %42, true
br i1 %43, label %44, label %73
44: ; preds = %40
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
%47 = load i32*, i32** %9
%48 = load i32*, i32** %10
%49 = load i32*, i32** %11
%50 = call i32 @sum(i32* %47, i32* %48, i32* %49)
store i32 0, i32* %8
br label %51
51: ; preds = %60, %44
%52 = load i32*, i32** %9
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = load i32, i32* %55
%57 = icmp ne i32 %56, 0
%58 = xor i1 %57, true
br i1 %58, label %59, label %63
59: ; preds = %51
br label %60
60: ; preds = %59
%61 = load i32, i32* %8
%62 = add nsw i32 %61, 1
store i32 %62, i32* %8
br label %51
63: ; preds = %51
%64 = load i32*, i32** %11
store i32* %64, i32** %12
%65 = load i32*, i32** %10
store i32* %65, i32** %11
%66 = load i32*, i32** %9
store i32* %66, i32** %10
%67 = load i32*, i32** %12
store i32* %67, i32** %9
%68 = load i32, i32* %8
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %63
store i32 1, i32* %6
%71 = load i32*, i32** %10
store i32* %71, i32** %9
br label %72
72: ; preds = %70, %63
br label %40
73: ; preds = %40
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %75
75: ; preds = %85, %73
%76 = load i32, i32* %2
%77 = icmp slt i32 %76, 2
br i1 %77, label %78, label %88
78: ; preds = %75
%79 = load i32*, i32** %9
%80 = load i32, i32* %2
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i32, i32* %79, i64 %81
%83 = load i32, i32* %82
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %83)
br label %85
85: ; preds = %78
%86 = load i32, i32* %2
%87 = add nsw i32 %86, 1
store i32 %87, i32* %2
br label %75
88: ; preds = %75
%89 = load i32, i32* %7
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %89)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AThe no is : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"\0AThe term is : %d\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = bitcast i64* %1 to i32*
store i64 4294967296, i64* %3
store i64 4294967296, i64* %1
store i64 0, i64* %5
%8 = bitcast i64* %5 to i32*
%9 = bitcast i64* %3 to i32*
br label %10
10: ; preds = %0, %22
%11 = phi i32* [ %9, %0 ], [ %12, %22 ]
%12 = phi i32* [ %7, %0 ], [ %13, %22 ]
%13 = phi i32* [ %8, %0 ], [ %11, %22 ]
%14 = phi i32 [ 2, %0 ], [ %23, %22 ]
%15 = call i32 @sum(i32* %13, i32* %12, i32* %11)
br label %16
16: ; preds = %16, %10
%17 = phi i64 [ %21, %16 ], [ 0, %10 ]
%18 = getelementptr inbounds i32, i32* %13, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
%21 = add nuw i64 %17, 1
br i1 %20, label %16, label %22
22: ; preds = %16
%23 = add nuw nsw i32 %14, 1
%24 = trunc i64 %17 to i32
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %10
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* %13
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds i32, i32* %13, i64 1
%31 = load i32, i32* %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %23)
ret i32 0
}