xunge/DecIR huggingface dataset:
void rop3_36_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_36_1_1>:
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
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%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    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%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_36_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_36_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int wiek = 20;
  int wzrost = 175;
  printf("Mam %d lat\n", wiek);
  printf("i mam %d cm wysokosci\n", wzrost);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0xaf,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Mam %d lat\0A\00"
@.str.1 = [23 x i8] c"i mam %d cm wysokosci\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 175, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Mam %d lat\0A\00"
@.str.1 = [23 x i8] c"i mam %d cm wysokosci\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 175)
ret i32 0
}
int arch_is_kernel_data(unsigned long addr) { return 0; }


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

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

LLVM IR (-O0):
define i32 @arch_is_kernel_data(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @arch_is_kernel_data(i64 %0) {
ret i32 0
}
/* Variables and functions */
char *fillstrx(char *, int, char);
char *fillstr(char *target, int len) { return fillstrx(target, len, ' '); }


x86 assembly (clang, -O0):
<fillstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%edx
call   1030 <fillstrx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillstr>:
mov    $0x20,%edx
jmp    1030 <fillstrx@plt>

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

LLVM IR (-O2):
define i8* @fillstr(i8* %0, i32 %1) {
%3 = tail call i8* @fillstrx(i8* %0, i32 %1, i8 signext 32)
ret i8* %3
}
int fast_plus(int a, int b, int m) {
  int ret = 0;
  while (b) {
    if (b & 1) {
      ret = (ret + a) % m;
    }
    b >>= 1;
    a = (a << 1) % m;
  }
  return ret;
}


x86 assembly (clang, -O0):
<fast_plus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1155 <fast_plus+0x55>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113a <fast_plus+0x3a>
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    1114 <fast_plus+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_plus>:
test   %esi,%esi
je     113e <fast_plus+0x3e>
mov    %edx,%r8d
xor    %r9d,%r9d
jmp    1125 <fast_plus+0x25>
nopl   0x0(%rax)
mov    %esi,%ecx
sar    %ecx
add    %edi,%edi
mov    %edi,%eax
cltd
idiv   %r8d
mov    %edx,%edi
cmp    $0x1,%esi
mov    %ecx,%esi
jbe    113a <fast_plus+0x3a>
test   $0x1,%sil
je     1110 <fast_plus+0x10>
add    %edi,%r9d
mov    %r9d,%eax
cltd
idiv   %r8d
mov    %edx,%r9d
jmp    1110 <fast_plus+0x10>
mov    %r9d,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fast_plus(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %20, label %5
5: ; preds = %3, %14
%6 = phi i32 [ %15, %14 ], [ 0, %3 ]
%7 = phi i32 [ %18, %14 ], [ %0, %3 ]
%8 = phi i32 [ %16, %14 ], [ %1, %3 ]
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = add nsw i32 %6, %7
%13 = srem i32 %12, %2
br label %14
14: ; preds = %11, %5
%15 = phi i32 [ %13, %11 ], [ %6, %5 ]
%16 = ashr i32 %8, 1
%17 = shl i32 %7, 1
%18 = srem i32 %17, %2
%19 = icmp ult i32 %8, 2
br i1 %19, label %20, label %5
20: ; preds = %14, %3
%21 = phi i32 [ 0, %3 ], [ %15, %14 ]
ret i32 %21
}
int GetShort(const unsigned char *foo) { return *(const short *)foo; }


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

x86 assembly (clang, -O2):
<GetShort>:
movswl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @GetShort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i16*
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @GetShort(i8* nocapture %0) {
%2 = bitcast i8* %0 to i16*
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, ...);
void gen_lockfile_name(char *tagfile, char *iface, char *result) {
  if (iface == NULL)
    snprintf(result, 64, "%s.all", tagfile);
  else
    snprintf(result, 64, "%s.%s", tagfile, iface);
}


x86 assembly (clang, -O0):
<gen_lockfile_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <gen_lockfile_name+0x3f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x40,%esi
lea    0xebd(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
jmp    116e <gen_lockfile_name+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x40,%esi
lea    0xea0(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_lockfile_name>:
mov    %rdx,%rax
mov    %rdi,%rcx
test   %rsi,%rsi
je     1134 <gen_lockfile_name+0x24>
mov    %rsi,%r8
lea    0xee2(%rip),%rdx
mov    %rax,%rdi
mov    $0x40,%esi
xor    %eax,%eax
jmp    1030 <snprintf@plt>
lea    0xec5(%rip),%rdx
mov    %rax,%rdi
mov    $0x40,%esi
xor    %eax,%eax
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s.all\00"
@.str.1 = [6 x i8] c"%s.%s\00"
define void @gen_lockfile_name(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %10, i32 64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %18
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %14, i32 64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16)
br label %18
18: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s.all\00"
@.str.1 = [6 x i8] c"%s.%s\00"
define void @gen_lockfile_name(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %2, i32 64, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %2, i32 64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
ret void
}
unsigned __attribute__((no, noclone)) foo(unsigned long long u) {
  unsigned __int128 v = u | 0xffffff81U;
  v >>= 64;
  return v;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffffff81,%ecx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i64
%3 = alloca i128
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = or i64 %4, 4294967169
%6 = zext i64 %5 to i128
store i128 %6, i128* %3
%7 = load i128, i128* %3
%8 = lshr i128 %7, 64
store i128 %8, i128* %3
%9 = load i128, i128* %3
%10 = trunc i128 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hd_time(FILE *f) {
  static int count = 0;
  if (!count++)
    printf("No header has been defined for the time table\n");
  return (0);
}


x86 assembly (clang, -O0):
<hd_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
jne    1142 <hd_time+0x32>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd_time>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jne    1130 <hd_time+0x20>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@hd_time.count = internal global i32 0
@.str = [47 x i8] c"No header has been defined for the time table\0A\00"
define i32 @hd_time(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @hd_time.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @hd_time.count
%5 = icmp ne i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
@hd_time.count = internal unnamed_addr global i32 0
@str = [46 x i8] c"No header has been defined for the time table\00"
define i32 @hd_time(i32* nocapture readnone %0) {
%2 = load i32, i32* @hd_time.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @hd_time.count
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}
void ARGBCopyAlphaRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBCopyAlphaRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Usage: talk-client host port user password\n");
  exit(1);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Usage: talk-client host port user password\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [43 x i8] c"Usage: talk-client host port user password\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int __attribute__((no, noclone, regparm(1)))
foo(int(__attribute__((regparm(1))) * *bar)(void *)) {
  return (*bar)(*bar);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rdi
jmp    *%rdi

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

LLVM IR (-O2):
define i32 @foo(i32 (i8*)** nocapture %0) {
%2 = load i32 (i8*)*, i32 (i8*)** %0
%3 = bitcast i32 (i8*)* %2 to i8*
%4 = tail call i32 %2(i8* %3)
ret i32 %4
}
int base12() { return 8; }


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

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

LLVM IR (-O0):
define i32 @base12() {
ret i32 8
}

LLVM IR (-O2):
define i32 @base12() {
ret i32 8
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
uint8_t capture_read_master_dma(uint16_t port, void *p) {
  capture_event(p, (5 << 8), 0, port);
  return 0xff;
}


x86 assembly (clang, -O0):
<capture_read_master_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x500,%esi
xor    %edx,%edx
call   1030 <capture_event@plt>
mov    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_read_master_dma>:
push   %rax
mov    %edi,%ecx
mov    %rsi,%rdi
mov    $0x500,%esi
xor    %edx,%edx
call   1030 <capture_event@plt>
mov    $0xff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @capture_read_master_dma(i32 %0, i8* %1) {
%3 = tail call i32 @capture_event(i8* %1, i32 1280, i32 0, i32 %0)
ret i32 255
}
int test_imm_8Fuint32_mem(unsigned int *val) {
  return ((*val) & (0x8F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Fuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x8f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Fuint32_mem>:
testb  $0x8f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Fuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 143
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_8Fuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 143
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void AT91F_Default_IRQ_handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<AT91F_Default_IRQ_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <AT91F_Default_IRQ_handler+0x9>
jmp    1109 <AT91F_Default_IRQ_handler+0x9>

x86 assembly (clang, -O2):
<AT91F_Default_IRQ_handler>:
jmp    1100 <AT91F_Default_IRQ_handler>

LLVM IR (-O0):
define void @AT91F_Default_IRQ_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @AT91F_Default_IRQ_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int watch_fd(int fd, long timeout) {
  fd_set fdset;
  struct timeval tm;
  FD_ZERO(&fdset);
  FD_SET(fd, &fdset);
  tm.tv_sec = tm.tv_usec = timeout;
  return select(fd + 1, &fdset, NULL, NULL, &tm);
}


x86 assembly (clang, -O0):
<watch_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x28(%rbp),%r8
mov    %rcx,%rdx
call   1040 <select@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<watch_fd>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebp,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
mov    %rbx,0x18(%rsp)
mov    %rbx,0x10(%rsp)
add    $0x1,%ebp
lea    0x10(%rsp),%r8
mov    %ebp,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @watch_fd(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.timeval
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = call i32 @FD_ZERO(i32* %5)
%8 = load i32, i32* %3
%9 = call i32 @FD_SET(i32 %8, i32* %5)
%10 = load i64, i64* %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
store i64 %10, i64* %11
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
store i64 %10, i64* %12
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
%15 = call i32 @select(i32 %14, i32* %5, i32* null, i32* null, %struct.timeval* %6)
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @watch_fd(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.timeval
%5 = bitcast i32* %3 to i8*
%6 = bitcast %struct.timeval* %4 to i8*
%7 = call i32 @FD_ZERO(i32* %3)
%8 = call i32 @FD_SET(i32 %0, i32* %3)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
store i64 %1, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
store i64 %1, i64* %10
%11 = add nsw i32 %0, 1
%12 = call i32 @select(i32 %11, i32* %3, i32* null, i32* null, %struct.timeval* %4)
ret i32 %12
}
/* Variables and functions */
int is_category_Zp(unsigned int);
bool is_property_paragraph_separator(unsigned int ch) {
  return is_category_Zp(ch);
}


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

x86 assembly (clang, -O2):
<is_property_paragraph_separator>:
jmp    1030 <is_category_Zp@plt>

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

LLVM IR (-O2):
define i32 @is_property_paragraph_separator(i32 %0) {
%2 = tail call i32 @is_category_Zp(i32 %0)
ret i32 %2
}
int session_compare(struct session *lhs, struct session *rhs) {
  return (lhs < rhs) ? -1 : ((lhs > rhs) ? 1 : 0);
}


x86 assembly (clang, -O0):
<session_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <session_compare+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <session_compare+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<session_compare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
%struct.session = type opaque
define i32 @session_compare(%struct.session* %0, %struct.session* %1) {
%3 = alloca %struct.session*
%4 = alloca %struct.session*
store %struct.session* %0, %struct.session** %3
store %struct.session* %1, %struct.session** %4
%5 = load %struct.session*, %struct.session** %3
%6 = load %struct.session*, %struct.session** %4
%7 = icmp ult %struct.session* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load %struct.session*, %struct.session** %3
%11 = load %struct.session*, %struct.session** %4
%12 = icmp ugt %struct.session* %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.session = type opaque
define i32 @session_compare(%struct.session* readnone %0, %struct.session* readnone %1) {
%3 = icmp ult %struct.session* %0, %1
%4 = icmp ugt %struct.session* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int *calc_failure(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int *calc_failure_cstr(const char *s) { return calc_failure(s, strlen(s)); }


x86 assembly (clang, -O0):
<calc_failure_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <calc_failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_failure_cstr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <calc_failure@plt>

LLVM IR (-O0):
define i32* @calc_failure_cstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32* @calc_failure(i8* %3, i32 %5)
ret i32* %6
}

LLVM IR (-O2):
define i32* @calc_failure_cstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32* @calc_failure(i8* %0, i32 %2)
ret i32* %3
}
void rop3_11_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_11_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)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %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_11_1_0>:
or     %esi,%edx
not    %dl
mov    (%rdi),%al
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_11_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int attime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int at;
  while (1) {
    at = attime(NULL);
    printf("@%d\n", at);
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <attime@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <attime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"@%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @attime(i32* null)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"@%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @attime(i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ g();
void fool(long long x) {
  if (x != 0x123456)
    g();
}


x86 assembly (clang, -O0):
<fool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x123456,-0x8(%rbp)
je     1131 <fool+0x21>
mov    $0x0,%al
call   1030 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fool>:
cmp    $0x123456,%rdi
jne    111a <fool+0xa>
ret
xor    %eax,%eax
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @fool(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 1193046
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @g()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @fool(i64 %0) {
%2 = icmp eq i64 %0, 1193046
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @g()
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pelnor_(double *, double *);
void cpelnor(double *xmom, double *para) { pelnor_(xmom, para); }


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

x86 assembly (clang, -O2):
<cpelnor>:
jmp    1030 <pelnor_@plt>

LLVM IR (-O0):
define void @cpelnor(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 i32 @pelnor_(double* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @cpelnor(double* %0, double* %1) {
%3 = tail call i32 @pelnor_(double* %0, double* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void die_on_error(int r) { __coverity_panic__(); }


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

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

LLVM IR (-O0):
define void @die_on_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @die_on_error(i32 %0) {
%2 = tail call i32 (...) @__coverity_panic__()
ret void
}
void magic2(void *p) { return; }


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

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

LLVM IR (-O0):
define void @magic2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @magic2(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usr1_handler(int signo) { printf("signal received from child!!\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"signal received from child!!\0A\00"
define void @usr1_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"signal received from child!!\00"
define void @usr1_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double scs_tan_rd(double);
double tan_rd(double x) { return scs_tan_rd(x); }


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

x86 assembly (clang, -O2):
<tan_rd>:
jmp    1030 <scs_tan_rd@plt>

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

LLVM IR (-O2):
define double @tan_rd(double %0) {
%2 = tail call double @scs_tan_rd(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  for (;;)
    printf("hello world\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %1
}
void outp(int x, int y) { return; }


x86 assembly (clang, -O0):
<outp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @outp(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ coroutine_yield();
int /*<<< orphan*/ printf(char *, char const *);
void func(void *arg) {
  const char *str = arg;
  while (1) {
    printf("%s\n", str);
    coroutine_yield();
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <coroutine_yield@plt>
jmp    1134 <func+0x14>

x86 assembly (clang, -O2):
<func>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <coroutine_yield@plt>
jmp    1130 <func+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %1, %5
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @coroutine_yield()
br label %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @func(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @coroutine_yield()
br label %2
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(scalar_t__);
scalar_t__ time(int /*<<< orphan*/);
int random_port(int min, int max, int seed) {
  int random;
  srand(time(0) + seed);
  random = rand() % (max - min + 1) + min;
  return random;
}


x86 assembly (clang, -O0):
<random_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_port>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
movslq %r14d,%rdi
add    %rax,%rdi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_port(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i64 @time(i32 0)
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = add nsw i64 %8, %10
%12 = call i32 @srand(i64 %11)
%13 = call i32 (...) @rand()
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = srem i32 %13, %17
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @random_port(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @time(i32 0)
%5 = sext i32 %2 to i64
%6 = add nsw i64 %4, %5
%7 = tail call i32 @srand(i64 %6)
%8 = tail call i32 (...) @rand()
%9 = sub i32 1, %0
%10 = add i32 %9, %1
%11 = srem i32 %8, %10
%12 = add nsw i32 %11, %0
ret i32 %12
}
/* Variables and functions */
int EOF;
int getchar();
void flush() {
  int c;
  while ((c = getchar()) != EOF && c != '\n')
    ;
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ebb(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1142 <flush+0x32>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1152 <flush+0x42>
jmp    1157 <flush+0x47>
jmp    1118 <flush+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <flush+0x20>
cmp    (%rbx),%eax
jne    1120 <flush+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @flush() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 10
br label %9
9: ; preds = %6, %2
%10 = phi i1 [ false, %2 ], [ %8, %6 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = icmp ne i32 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("USAGE: fatsys <image file> <boot_sector>\n"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"USAGE: fatsys <image file> <boot_sector>\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"USAGE: fatsys <image file> <boot_sector>\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int8_t;
typedef int int32_t;

/* Variables and functions */
int32_t ld_i32_be(const void *x) {
  return (
      (((((int32_t)(((int8_t *)x)[0])) << 8) | ((int32_t)(((uint8_t *)x)[1])))
       << 16) |
      ((((int32_t)(((uint8_t *)x)[2])) << 8) | ((int32_t)(((uint8_t *)x)[3]))));
}


x86 assembly (clang, -O0):
<ld_i32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
or     %ecx,%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rdx
mov    0x18(%rdx),%rdx
or     %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_i32_be>:
mov    (%rdi),%ecx
mov    0x8(%rdi),%eax
shl    $0x18,%ecx
shl    $0x10,%eax
or     %ecx,%eax
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
or     0x18(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ld_i32_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = or i32 %8, %13
%15 = shl i32 %14, 16
%16 = load i8*, i8** %2
%17 = bitcast i8* %16 to i64*
%18 = getelementptr inbounds i64, i64* %17, i64 2
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 8
%22 = load i8*, i8** %2
%23 = bitcast i8* %22 to i64*
%24 = getelementptr inbounds i64, i64* %23, i64 3
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = or i32 %21, %26
%28 = or i32 %15, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ld_i32_be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %4, 24
%10 = shl i32 %8, 16
%11 = getelementptr inbounds i8, i8* %0, i64 16
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 8
%16 = getelementptr inbounds i8, i8* %0, i64 24
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = or i32 %10, %9
%21 = or i32 %20, %19
%22 = or i32 %21, %15
ret i32 %22
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR54_get(void) { return U_WMRCORENONE_get("U_WMR54"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR54\00"
define i32 @U_WMR54_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR54\00"
define i32 @U_WMR54_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void RTCrc32Finish(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCrc32Finish() {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRDD_set(void) { return U_WMRCORENONE_set("U_WMRDD"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRDD\00"
define i8* @U_WMRDD_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDD\00"
define i8* @U_WMRDD_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int _IpsrGet();
int _sys_current_irq_key_get(void) { return _IpsrGet(); }


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

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

LLVM IR (-O0):
define i32 @_sys_current_irq_key_get() {
%1 = call i32 (...) @_IpsrGet()
ret i32 %1
}

LLVM IR (-O2):
define i32 @_sys_current_irq_key_get() {
%1 = tail call i32 (...) @_IpsrGet()
ret i32 %1
}
int pl_yywrap(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @pl_yywrap() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ convexInteractAbort(char *);
void convexInteractKeyPress() {
  convexInteractAbort("Boundary update was aborted by user");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Boundary update was aborted by user\00"
define void @convexInteractKeyPress() {
%1 = call i32 @convexInteractAbort(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Boundary update was aborted by user\00"
define void @convexInteractKeyPress() {
%1 = tail call i32 @convexInteractAbort(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}