xunge/DecIR huggingface dataset:
unsigned xrop3_88_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | T;
  stk2 = D & stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_88_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_88_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_88_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
int str_cmp(char *s, char *t) {
  for (; *s == *t; ++s, ++t)
    if (*t == '\0')
      return 0;
  return *s - *t;
}


x86 assembly (clang, -O0):
<str_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <str_cmp+0x60>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <str_cmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <str_cmp+0x73>
jmp    1143 <str_cmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <str_cmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cmp>:
mov    (%rdi),%al
mov    (%rsi),%dl
cmp    %dl,%al
jne    1124 <str_cmp+0x24>
mov    $0x1,%ecx
nopl   (%rax)
test   %al,%al
je     112d <str_cmp+0x2d>
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
add    $0x1,%rcx
cmp    %dl,%al
je     1110 <str_cmp+0x10>
movsbl %dl,%ecx
movsbl %al,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %19 to i32
%21 = sext i8 %18 to i32
%22 = sub nsw i32 %21, %20
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Type definitions */
struct iw_request_info {
  int dummy;
};

/* Variables and functions */
int IW_EV_POINT_LEN;
int iwe_stream_point_len(struct iw_request_info *info) {
  return IW_EV_POINT_LEN;
}


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

x86 assembly (clang, -O2):
<iwe_stream_point_len>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.iw_request_info = type { i32 }
@IW_EV_POINT_LEN = global i32 0
define i32 @iwe_stream_point_len(%struct.iw_request_info* %0) {
%2 = alloca %struct.iw_request_info*
store %struct.iw_request_info* %0, %struct.iw_request_info** %2
%3 = load i32, i32* @IW_EV_POINT_LEN
ret i32 %3
}

