xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d\n", a * a);
  printf("%d\n", a * a * a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int main() {
  int a, b;
  a = b + b + b + b + b + b + b + b + b + b + b + b + b + b + b + b + b;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %3
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %3
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %3
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %3
%30 = add nsw i32 %28, %29
%31 = load i32, i32* %3
%32 = add nsw i32 %30, %31
%33 = load i32, i32* %3
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %3
%36 = add nsw i32 %34, %35
store i32 %36, i32* %2
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ strtoul(char const *, char **, int);
int stch_i(const char *string, int *pi) {
  char *pc;
  *pi = (int)strtoul(string, &pc, 16);
  return pc - string;
}


x86 assembly (clang, -O0):
<stch_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stch_i>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
mov    %eax,(%r14)
mov    (%rsp),%eax
sub    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @stch_i(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i64 @strtoul(i8* %6, i8** %5, i32 16)
%8 = trunc i64 %7 to i32
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @stch_i(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtoul(i8* %0, i8** %3, i32 16)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int get_10munit_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec & 0x00FFFFFF) * 100 + tv.tv_usec / 10000;
}


x86 assembly (clang, -O0):
<get_10munit_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
and    $0xffffff,%eax
imul   $0x64,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_10munit_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    $0xffffff,%eax
and    (%rsp),%eax
imul   $0x64,%eax,%ecx
movslq 0x4(%rsp),%rax
imul   $0x68db8bad,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_10munit_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = and i32 %4, 16777215
%6 = mul nsw i32 %5, 100
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 10000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_10munit_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = and i32 %5, 16777215
%7 = mul nuw nsw i32 %6, 100
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 10000
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_genome_mutate() {
  printf("test_genome_mutate...");
  printf("Ok\n");
}


x86 assembly (clang, -O0):
<test_genome_mutate>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_genome_mutate>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"test_genome_mutate...\00"
@.str.1 = [4 x i8] c"Ok\0A\00"
define void @test_genome_mutate() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"test_genome_mutate...\00"
@str = [3 x i8] c"Ok\00"
define void @test_genome_mutate() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *get_unmapped_page();
int stub1();
int main(void) {
  char *p = get_unmapped_page();
  return ((int (*)(void))p)();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_unmapped_page@plt>
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <get_unmapped_page@plt>
pop    %rcx
jmp    *%rax

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @get_unmapped_page()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32 ()*
%6 = call i32 %5()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @get_unmapped_page()
%2 = bitcast i8* %1 to i32 ()*
%3 = tail call i32 %2()
ret i32 %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int igvt_available_p(void) {
  struct stat st;
  if (stat("/sys/kernel/vgt", &st) != 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<igvt_available_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113e <igvt_available_p+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <igvt_available_p+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<igvt_available_p>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [16 x i8] c"/sys/kernel/vgt\00"
define i32 @igvt_available_p() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = call i64 @stat(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [16 x i8] c"/sys/kernel/vgt\00"
define i32 @igvt_available_p() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @stat(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int validate_path(char const *);
int is_valid_output(const char *s) {
  if (s)
    return validate_path(s);
  return 1;
}


x86 assembly (clang, -O0):
<is_valid_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <is_valid_output+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <validate_path@plt>
mov    %eax,-0x4(%rbp)
jmp    113f <is_valid_output+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_output>:
test   %rdi,%rdi
je     111a <is_valid_output+0xa>
jmp    1030 <validate_path@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_output(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @validate_path(i8* %7)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_valid_output(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @validate_path(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 1, %1 ]
ret i32 %6
}
void CK6_Map_SetupFunctions() {}


x86 assembly (clang, -O0):
<CK6_Map_SetupFunctions>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CK6_Map_SetupFunctions>:
ret

LLVM IR (-O0):
define void @CK6_Map_SetupFunctions() {
ret void
}

LLVM IR (-O2):
define void @CK6_Map_SetupFunctions() {
ret void
}
int bigp(int max, int x, int y, int z) { return x > max || y > max || z > max; }


x86 assembly (clang, -O0):
<bigp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     113e <bigp+0x3e>
mov    -0xc(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     113e <bigp+0x3e>
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigp>:
cmp    %edi,%esi
setg   %al
cmp    %edi,%edx
setg   %dl
or     %al,%dl
cmp    %edi,%ecx
setg   %al
or     %dl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @bigp(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp sgt i32 %9, %10
br i1 %11, label %20, label %12
12: ; preds = %4
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = icmp sgt i32 %13, %14
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i32, i32* %8
%18 = load i32, i32* %5
%19 = icmp sgt i32 %17, %18
br label %20
20: ; preds = %16, %12, %4
%21 = phi i1 [ true, %12 ], [ true, %4 ], [ %19, %16 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @bigp(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, %0
%6 = icmp sgt i32 %2, %0
%7 = or i1 %5, %6
%8 = icmp sgt i32 %3, %0
%9 = or i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
int motifWithN(int *data, int start, int width) {
  int i;
  for (i = start; i < start + width; i++)
    if (data[i] > 3)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<motifWithN>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    1156 <motifWithN+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x3,(%rax,%rcx,4)
jle    1143 <motifWithN+0x43>
movl   $0x1,-0x4(%rbp)
jmp    115d <motifWithN+0x5d>
jmp    1148 <motifWithN+0x48>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1114 <motifWithN+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<motifWithN>:
xor    %eax,%eax
test   %edx,%edx
jle    111f <motifWithN+0x1f>
add    %esi,%edx
movslq %esi,%rcx
movslq %edx,%rdx
xchg   %ax,%ax
cmpl   $0x4,(%rdi,%rcx,4)
jge    1120 <motifWithN+0x20>
add    $0x1,%rcx
cmp    %rdx,%rcx
jl     1110 <motifWithN+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @motifWithN(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = add nsw i32 %2, %1
%7 = sext i32 %1 to i64
%8 = sext i32 %6 to i64
br label %11
9: ; preds = %11
%10 = icmp slt i64 %16, %8
br i1 %10, label %11, label %17
11: ; preds = %5, %9
%12 = phi i64 [ %7, %5 ], [ %16, %9 ]
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %14, 3
%16 = add nsw i64 %12, 1
br i1 %15, label %17, label %9
17: ; preds = %11, %9, %3
%18 = phi i32 [ 0, %3 ], [ 0, %9 ], [ 1, %11 ]
ret i32 %18
}
unsigned int ceil_quot(unsigned int d1, unsigned int d2) {
  return (d1 + (d2 - 1)) / d2;
}


x86 assembly (clang, -O0):
<ceil_quot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_quot>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i32 @ceil_quot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 %6, 1
%8 = add i32 %5, %7
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ceil_quot(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = udiv i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
char *put_dec_full(char *, unsigned int);
char *put_dec_trunc(char *, unsigned long);
__attribute__((no)) char *put_dec(char *buf, unsigned long num) {
  while (1) {
    unsigned rem;
    if (num < 100000)
      return put_dec_trunc(buf, num);
    uint64_t sh = num >> 5;
    unsigned long quot = (sh * 175921861) >> 39;
    rem = num - quot * 100000;
    num = quot;
    buf = put_dec_full(buf, rem);
  }
}


x86 assembly (clang, -O0):
<put_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x186a0,-0x10(%rbp)
jae    1151 <put_dec+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <put_dec_trunc@plt>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
shr    $0x5,%rax
mov    %eax,-0x18(%rbp)
imul   $0xa7c5ac5,-0x18(%rbp),%eax
mov    $0x27,%ecx
sar    %cl,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x186a0,-0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <put_dec_full@plt>
mov    %rax,-0x8(%rbp)
jmp    1130 <put_dec+0x10>

x86 assembly (clang, -O2):
<put_dec>:
push   %rax
cmp    $0x186a0,%rsi
jae    1130 <put_dec+0x10>
pop    %rax
jmp    1040 <put_dec_trunc@plt>
call   1030 <put_dec_full@plt>
mov    %rax,%rdi
jmp    1130 <put_dec+0x10>

LLVM IR (-O0):
define i8* @put_dec(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %8
8: ; preds = %2, %15
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 100000
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i8* @put_dec_trunc(i8* %12, i64 %13)
ret i8* %14
15: ; preds = %8
%16 = load i64, i64* %4
%17 = lshr i64 %16, 5
%18 = trunc i64 %17 to i32
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = mul nsw i32 %19, 175921861
%21 = ashr i32 %20, 39
%22 = sext i32 %21 to i64
store i64 %22, i64* %7
%23 = load i64, i64* %4
%24 = load i64, i64* %7
%25 = mul i64 %24, 100000
%26 = sub i64 %23, %25
%27 = trunc i64 %26 to i32
store i32 %27, i32* %5
%28 = load i64, i64* %7
store i64 %28, i64* %4
%29 = load i8*, i8** %3
%30 = load i32, i32* %5
%31 = call i8* @put_dec_full(i8* %29, i32 %30)
store i8* %31, i8** %3
br label %8
}

LLVM IR (-O2):
define i8* @put_dec(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 100000
br i1 %3, label %7, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %6, %4 ], [ %0, %2 ]
%6 = tail call i8* @put_dec_full(i8* %5, i32 poison)
br label %4
7: ; preds = %2
%8 = tail call i8* @put_dec_trunc(i8* %0, i64 %1)
ret i8* %8
}
/* Variables and functions */
char *ltrim(int /*<<< orphan*/);
int /*<<< orphan*/ rtrim(char *);
char *trim(char *str) { return ltrim(rtrim(str)); }


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rtrim@plt>
mov    %eax,%edi
call   1040 <ltrim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rax
call   1030 <rtrim@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ltrim@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @rtrim(i8* %3)
%5 = call i8* @ltrim(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i32 @rtrim(i8* %0)
%3 = tail call i8* @ltrim(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ test_stratego_char_string_entities();
int /*<<< orphan*/ test_stratego_comments();
void all_stratego_tests() {
  test_stratego_comments();
  test_stratego_char_string_entities();
}


x86 assembly (clang, -O0):
<all_stratego_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_stratego_comments@plt>
mov    $0x0,%al
call   1030 <test_stratego_char_string_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_stratego_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_stratego_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_stratego_char_string_entities@plt>

LLVM IR (-O0):
define void @all_stratego_tests() {
%1 = call i32 (...) @test_stratego_comments()
%2 = call i32 (...) @test_stratego_char_string_entities()
ret void
}

LLVM IR (-O2):
define void @all_stratego_tests() {
%1 = tail call i32 (...) @test_stratego_comments()
%2 = tail call i32 (...) @test_stratego_char_string_entities()
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t getpgrp(void) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getpgrp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpgrp>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getpgrp() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getpgrp() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EPIConfigGPModeSet(uint32_t ui32Base, uint32_t ui32Config,
                        uint32_t ui32FrameCount, uint32_t ui32MaxWait) {
  ;
  ;
  ;
  ui32Config &= ~0x03C00000;
  ui32Config |= ui32FrameCount << 22;
  (*((volatile unsigned long *)(ui32Base + 0x00000010))) = ui32Config;
}


x86 assembly (clang, -O0):
<EPIConfigGPModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfc3fffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x16,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigGPModeSet>:
and    $0xfc3fffff,%esi
shl    $0x16,%edx
or     %esi,%edx
movslq %edx,%rax
movslq %edi,%rcx
mov    %rax,0x10(%rcx)
ret

LLVM IR (-O0):
define void @EPIConfigGPModeSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = and i32 %9, -62914561
store i32 %10, i32* %6
%11 = load i32, i32* %7
%12 = shl i32 %11, 22
%13 = load i32, i32* %6
%14 = or i32 %13, %12
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 16
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i64*
store volatile i64 %16, i64* %20
ret void
}

LLVM IR (-O2):
define void @EPIConfigGPModeSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, -62914561
%6 = shl i32 %2, 22
%7 = or i32 %6, %5
%8 = sext i32 %7 to i64
%9 = add nsw i32 %0, 16
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
store volatile i64 %8, i64* %11
ret void
}
/* Variables and functions */
double exp(double);
double log(double);
double power(double a, double n) {
  if (a == 0.0) {
    if (n == 0.0)
      return 1.0;
    else
      return 0.0;
  }
  return exp(n * log(a));
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1181 <power+0x61>
jp     1181 <power+0x61>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1174 <power+0x54>
jp     1174 <power+0x54>
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ab <power+0x8b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ab <power+0x8b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1146 <power+0x26>
jp     1146 <power+0x26>
cmpeqsd %xmm2,%xmm1
movsd  0xec3(%rip),%xmm0
andpd  %xmm1,%xmm0
add    $0x18,%rsp
ret
movaps %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @power(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store double 1.000000e+00, double* %3
br label %19
12: ; preds = %8
store double 0.000000e+00, double* %3
br label %19
13: ; preds = %2
%14 = load double, double* %5
%15 = load double, double* %4
%16 = call double @log(double %15)
%17 = fmul double %14, %16
%18 = call double @exp(double %17)
store double %18, double* %3
br label %19
19: ; preds = %13, %12, %11
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @power(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = fcmp oeq double %1, 0.000000e+00
%6 = select i1 %5, double 1.000000e+00, double 0.000000e+00
br label %11
7: ; preds = %2
%8 = tail call double @log(double %0)
%9 = fmul double %8, %1
%10 = tail call double @exp(double %9)
br label %11
11: ; preds = %4, %7
%12 = phi double [ %10, %7 ], [ %6, %4 ]
ret double %12
}
void interval2maximum() {}


x86 assembly (clang, -O0):
<interval2maximum>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interval2maximum>:
ret

LLVM IR (-O0):
define void @interval2maximum() {
ret void
}

LLVM IR (-O2):
define void @interval2maximum() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _pei386_runtime_relocator();
void ___dll_start() { _pei386_runtime_relocator(); }


x86 assembly (clang, -O0):
<___dll_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_pei386_runtime_relocator@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<___dll_start>:
xor    %eax,%eax
jmp    1030 <_pei386_runtime_relocator@plt>

LLVM IR (-O0):
define void @___dll_start() {
%1 = call i32 (...) @_pei386_runtime_relocator()
ret void
}

LLVM IR (-O2):
define void @___dll_start() {
%1 = tail call i32 (...) @_pei386_runtime_relocator()
ret void
}
void unset_bit(char *bytes, int idx) {
  int byte = idx >> 3;
  int bit = (byte << 3) ^ idx;
  bytes[byte] &= ~(1 << bit);
}


x86 assembly (clang, -O0):
<unset_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unset_bit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
cltq
not    %dl
and    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @unset_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = shl i32 %9, 3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = and i32 %21, %15
%23 = trunc i32 %22 to i8
store i8 %23, i8* %19
ret void
}

LLVM IR (-O2):
define void @unset_bit(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = and i32 %1, 7
%5 = shl nuw nsw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %5 to i8
%10 = xor i8 %9, -1
%11 = and i8 %8, %10
store i8 %11, i8* %7
ret void
}
void isakmp_finalize_exchange(struct message *msg) {}


x86 assembly (clang, -O0):
<isakmp_finalize_exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<isakmp_finalize_exchange>:
ret

LLVM IR (-O0):
%struct.message = type opaque
define void @isakmp_finalize_exchange(%struct.message* %0) {
%2 = alloca %struct.message*
store %struct.message* %0, %struct.message** %2
ret void
}

LLVM IR (-O2):
%struct.message = type opaque
define void @isakmp_finalize_exchange(%struct.message* nocapture %0) {
ret void
}
int _chk_same(unsigned char ar[], int n, unsigned c) {
  int i;
  for (i = 0; i < n; ++i) {
    if (c == ar[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<_chk_same>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1157 <_chk_same+0x57>
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1144 <_chk_same+0x44>
movl   $0x0,-0x4(%rbp)
jmp    115e <_chk_same+0x5e>
jmp    1149 <_chk_same+0x49>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <_chk_same+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chk_same>:
mov    $0x1,%eax
test   %esi,%esi
jle    1121 <_chk_same+0x21>
mov    %esi,%r8d
xor    %esi,%esi
xchg   %ax,%ax
movzbl (%rdi,%rsi,1),%ecx
cmp    %edx,%ecx
je     1122 <_chk_same+0x22>
add    $0x1,%rsi
cmp    %rsi,%r8
jne    1110 <_chk_same+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_chk_same(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %6
br i1 %8, label %16, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %15, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, %2
%15 = add nuw nsw i64 %10, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %3
%17 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
float tanh(float);
void atlas_vtanh(int *n, float *d) {
  int i;
  for (i = 0; i < *n; i++, d++)
    *d = tanh(*d);
}


x86 assembly (clang, -O0):
<atlas_vtanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1165 <atlas_vtanh+0x55>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <tanh@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <atlas_vtanh+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atlas_vtanh>:
push   %r15
push   %r14
push   %rbx
cmpl   $0x0,(%rdi)
jle    114a <atlas_vtanh+0x3a>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  (%r15,%rbx,4),%xmm0
call   1030 <tanh@plt>
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    (%r14),%ebx
jl     1130 <atlas_vtanh+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @atlas_vtanh(i32* %0, float* %1) {
%3 = alloca i32*
%4 = alloca float*
%5 = alloca i32
store i32* %0, i32** %3
store float* %1, float** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load float*, float** %4
%13 = load float, float* %12
%14 = call float @tanh(float %13)
%15 = load float*, float** %4
store float %14, float* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i32 1
store float* %20, float** %4
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @atlas_vtanh(i32* nocapture %0, float* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 0, %2 ]
%7 = phi float* [ %11, %5 ], [ %1, %2 ]
%8 = load float, float* %7
%9 = tail call float @tanh(float %8)
store float %9, float* %7
%10 = add nuw nsw i32 %6, 1
%11 = getelementptr inbounds float, float* %7, i64 1
%12 = load i32, i32* %0
%13 = icmp slt i32 %10, %12
br i1 %13, label %5, label %14
14: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atribuirValorAMatrizInteiros(int **, int, int,
                                                int /*<<< orphan*/);
int /*<<< orphan*/ mostrarMatrizInteiros(int **, int, int);
int main() {
  int m[3][3];
  atribuirValorAMatrizInteiros(m, 3, 3, 0);
  mostrarMatrizInteiros(m, 3, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x3,%edx
xor    %ecx,%ecx
mov    %edx,%esi
call   1030 <atribuirValorAMatrizInteiros@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   1040 <mostrarMatrizInteiros@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
call   1030 <atribuirValorAMatrizInteiros@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
call   1040 <mostrarMatrizInteiros@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [3 x i32]]
store i32 0, i32* %1
%3 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 0
%4 = bitcast [3 x i32]* %3 to i32**
%5 = call i32 @atribuirValorAMatrizInteiros(i32** %4, i32 3, i32 3, i32 0)
%6 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %2, i64 0, i64 0
%7 = bitcast [3 x i32]* %6 to i32**
%8 = call i32 @mostrarMatrizInteiros(i32** %7, i32 3, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @atribuirValorAMatrizInteiros(i32** %3, i32 3, i32 3, i32 0)
%5 = call i32 @mostrarMatrizInteiros(i32** %3, i32 3, i32 3)
ret i32 0
}
void UART1_ER_intr(void) {}


x86 assembly (clang, -O0):
<UART1_ER_intr>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART1_ER_intr>:
ret

LLVM IR (-O0):
define void @UART1_ER_intr() {
ret void
}

LLVM IR (-O2):
define void @UART1_ER_intr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void print_error(const char *msg) { perror(msg); }


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
jmp    1030 <perror@plt>

LLVM IR (-O0):
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
ret void
}

LLVM IR (-O2):
define void @print_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int);
int main() {
  int i = 1;
  int sum = 0;
  while (i < 12) {
    if (i == 10)
      break;
    if (i % 2 == 1) {
      ++i;
      continue;
    } else {
      write(i);
      ++i;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    117e <main+0x6e>
cmpl   $0xa,-0x8(%rbp)
jne    1146 <main+0x36>
jmp    117e <main+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1168 <main+0x58>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <write@plt>
mov    $0x4,%edi
call   1030 <write@plt>
mov    $0x6,%edi
call   1030 <write@plt>
mov    $0x8,%edi
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @write(i32 2)
%2 = tail call i32 @write(i32 4)
%3 = tail call i32 @write(i32 6)
%4 = tail call i32 @write(i32 8)
ret i32 0
}
/* Variables and functions */
int __toascii_impl(int);
int toascii(int c) { return __toascii_impl(c); }


x86 assembly (clang, -O0):
<toascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__toascii_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toascii>:
jmp    1030 <__toascii_impl@plt>

LLVM IR (-O0):
define i32 @toascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__toascii_impl(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = tail call i32 @__toascii_impl(i32 %0)
ret i32 %2
}
/* Type definitions */
struct config {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ config_destroy(struct config *);
int /*<<< orphan*/ free(struct config *);
void config_delete(struct config *__restrict config) {
  config_destroy(config);
  free(config);
}


x86 assembly (clang, -O0):
<config_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <config_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <config_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.config = type { i32 }
define void @config_delete(%struct.config* noalias %0) {
%2 = alloca %struct.config*
store %struct.config* %0, %struct.config** %2
%3 = load %struct.config*, %struct.config** %2
%4 = call i32 @config_destroy(%struct.config* %3)
%5 = load %struct.config*, %struct.config** %2
%6 = call i32 @free(%struct.config* %5)
ret void
}

LLVM IR (-O2):
%struct.config = type { i32 }
define void @config_delete(%struct.config* noalias %0) {
%2 = tail call i32 @config_destroy(%struct.config* %0)
%3 = tail call i32 @free(%struct.config* %0)
ret void
}
/* Variables and functions */
unsigned long long q2q(unsigned long long);
__attribute__((__visibility__("default")))
__attribute__((used)) unsigned long long
rq2q(unsigned long long *x) {
  return q2q(*x);
}


x86 assembly (clang, -O0):
<rq2q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <q2q@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq2q>:
mov    (%rdi),%rdi
jmp    1030 <q2q@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64*)* @rq2q to i8*)], section "llvm.metadata"
define i64 @rq2q(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i64 @q2q(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64*)* @rq2q to i8*)], section "llvm.metadata"
define i64 @rq2q(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @q2q(i64 %2)
ret i64 %3
}
int main() {
  int i;
  char buffer[10];
  i = 1;
  buffer[0] = 'a';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movb   $0x61,-0x12(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 0, i32* %1
store i32 1, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
store i8 97, i8* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C(char *, int);
char *TAG(char *, int /*<<< orphan*/, int, int, int, int /*<<< orphan*/);
char *TITLE(char *str, int ilev) {
  return TAG("title", 0, 1, 1, ilev, C(str, ilev + 1));
}


x86 assembly (clang, -O0):
<TITLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1040 <C@plt>
mov    -0x10(%rbp),%r8d
mov    %eax,%r9d
lea    0xeae(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <TAG@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TITLE>:
push   %rbx
mov    %esi,%ebx
lea    0x1(%rbx),%esi
call   1040 <C@plt>
lea    0xece(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    %ebx,%r8d
mov    %eax,%r9d
pop    %rbx
jmp    1030 <TAG@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"title\00"
define i8* @TITLE(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = call i32 @C(i8* %6, i32 %8)
%10 = call i8* @TAG(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 1, i32 %5, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"title\00"
define i8* @TITLE(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i32 @C(i8* %0, i32 %3)
%5 = tail call i8* @TAG(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 1, i32 %1, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ uncommentLine();
int main(int argc, char *argv[]) {
  uncommentLine();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <uncommentLine@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <uncommentLine@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @uncommentLine()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @uncommentLine()
ret i32 0
}
/* Variables and functions */
int main_control(int, char **);
int main(int argc, char *argv[]) { return main_control(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_control@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_control@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @main_control(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_control(i32 %0, i8** %1)
ret i32 %3
}