xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  short int i1 = 32767;
  printf("First debug int is %d\n", i1);
  i1++;
  printf("Second debug int is now %d \n", i1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x7fff,-0x12(%rbp)
lea    0xed4(%rip),%rdi
movswl -0x12(%rbp),%esi
call   1030 <printf@plt>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
lea    0xecf(%rip),%rdi
movswl -0x12(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7fff,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0xffff8000,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"First debug int is %d\0A\00"
@.str.1 = [29 x i8] c"Second debug int is now %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i16
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
store i16 32767, i16* %5
%8 = load i16, i16* %5
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 signext %8)
%10 = load i16, i16* %5
%11 = add i16 %10, 1
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i16 signext %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"First debug int is %d\0A\00"
@.str.1 = [29 x i8] c"Second debug int is now %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i16 signext 32767)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i16 signext -32768)
ret i32 0
}
int cntbits(char byte) {
  static int i, count;
  for (count = i = 0; i < 8; i++) {
    count += (byte & 1);
    byte >>= 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<cntbits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,0x2f10(%rip)
movl   $0x0,0x2f0a(%rip)
cmpl   $0x8,0x2eff(%rip)
jge    115c <cntbits+0x5c>
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
add    0x2ef0(%rip),%eax
mov    %eax,0x2eea(%rip)
movsbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    0x2ed6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ecd(%rip)
jmp    111e <cntbits+0x1e>
mov    0x2ec6(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cntbits>:
mov    %edi,%eax
and    $0x1,%al
mov    %edi,%ecx
shr    %cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x2,%al
and    $0x1,%al
add    %cl,%al
mov    %edi,%ecx
shr    $0x3,%cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x4,%al
and    $0x1,%al
add    %cl,%al
mov    %edi,%ecx
shr    $0x5,%cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x6,%al
and    $0x1,%al
add    %cl,%al
movzbl %al,%ecx
shr    $0x7,%dil
movzbl %dil,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@cntbits.i = internal global i32 0
@cntbits.count = internal global i32 0
define i32 @cntbits(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
store i32 0, i32* @cntbits.i
store i32 0, i32* @cntbits.count
br label %3
3: ; preds = %16, %1
%4 = load i32, i32* @cntbits.i
%5 = icmp slt i32 %4, 8
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 1
%10 = load i32, i32* @cntbits.count
%11 = add nsw i32 %10, %9
store i32 %11, i32* @cntbits.count
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = ashr i32 %13, 1
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %16
16: ; preds = %6
%17 = load i32, i32* @cntbits.i
%18 = add nsw i32 %17, 1
store i32 %18, i32* @cntbits.i
br label %3
19: ; preds = %3
%20 = load i32, i32* @cntbits.count
ret i32 %20
}

LLVM IR (-O2):
define i32 @cntbits(i8 signext %0) {
%2 = and i8 %0, 1
%3 = lshr i8 %0, 1
%4 = and i8 %3, 1
%5 = add nuw nsw i8 %2, %4
%6 = lshr i8 %0, 2
%7 = and i8 %6, 1
%8 = add nuw nsw i8 %5, %7
%9 = lshr i8 %0, 3
%10 = and i8 %9, 1
%11 = add nuw nsw i8 %8, %10
%12 = lshr i8 %0, 4
%13 = and i8 %12, 1
%14 = add nuw nsw i8 %11, %13
%15 = lshr i8 %0, 5
%16 = and i8 %15, 1
%17 = add nuw nsw i8 %14, %16
%18 = lshr i8 %0, 6
%19 = and i8 %18, 1
%20 = add nuw nsw i8 %17, %19
%21 = zext i8 %20 to i32
%22 = lshr i8 %0, 7
%23 = zext i8 %22 to i32
%24 = add nuw nsw i32 %21, %23
ret i32 %24
}
int cloog_version_minor(void) { return 15; }


x86 assembly (clang, -O0):
<cloog_version_minor>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cloog_version_minor>:
mov    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @cloog_version_minor() {
ret i32 15
}

LLVM IR (-O2):
define i32 @cloog_version_minor() {
ret i32 15
}
int interface_cannot_create_file(void) { return 1; }


x86 assembly (clang, -O0):
<interface_cannot_create_file>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interface_cannot_create_file>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @interface_cannot_create_file() {
ret i32 1
}

LLVM IR (-O2):
define i32 @interface_cannot_create_file() {
ret i32 1
}
void FromFileTerminate(void) {}


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

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

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

LLVM IR (-O2):
define void @FromFileTerminate() {
ret void
}
void clearAprsPwmInterrupt() {}


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

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

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

LLVM IR (-O2):
define void @clearAprsPwmInterrupt() {
ret void
}
/* Variables and functions */
int errno;
scalar_t__ execl(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, int);
int cc_up_reload_user(char *cc_up_uexe) {
  if (execl(cc_up_uexe, NULL) < 0) {
    printf("reload %s exe failed. err:%d \n", cc_up_uexe, errno);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cc_up_reload_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <execl@plt>
cmp    $0x0,%rax
jge    1168 <cc_up_reload_user+0x48>
mov    -0x10(%rbp),%rsi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <cc_up_reload_user+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_up_reload_user>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %esi,%esi
call   1040 <execl@plt>
test   %rax,%rax
jns    1152 <cc_up_reload_user+0x32>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xebb(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"reload %s exe failed. err:%d \0A\00"
@errno = global i32 0
define i32 @cc_up_reload_user(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @execl(i8* %4, i32* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i32, i32* @errno
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [31 x i8] c"reload %s exe failed. err:%d \0A\00"
@errno = global i32 0
define i32 @cc_up_reload_user(i8* %0) {
%2 = tail call i64 @execl(i8* %0, i32* null)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %8
}
int c_fun() { return 3; }


x86 assembly (clang, -O0):
<c_fun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fun>:
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @c_fun() {
ret i32 3
}

LLVM IR (-O2):
define i32 @c_fun() {
ret i32 3
}
void rop3_181_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | *D;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_181_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_181_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
and    %dl,%cl
xor    %al,%cl
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_181_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = xor i32 %31, -1
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = trunc i32 %46 to i8
%48 = load i8*, i8** %4
store i8 %47, i8* %48
ret void
}

LLVM IR (-O2):
define void @rop3_181_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %4
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %4, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
int f7(int x, unsigned y) {
  int a = x + y;
  return x - a;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %esi,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @f7(i32 %0, i32 %1) {
%3 = sub i32 0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
unsigned int logic_decimal_is_zero(unsigned short to_compare, char *p_result) {
  assert(p_result);
  unsigned int err_code = 0;
  if (!p_result) {
    err_code = 2;
    goto end;
  }
  *p_result = (to_compare == 0);
end:
  return err_code;
}


x86 assembly (clang, -O0):
<logic_decimal_is_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <logic_decimal_is_zero+0x3a>
movl   $0x2,-0x14(%rbp)
jmp    1161 <logic_decimal_is_zero+0x51>
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logic_decimal_is_zero>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     112f <logic_decimal_is_zero+0x1f>
test   %bp,%bp
sete   (%rbx)
xor    %eax,%eax
jmp    1134 <logic_decimal_is_zero+0x24>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @logic_decimal_is_zero(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca i32
store i16 %0, i16* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @assert(i8* %6)
store i32 0, i32* %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 2, i32* %5
br label %18
11: ; preds = %2
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
store i8 %16, i8* %17
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @logic_decimal_is_zero(i16 zeroext %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = icmp eq i16 %0, 0
%7 = zext i1 %6 to i8
store i8 %7, i8* %1
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 2, %2 ]
ret i32 %9
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rotr32(const uint32_t w, const unsigned c) {
  return (w >> c) | (w << (32 - c));
}


x86 assembly (clang, -O0):
<rotr32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr32>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotr32(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotr32(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int aaip_local_attr_support(int flag) {
  int ret = 0;
  return (ret);
}


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

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

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

LLVM IR (-O2):
define i32 @aaip_local_attr_support(i32 %0) {
ret i32 0
}
/* Variables and functions */
int Scl_ConGetInArr_(int /*<<< orphan*/, int);
int /*<<< orphan*/ Scl_ConReadMan();
int Scl_ConGetInArr(int i) { return Scl_ConGetInArr_(Scl_ConReadMan(), i); }


x86 assembly (clang, -O0):
<Scl_ConGetInArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <Scl_ConGetInArr_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_ConGetInArr>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <Scl_ConGetInArr_@plt>

LLVM IR (-O0):
define i32 @Scl_ConGetInArr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Scl_ConReadMan()
%4 = load i32, i32* %2
%5 = call i32 @Scl_ConGetInArr_(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @Scl_ConGetInArr(i32 %0) {
%2 = tail call i32 (...) @Scl_ConReadMan()
%3 = tail call i32 @Scl_ConGetInArr_(i32 %2, i32 %0)
ret i32 %3
}
void enterBlePriv12SysPatch(void) {}


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

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

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

LLVM IR (-O2):
define void @enterBlePriv12SysPatch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void debug1(int d) { printf("the node is %d\n", d); }


x86 assembly (clang, -O0):
<debug1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"the node is %d\0A\00"
define void @debug1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"the node is %d\0A\00"
define void @debug1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned char e86_get_mem_uint8(void *mem, unsigned long addr) {
  return (0xaa);
}


x86 assembly (clang, -O0):
<e86_get_mem_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xaa,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e86_get_mem_uint8>:
mov    $0xaa,%al
ret

LLVM IR (-O0):
define zeroext i8 @e86_get_mem_uint8(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i8 -86
}

LLVM IR (-O2):
define zeroext i8 @e86_get_mem_uint8(i8* nocapture readnone %0, i64 %1) {
ret i8 -86
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void general_help(void) {
  puts(
      "Common Options:\n"
      "    --threshold NUM           Threshold of packets to send     (default "
      "1000)\n"
      "    --flood                   This option supersedes the \'threshold\'\n"
      "    --encapsulated            Encapsulated protocol (GRE)      (default "
      "OFF)\n"
      " -B,--bogus-csum              Bogus checksum                   (default "
      "OFF)\n"
      " -v,--version                 Print version and exit \n"
      " -h,--help                    Display this help and exit\n");
}


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

x86 assembly (clang, -O2):
<general_help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [429 x i8] c"Common Options:\0A --threshold NUM Threshold of packets to send (default 1000)\0A --flood This option supersedes the 'threshold'\0A --encapsulated Encapsulated protocol (GRE) (default OFF)\0A -B,--bogus-csum Bogus checksum (default OFF)\0A -v,--version Print version and exit \0A -h,--help Display this help and exit\0A\00"
define void @general_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([429 x i8], [429 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [429 x i8] c"Common Options:\0A --threshold NUM Threshold of packets to send (default 1000)\0A --flood This option supersedes the 'threshold'\0A --encapsulated Encapsulated protocol (GRE) (default OFF)\0A -B,--bogus-csum Bogus checksum (default OFF)\0A -v,--version Print version and exit \0A -h,--help Display this help and exit\0A\00"
define void @general_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([429 x i8], [429 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid_count(int, int /*<<< orphan*/, int, int, int, int);
void cpuid(int level, int output[4]) {
  int a, b, c, d;
  __cpuid_count(level, 0, a, b, c, d);
  output[0] = a;
  output[1] = b;
  output[2] = c;
  output[3] = d;
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
xor    %esi,%esi
call   1030 <__cpuid_count@plt>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
xor    %esi,%esi
jmp    1030 <__cpuid_count@plt>

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @__cpuid_count(i32 %9, i32 0, i32 %10, i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 %15, i32* %17
%18 = load i32, i32* %6
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 %18, i32* %20
%21 = load i32, i32* %7
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 2
store i32 %21, i32* %23
%24 = load i32, i32* %8
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @__cpuid_count(i32 %0, i32 0, i32 undef, i32 undef, i32 undef, i32 undef)
ret void
}
int makeword(int lowbyte, int highbyte) {
  unsigned short word;
  word = highbyte;
  word = word << 8;
  word = word + lowbyte;
  return (int)word;
}


x86 assembly (clang, -O0):
<makeword>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeword>:
shl    $0x8,%esi
add    %edi,%esi
movzwl %si,%eax
ret

LLVM IR (-O0):
define i32 @makeword(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i16
store i16 %7, i16* %5
%8 = load i16, i16* %5
%9 = zext i16 %8 to i32
%10 = shl i32 %9, 8
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = trunc i32 %15 to i16
store i16 %16, i16* %5
%17 = load i16, i16* %5
%18 = zext i16 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @makeword(i32 %0, i32 %1) {
%3 = shl i32 %1, 8
%4 = add i32 %3, %0
%5 = and i32 %4, 65535
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ motorDireito(int);
int /*<<< orphan*/ motorEsquerdo(int);
int /*<<< orphan*/ parar();
void mover(char direcao) {
  switch (direcao) {
  case 'F':
    motorDireito(1);
    motorEsquerdo(1);
    break;
  case 'T':
    motorDireito(0);
    motorEsquerdo(0);
    break;
  case 'P':
    parar();
    break;
  }
}


x86 assembly (clang, -O0):
<mover>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x46,%eax
je     1175 <mover+0x45>
jmp    1153 <mover+0x23>
mov    -0x8(%rbp),%eax
sub    $0x50,%eax
je     11a1 <mover+0x71>
jmp    1164 <mover+0x34>
mov    -0x8(%rbp),%eax
sub    $0x54,%eax
je     118e <mover+0x5e>
jmp    11a8 <mover+0x78>
mov    $0x1,%edi
call   1040 <motorDireito@plt>
mov    $0x1,%edi
call   1050 <motorEsquerdo@plt>
jmp    11a8 <mover+0x78>
xor    %edi,%edi
call   1040 <motorDireito@plt>
xor    %edi,%edi
call   1050 <motorEsquerdo@plt>
jmp    11a8 <mover+0x78>
mov    $0x0,%al
call   1030 <parar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mover>:
push   %rax
cmp    $0x54,%edi
je     1155 <mover+0x25>
cmp    $0x50,%edi
je     1164 <mover+0x34>
cmp    $0x46,%edi
jne    116c <mover+0x3c>
mov    $0x1,%edi
call   1040 <motorDireito@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <motorEsquerdo@plt>
xor    %edi,%edi
call   1040 <motorDireito@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <motorEsquerdo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <parar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mover(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %13 [
i32 70, label %5
i32 84, label %8
i32 80, label %11
]
5: ; preds = %1
%6 = call i32 @motorDireito(i32 1)
%7 = call i32 @motorEsquerdo(i32 1)
br label %13
8: ; preds = %1
%9 = call i32 @motorDireito(i32 0)
%10 = call i32 @motorEsquerdo(i32 0)
br label %13
11: ; preds = %1
%12 = call i32 (...) @parar()
br label %13
13: ; preds = %1, %11, %8, %5
ret void
}

LLVM IR (-O2):
define void @mover(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %11 [
i32 70, label %3
i32 84, label %6
i32 80, label %9
]
3: ; preds = %1
%4 = tail call i32 @motorDireito(i32 1)
%5 = tail call i32 @motorEsquerdo(i32 1)
br label %11
6: ; preds = %1
%7 = tail call i32 @motorDireito(i32 0)
%8 = tail call i32 @motorEsquerdo(i32 0)
br label %11
9: ; preds = %1
%10 = tail call i32 (...) @parar()
br label %11
11: ; preds = %1, %9, %6, %3
ret void
}
int ipcmp(struct in6_addr *a, struct in6_addr *b) {
  int i = 128;
  char *A = (char *)a;
  char *B = (char *)b;
  while (i) {
    i--;
    if (*A++ != *B++)
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<ipcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x80,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116c <ipcmp+0x6c>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1167 <ipcmp+0x67>
jmp    116c <ipcmp+0x6c>
jmp    1123 <ipcmp+0x23>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%edx
lea    0x1(%rax),%rcx
cmp    (%rsi,%rax,1),%dl
jne    1125 <ipcmp+0x25>
cmp    $0x7f,%eax
mov    %rcx,%rax
jne    1110 <ipcmp+0x10>
mov    $0x80,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
%struct.in6_addr = type opaque
define i32 @ipcmp(%struct.in6_addr* nocapture %0, %struct.in6_addr* nocapture %1) {
%3 = bitcast %struct.in6_addr* %0 to i8*
%4 = bitcast %struct.in6_addr* %1 to i8*
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 128, %2 ], [ %9, %5 ]
%7 = phi i8* [ %3, %2 ], [ %10, %5 ]
%8 = phi i8* [ %4, %2 ], [ %12, %5 ]
%9 = add nsw i32 %6, -1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %8
%14 = icmp eq i8 %11, %13
%15 = icmp ne i32 %9, 0
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %5, label %17
17: ; preds = %5
ret i32 %9
}
void _M2_popWorld_finish(__attribute__((unused)) int argc,
                         __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_popWorld_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_M2_popWorld_finish(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_popWorld_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int rand();
void randomize_solution(int8_t *solution, int nbits) {
  for (int i = 0; i < nbits; i++) {
    solution[i] = rand() % 2;
  }
}


x86 assembly (clang, -O0):
<randomize_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <randomize_solution+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <randomize_solution+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize_solution>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1150 <randomize_solution+0x40>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <randomize_solution+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @randomize_solution(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 2
%11 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
scalar_t__ pow(int, char);
char get(long m, char idx) {
  long n10 = (long)pow(10, idx + 1);
  m %= n10;
  if (idx)
    m /= (n10 / 10);
  return m;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x1,%eax
mov    $0xa,%edi
movsbl %al,%esi
call   1030 <pow@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1173 <get+0x63>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x1(%r14),%eax
movsbl %al,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %rax,%rsi
or     %rbx,%rax
shr    $0x20,%rax
je     1149 <get+0x39>
mov    %rbx,%rax
cqto
idiv   %rsi
mov    %rdx,%rcx
test   %r14b,%r14b
jne    1156 <get+0x46>
jmp    1198 <get+0x88>
mov    %ebx,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%ecx
test   %r14b,%r14b
je     1198 <get+0x88>
movabs $0x6666666666666667,%rdx
66 66 66
mov    %rsi,%rax
imul   %rdx
mov    %rdx,%rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rsi
add    %rax,%rsi
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1190 <get+0x80>
mov    %rcx,%rax
cqto
idiv   %rsi
mov    %rax,%rcx
jmp    1198 <get+0x88>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
mov    %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @get(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i64
store i64 %0, i64* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 1
%9 = trunc i32 %8 to i8
%10 = call i64 @pow(i32 10, i8 signext %9)
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load i64, i64* %3
%13 = srem i64 %12, %11
store i64 %13, i64* %3
%14 = load i8, i8* %4
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i64, i64* %5
%18 = sdiv i64 %17, 10
%19 = load i64, i64* %3
%20 = sdiv i64 %19, %18
store i64 %20, i64* %3
br label %21
21: ; preds = %16, %2
%22 = load i64, i64* %3
%23 = trunc i64 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @get(i64 %0, i8 signext %1) {
%3 = add i8 %1, 1
%4 = tail call i64 @pow(i32 10, i8 signext %3)
%5 = srem i64 %0, %4
%6 = icmp eq i8 %1, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = sdiv i64 %4, 10
%9 = sdiv i64 %5, %8
br label %10
10: ; preds = %7, %2
%11 = phi i64 [ %9, %7 ], [ %5, %2 ]
%12 = trunc i64 %11 to i8
ret i8 %12
}
int is_ratio_reached(int bouncy, int non_bouncy) {
  return ((double)bouncy) / (bouncy + non_bouncy) >= 0.99;
}


x86 assembly (clang, -O0):
<is_ratio_reached>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xedb(%rip),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ratio_reached>:
cvtsi2sd %edi,%xmm0
add    %edi,%esi
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
xor    %eax,%eax
ucomisd 0xee8(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @is_ratio_reached(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 = sitofp i32 %5 to double
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %6, %10
%12 = fcmp oge double %11, 0x3FEFAE147AE147AE
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_ratio_reached(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = add nsw i32 %1, %0
%5 = sitofp i32 %4 to double
%6 = fdiv double %3, %5
%7 = fcmp oge double %6, 0x3FEFAE147AE147AE
%8 = zext i1 %7 to i32
ret i32 %8
}
int capture_r(const char *carg, void *pvar) {
  int *p = pvar;
  if (!p)
    return 1;
  *p = 'r';
  return 0;
}


x86 assembly (clang, -O0):
<capture_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    112b <capture_r+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    113c <capture_r+0x3c>
mov    -0x20(%rbp),%rax
movl   $0x72,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_r>:
test   %rsi,%rsi
je     110e <capture_r+0xe>
movl   $0x72,(%rsi)
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @capture_r(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp ne i32* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 1, i32* %3
br label %14
12: ; preds = %2
%13 = load i32*, i32** %6
store i32 114, i32* %13
store i32 0, i32* %3
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @capture_r(i8* nocapture readnone %0, i8* writeonly %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = bitcast i8* %1 to i32*
store i32 114, i32* %5
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cnfImprt(char *const, int, char *);
int /*<<< orphan*/ msgSeti(char *, int);
int /*<<< orphan*/ starFree(char *);
char *starMallocAtomic(int);
void msg_seti_(char *const TOKEN, int *const IVALUE, int TOKEN_length) {
  int ivalue;
  char *token;
  ;
  ivalue = *IVALUE;
  token = starMallocAtomic(TOKEN_length + 1);
  cnfImprt(TOKEN, TOKEN_length, token);
  msgSeti(token, ivalue);
  starFree(token);
}


x86 assembly (clang, -O0):
<msg_seti_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <starMallocAtomic@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1050 <cnfImprt@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1060 <msgSeti@plt>
mov    -0x20(%rbp),%rdi
call   1030 <starFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_seti_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    (%rsi),%r15d
lea    0x1(%rbx),%edi
call   1040 <starMallocAtomic@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1050 <cnfImprt@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
call   1060 <msgSeti@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <starFree@plt>

LLVM IR (-O0):
define void @msg_seti_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
%13 = call i8* @starMallocAtomic(i32 %12)
store i8* %13, i8** %8
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = load i8*, i8** %8
%17 = call i32 @cnfImprt(i8* %14, i32 %15, i8* %16)
%18 = load i8*, i8** %8
%19 = load i32, i32* %7
%20 = call i32 @msgSeti(i8* %18, i32 %19)
%21 = load i8*, i8** %8
%22 = call i32 @starFree(i8* %21)
ret void
}

LLVM IR (-O2):
define void @msg_seti_(i8* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %2, 1
%6 = tail call i8* @starMallocAtomic(i32 %5)
%7 = tail call i32 @cnfImprt(i8* %0, i32 %2, i8* %6)
%8 = tail call i32 @msgSeti(i8* %6, i32 %4)
%9 = tail call i32 @starFree(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_nextafter();
scalar_t__ nextafter(double, double);
void test_nextafter(double d1, double d2) {
  if (nextafter(d1, d2) != nextafter(d1, d2))
    link_failure_nextafter();
}


x86 assembly (clang, -O0):
<test_nextafter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <nextafter@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <nextafter@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_nextafter+0x4b>
mov    $0x0,%al
call   1030 <link_failure_nextafter@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nextafter>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <nextafter@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <nextafter@plt>
cmp    %rax,%rbx
jne    1153 <test_nextafter+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_nextafter@plt>

LLVM IR (-O0):
define void @test_nextafter(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i64 @nextafter(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i64 @nextafter(double %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_nextafter()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_nextafter(double %0, double %1) {
%3 = tail call i64 @nextafter(double %0, double %1)
%4 = tail call i64 @nextafter(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_nextafter()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t mp2vseq_get_horizontal(const uint8_t *p_mp2vseq) {
  return (p_mp2vseq[4] << 4) | (p_mp2vseq[5] >> 4);
}


x86 assembly (clang, -O0):
<mp2vseq_get_horizontal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
mov    0x14(%rcx),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_get_horizontal>:
mov    0x10(%rdi),%ecx
mov    0x14(%rdi),%eax
shl    $0x4,%ecx
sar    $0x4,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseq_get_horizontal(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = shl i32 %5, 4
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
%9 = load i32, i32* %8
%10 = ashr i32 %9, 4
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mp2vseq_get_horizontal(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = shl i32 %3, 4
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = ashr i32 %6, 4
%8 = or i32 %7, %4
ret i32 %8
}
void nm_log(int prio, const char *fmt, ...) {}


x86 assembly (clang, -O0):
<nm_log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nm_log(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @nm_log(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Type definitions */
struct roff_node {
  int dummy;
};
struct roff_meta {
  int dummy;
};
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_text(struct html *, char *);
int mdoc_bt_pre(const struct roff_meta *meta, struct roff_node *n,
                struct html *h) {
  print_text(h, "is currently in beta test.");
  return 0;
}


x86 assembly (clang, -O0):
<mdoc_bt_pre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <print_text@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdoc_bt_pre>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <print_text@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
%struct.html = type { i32 }
@.str = [27 x i8] c"is currently in beta test.\00"
define i32 @mdoc_bt_pre(%struct.roff_meta* %0, %struct.roff_node* %1, %struct.html* %2) {
%4 = alloca %struct.roff_meta*
%5 = alloca %struct.roff_node*
%6 = alloca %struct.html*
store %struct.roff_meta* %0, %struct.roff_meta** %4
store %struct.roff_node* %1, %struct.roff_node** %5
store %struct.html* %2, %struct.html** %6
%7 = load %struct.html*, %struct.html** %6
%8 = call i32 @print_text(%struct.html* %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
%struct.html = type { i32 }
@.str = [27 x i8] c"is currently in beta test.\00"
define i32 @mdoc_bt_pre(%struct.roff_meta* nocapture readnone %0, %struct.roff_node* nocapture readnone %1, %struct.html* %2) {
%4 = tail call i32 @print_text(%struct.html* %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rdtsc_markerStartRegion(char *, int);
void cere_markerStartRegion(char *regName, bool vivo, int requested_invoc,
                            int curr_invoc) {
  if (requested_invoc == curr_invoc) {
    rdtsc_markerStartRegion(regName, vivo);
  }
}


x86 assembly (clang, -O0):
<cere_markerStartRegion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    113d <cere_markerStartRegion+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <rdtsc_markerStartRegion@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cere_markerStartRegion>:
cmp    %ecx,%edx
jne    1119 <cere_markerStartRegion+0x9>
jmp    1030 <rdtsc_markerStartRegion@plt>
ret

LLVM IR (-O0):
define void @cere_markerStartRegion(i8* %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @rdtsc_markerStartRegion(i8* %13, i32 %14)
br label %16
16: ; preds = %12, %4
ret void
}

LLVM IR (-O2):
define void @cere_markerStartRegion(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @rdtsc_markerStartRegion(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
void gtk_text_iter_backward_word_starts() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_backward_word_starts() {
ret void
}