LLVM IR (-O2):
%struct.iw_request_info = type { i32 }
@IW_EV_POINT_LEN = global i32 0
define i32 @iwe_stream_point_len(%struct.iw_request_info* nocapture readnone %0) {
%2 = load i32, i32* @IW_EV_POINT_LEN
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(int argc, char *argv[]) {
  printf("If I had more time, \n");
  write(STDOUT_FILENO, "I would have written you a shorter letter.\n", 43);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    $0x2b,%edx
call   1030 <write@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
mov    $0x2b,%edx
call   1040 <write@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"If I had more time, \0A\00"
@STDOUT_FILENO = global i32 0
@.str.1 = [44 x i8] c"I would have written you a shorter letter.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 43)
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str.1 = [44 x i8] c"I would have written you a shorter letter.\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [21 x i8] c"If I had more time, \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @STDOUT_FILENO
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 43)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}
unsigned int symhash(char *sym) {
  unsigned int hash = 0;
  unsigned int c;
  while (c = *sym++)
    hash = hash * 9 ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<symhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113c <symhash+0x3c>
imul   $0x9,-0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <symhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <symhash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,8),%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <symhash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @symhash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i32, i32* %3
%13 = mul i32 %12, 9
%14 = load i32, i32* %4
%15 = xor i32 %13, %14
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @symhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 9
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
AX0RX1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((((signed char *)10000000)[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movsbl (%rax,%rcx,1),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     114b <AX0RX1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <AX0RX1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0RX1>:
movslq %edx,%rax
mov    0x989680(%rax),%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,1),%dl
setle  %al
ret

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

LLVM IR (-O2):
define i32 @AX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = load i8, i8* %11
%13 = icmp sle i8 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
void usage(const char *filepath) {
  error(1, 0,
        "Usage: %s [-Grtv] [-b addr] [-p port] [-l pktlen] [-n packetnr] [-S "
        "gsosize]",
        filepath);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
lea    0xed2(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: %s [-Grtv] [-b addr] [-p port] [-l pktlen] [-n packetnr] [-S gsosize]\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: %s [-Grtv] [-b addr] [-p port] [-l pktlen] [-n packetnr] [-S gsosize]\00"
define void @usage(i8* %0) {
%2 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int sigaction(int signum, const struct sigaction *act,
              struct sigaction *oldact) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<sigaction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction*
%6 = alloca %struct.sigaction*
store i32 %0, i32* %4
store %struct.sigaction* %1, %struct.sigaction** %5
store %struct.sigaction* %2, %struct.sigaction** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sigaction(i32 %0, %struct.sigaction* nocapture readnone %1, %struct.sigaction* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n\nHello! Do you want a Caesar salad?\nHo Ho Ho.\n\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0A\0AHello! Do you want a Caesar salad?\0AHo Ho Ho.\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"\0A\0AHello! Do you want a Caesar salad?\0AHo Ho Ho.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void demo() {
  char c = 1;
  char str[10];
  for (int i = 0; i < 10; i++) {
    str[i] = (char)1;
  }
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<demo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1144 <demo+0x34>
movslq -0x10(%rbp),%rax
movb   $0x1,-0xb(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <demo+0x13>
lea    -0xb(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<demo>:
sub    $0x18,%rsp
movabs $0x101010101010101,%rax
01 01 01
mov    %rax,0x8(%rsp)
movw   $0x101,0x10(%rsp)
lea    0xecf(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @demo() {
%1 = alloca i8
%2 = alloca [10 x i8]
%3 = alloca i32
store i8 1, i8* %1
store i32 0, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %9
store i8 1, i8* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @demo() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
double __uniform__();
int THRandom_bernoulli(double p) { return (__uniform__() <= p); }


x86 assembly (clang, -O0):
<THRandom_bernoulli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__uniform__@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<THRandom_bernoulli>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <__uniform__@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @THRandom_bernoulli(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__uniform__()
%4 = load double, double* %2
%5 = fcmp ole double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @THRandom_bernoulli(double %0) {
%2 = tail call double (...) @__uniform__()
%3 = fcmp ole double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned long page_to_phys(struct page *page) {
  assert(0);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.page = type { i32 }
define i64 @page_to_phys(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = call i32 @assert(i32 0)
ret i64 0
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i64 @page_to_phys(%struct.page* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i64 0
}
/* Variables and functions */
int glGetError();
int /*<<< orphan*/ printf(char *, int);
void err(void) { printf("error=%#x\n", glGetError()); }


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <glGetError@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<err>:
push   %rax
xor    %eax,%eax
call   1040 <glGetError@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"error=%#x\0A\00"
define void @err() {
%1 = tail call i32 (...) @glGetError()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ary;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int volume(int *, int);
int main(int argc, char *argv[]) {
  int ary[] = {2, 5, 1, 2, 3, 4, 7, 7, 6};
  printf("%d\n", volume(ary, sizeof(ary) / sizeof(int)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1030 <volume@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1030 <volume@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.ary = [9 x i32] [i32 2, i32 5, i32 1, i32 2, i32 3, i32 4, i32 7, i32 7, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [9 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [9 x i32]* %5 to i8*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %5, i64 0, i64 0
%8 = call i32 @volume(i32* %7, i32 9)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.ary = [9 x i32] [i32 2, i32 5, i32 1, i32 2, i32 3, i32 4, i32 7, i32 7, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = bitcast [9 x i32]* %3 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%6 = call i32 @volume(i32* %5, i32 9)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
int read_s16_be(unsigned char *buf) {
  unsigned tmp = (((buf)[0] << 8) + ((buf)[1]));
  int ret;
  if (tmp > 0x7FFF) {
    ret = -((int)0x10000 - (int)tmp);
  } else {
    ret = (int)tmp;
  }
  return ret;
}


x86 assembly (clang, -O0):
<read_s16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7fff,-0xc(%rbp)
jbe    1140 <read_s16_be+0x40>
mov    $0x10000,%ecx
sub    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <read_s16_be+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_s16_be>:
movzwl (%rdi),%ecx
shl    $0x10,%ecx
bswap  %ecx
lea    -0x10000(%rcx),%eax
cmp    $0x8000,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @read_s16_be(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add nsw i32 %9, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp ugt i32 %15, 32767
br i1 %16, label %17, label %21
17: ; preds = %1
%18 = load i32, i32* %3
%19 = sub nsw i32 65536, %18
%20 = sub nsw i32 0, %19
store i32 %20, i32* %4
br label %23
21: ; preds = %1
%22 = load i32, i32* %3
store i32 %22, i32* %4
br label %23
23: ; preds = %21, %17
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @read_s16_be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
%9 = icmp ugt i32 %8, 32767
%10 = or i32 %8, -65536
%11 = select i1 %9, i32 %10, i32 %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x78() {
  Assert_real((isascii(120)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              605, ("isascii should be 1 for x"));
}


x86 assembly (clang, -O0):
<t_isascii_0x78>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x25d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x78>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x25d,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for x\00"
define void @t_isascii_0x78() {
%1 = call i32 @isascii(i32 120)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for x\00"
define void @t_isascii_0x78() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 605, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int write_bsf(char *bsf) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @write_bsf(i8* nocapture readnone %0) {
ret i32 0
}
double JHKeyframeAnimationFunctionEaseInQuint(double t, double b, double c,
                                              double d) {
  return c * (t /= d) * t * t * t * t + b;
}


x86 assembly (clang, -O0):
<JHKeyframeAnimationFunctionEaseInQuint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<JHKeyframeAnimationFunctionEaseInQuint>:
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @JHKeyframeAnimationFunctionEaseInQuint(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = load double, double* %5
%12 = fdiv double %11, %10
store double %12, double* %5
%13 = fmul double %9, %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = load double, double* %5
%17 = fmul double %15, %16
%18 = load double, double* %5
%19 = fmul double %17, %18
%20 = load double, double* %5
%21 = load double, double* %6
%22 = call double @llvm.fmuladd.f64(double %19, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @JHKeyframeAnimationFunctionEaseInQuint(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = fmul double %5, %2
%7 = fmul double %5, %6
%8 = fmul double %5, %7
%9 = fmul double %5, %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %5, double %1)
ret double %10
}
/* Type definitions */
struct bitmask {
  struct bitmask *maskp;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bitmask *);
void rt_bitmask_free(struct bitmask *mask) {
  free(mask->maskp);
  free(mask);
}


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

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

LLVM IR (-O0):
%struct.bitmask = type { %struct.bitmask* }
define void @rt_bitmask_free(%struct.bitmask* %0) {
%2 = alloca %struct.bitmask*
store %struct.bitmask* %0, %struct.bitmask** %2
%3 = load %struct.bitmask*, %struct.bitmask** %2
%4 = getelementptr inbounds %struct.bitmask, %struct.bitmask* %3, i32 0, i32 0
%5 = load %struct.bitmask*, %struct.bitmask** %4
%6 = call i32 @free(%struct.bitmask* %5)
%7 = load %struct.bitmask*, %struct.bitmask** %2
%8 = call i32 @free(%struct.bitmask* %7)
ret void
}

LLVM IR (-O2):
%struct.bitmask = type { %struct.bitmask* }
define void @rt_bitmask_free(%struct.bitmask* nocapture %0) {
%2 = getelementptr inbounds %struct.bitmask, %struct.bitmask* %0, i64 0, i32 0
%3 = load %struct.bitmask*, %struct.bitmask** %2
%4 = tail call i32 @free(%struct.bitmask* %3)
%5 = tail call i32 @free(%struct.bitmask* %0)
ret void
}
/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ write_error();
void printline(const char *line) {
  if (fprintf(stdout, "%s\n", line) < 0) {
    write_error();
  }
}


x86 assembly (clang, -O0):
<printline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    1156 <printline+0x36>
mov    $0x0,%al
call   1040 <write_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printline>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
test   %rax,%rax
js     1140 <printline+0x20>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_error@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @printline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i64 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @write_error()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @printline(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @write_error()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char *s) { printf("%s\n", s); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void g_object_set_data() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @barrier() {
ret void
}
/* Variables and functions */
char determine_letter_grade(double);
double get_percentage();
int /*<<< orphan*/ printf(char *, double, char);
int main(void) {
  double percentage = 0.0;
  char letter_grade = '\0';
  percentage = get_percentage();
  letter_grade = determine_letter_grade(percentage);
  printf("For percentage %.2lf, the letter grade is %c.\n", percentage,
         letter_grade);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    $0x0,%al
call   1040 <get_percentage@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <determine_letter_grade@plt>
mov    %al,-0x11(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe90(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <get_percentage@plt>
movsd  %xmm0,(%rsp)
call   1050 <determine_letter_grade@plt>
movsbl %al,%esi
lea    0xeb4(%rip),%rdi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"For percentage %.2lf, the letter grade is %c.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i8
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store i8 0, i8* %3
%4 = call double (...) @get_percentage()
store double %4, double* %2
%5 = load double, double* %2
%6 = call signext i8 @determine_letter_grade(double %5)
store i8 %6, i8* %3
%7 = load double, double* %2
%8 = load i8, i8* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %7, i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"For percentage %.2lf, the letter grade is %c.\0A\00"
define i32 @main() {
%1 = tail call double (...) @get_percentage()
%2 = tail call signext i8 @determine_letter_grade(double %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %1, i8 signext %2)
ret i32 0
}
void Init_libbel() {}


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

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

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

LLVM IR (-O2):
define void @Init_libbel() {
ret void
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int test_manual_help_cmd_parser2(int, char **, struct gengetopt_args_info *,
                                 int /*<<< orphan*/, int, int);
int test_manual_help_cmd_parser(int argc, char **argv,
                                struct gengetopt_args_info *args_info) {
  return test_manual_help_cmd_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<test_manual_help_cmd_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <test_manual_help_cmd_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_manual_help_cmd_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <test_manual_help_cmd_parser2@plt>

LLVM IR (-O0):
%struct.gengetopt_args_info = type { i32 }
define i32 @test_manual_help_cmd_parser(i32 %0, i8** %1, %struct.gengetopt_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.gengetopt_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.gengetopt_args_info* %2, %struct.gengetopt_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %6
%10 = call i32 @test_manual_help_cmd_parser2(i32 %7, i8** %8, %struct.gengetopt_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
define i32 @test_manual_help_cmd_parser(i32 %0, i8** %1, %struct.gengetopt_args_info* %2) {
%4 = tail call i32 @test_manual_help_cmd_parser2(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PrintVersion() {
  printf("*** ZZIP "
         "v0.36c (04-Jun-2001)"
         ", yet another block-sorting compressor.\n"
         "*** Copyright (c)2001 Damien Debin, all rights reserved.\n");
}


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

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

LLVM IR (-O0):
@.str = [127 x i8] c"*** ZZIP v0.36c (04-Jun-2001), yet another block-sorting compressor.\0A*** Copyright (c)2001 Damien Debin, all rights reserved.\0A\00"
define void @PrintVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [126 x i8] c"*** ZZIP v0.36c (04-Jun-2001), yet another block-sorting compressor.\0A*** Copyright (c)2001 Damien Debin, all rights reserved.\00"
define void @PrintVersion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([126 x i8], [126 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dc_clean_stack();
void dc_start_everything() { dc_clean_stack(); }


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

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

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

LLVM IR (-O2):
define void @dc_start_everything() {
%1 = tail call i32 (...) @dc_clean_stack()
ret void
}
int Cyc_Core_ptrcmp(void *a, void *b) {
  if (a == b)
    return 0;
  if (a > b)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<Cyc_Core_ptrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <Cyc_Core_ptrcmp+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1147 <Cyc_Core_ptrcmp+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1140 <Cyc_Core_ptrcmp+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <Cyc_Core_ptrcmp+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Core_ptrcmp>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
seta   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Cyc_Core_ptrcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = icmp ugt i8* %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %16
15: ; preds = %10
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @Cyc_Core_ptrcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ stack_dir1();
int main(void) {
  printf("Approach 1: The stack grows %s\n", stack_dir1() ? "up" : "down");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <stack_dir1@plt>
mov    %rax,%rcx
lea    0xeee(%rip),%rsi
lea    0xee4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <stack_dir1@plt>
test   %rax,%rax
lea    0xef1(%rip),%rax
lea    0xee7(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Approach 1: The stack grows %s\0A\00"
@.str.1 = [3 x i8] c"up\00"
@.str.2 = [5 x i8] c"down\00"
define i32 @main() {
%1 = call i64 (...) @stack_dir1()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Approach 1: The stack grows %s\0A\00"
@.str.1 = [3 x i8] c"up\00"
@.str.2 = [5 x i8] c"down\00"
define i32 @main() {
%1 = tail call i64 (...) @stack_dir1()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TPM2_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void TPM2_IRQHandler(void) {
  TPM2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @TPM2_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @TPM2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @TPM2_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @TPM2_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ write(int, char const *, size_t);
int __stdio_outs(const char *s, size_t len) {
  return (write(1, s, len) == (ssize_t)len) ? 1 : 0;
}


x86 assembly (clang, -O0):
<__stdio_outs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdio_outs>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__stdio_outs(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @write(i32 1, i8* %5, i64 %6)
%8 = load i64, i64* %4
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @__stdio_outs(i8* nocapture %0, i64 %1) {
%3 = tail call i64 @write(i32 1, i8* %0, i64 %1)
%4 = icmp eq i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_0Bint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x0B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Bint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0xb,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Bint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 720896
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void compaction_unregister_node(struct node *node) {}


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

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

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

LLVM IR (-O2):
%struct.node = type opaque
define void @compaction_unregister_node(%struct.node* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void psemDestroy(int *s) {
  close(s[0]);
  close(s[1]);
}


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

x86 assembly (clang, -O2):
<psemDestroy>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @psemDestroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
define void @psemDestroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @close(i32 %5)
ret void
}