#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*/ nop();
int two_loops_symb_diff(int m, int k) {
  int p = 10;
  for (int i = 0; i < m; i++) {
    nop();
  }
  for (int j = 0; j < k; j++) {
    nop();
  }
  return p;
}


x86 assembly (clang, -O0):
<two_loops_symb_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114d <two_loops_symb_diff+0x3d>
mov    $0x0,%al
call   1030 <nop@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <two_loops_symb_diff+0x1c>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1175 <two_loops_symb_diff+0x65>
mov    $0x0,%al
call   1030 <nop@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <two_loops_symb_diff+0x44>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_loops_symb_diff>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
test   %edi,%edi
jle    112c <two_loops_symb_diff+0x1c>
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <nop@plt>
add    $0xffffffff,%ebp
jne    1120 <two_loops_symb_diff+0x10>
test   %ebx,%ebx
jle    113c <two_loops_symb_diff+0x2c>
xor    %eax,%eax
call   1030 <nop@plt>
add    $0xffffffff,%ebx
jne    1130 <two_loops_symb_diff+0x20>
mov    $0xa,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @two_loops_symb_diff(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 10, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %14, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = call i32 (...) @nop()
br label %14
14: ; preds = %12
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
br label %8
17: ; preds = %8
store i32 0, i32* %7
br label %18
18: ; preds = %24, %17
%19 = load i32, i32* %7
%20 = load i32, i32* %4
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = call i32 (...) @nop()
br label %24
24: ; preds = %22
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %18
27: ; preds = %18
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @two_loops_symb_diff(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %12, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 (...) @nop()
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %4, label %6
11: ; preds = %12, %4
ret i32 10
12: ; preds = %4, %12
%13 = phi i32 [ %15, %12 ], [ 0, %4 ]
%14 = tail call i32 (...) @nop()
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, %1
br i1 %16, label %11, label %12
}