xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pprint(char *, int);
int printenv(char **environ) {
  int i;
  i = 0;
  while (environ[i]) {
    pprint(environ[i], 1);
    pprint("\n", 1);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<printenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     116b <printenv+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x1,%esi
call   1030 <pprint@plt>
lea    0xead(%rip),%rdi
mov    $0x1,%esi
call   1030 <pprint@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printenv+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printenv>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1153 <printenv+0x43>
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    $0x1,%esi
call   1030 <pprint@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <pprint@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <printenv+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @printenv(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %2, %1 ]
%7 = tail call i32 @pprint(i8* %6, i32 1)
%8 = tail call i32 @pprint(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LDA_();
int /*<<< orphan*/ c64_memIndirectZeroY();
void LDA_izy(void) {
  c64_memIndirectZeroY();
  LDA_();
}


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

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

LLVM IR (-O0):
define void @LDA_izy() {
%1 = call i32 (...) @c64_memIndirectZeroY()
%2 = call i32 (...) @LDA_()
ret void
}

LLVM IR (-O2):
define void @LDA_izy() {
%1 = tail call i32 (...) @c64_memIndirectZeroY()
%2 = tail call i32 (...) @LDA_()
ret void
}
int hex_digits(unsigned width) { return (width + 3) / 4; }


x86 assembly (clang, -O0):
<hex_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
shr    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_digits>:
lea    0x3(%rdi),%eax
shr    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @hex_digits(i32 %0) {
%2 = add i32 %0, 3
%3 = lshr i32 %2, 2
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xresizerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xresizerequest_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xresizerequest.send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xresizerequest_send_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xresizerequest_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xresizerequest_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xresizerequest_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ writeError(int);
void robotConfigPcCheckSpace(FILE *filePointer) {
  char c = fgetc(filePointer);
  if (c != ' ') {
    writeError(0x6301);
  }
}


x86 assembly (clang, -O0):
<robotConfigPcCheckSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     114f <robotConfigPcCheckSpace+0x2f>
mov    $0x6301,%edi
call   1040 <writeError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<robotConfigPcCheckSpace>:
push   %rax
call   1030 <fgetc@plt>
cmp    $0x20,%al
jne    112c <robotConfigPcCheckSpace+0xc>
pop    %rax
ret
mov    $0x6301,%edi
pop    %rax
jmp    1040 <writeError@plt>

LLVM IR (-O0):
define void @robotConfigPcCheckSpace(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 32
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @writeError(i32 25345)
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @robotConfigPcCheckSpace(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = icmp eq i8 %2, 32
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @writeError(i32 25345)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloca(int);
void prefix_foo(int x) { alloca(x); }


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

x86 assembly (clang, -O2):
<prefix_foo>:
jmp    1030 <alloca@plt>

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

LLVM IR (-O2):
define void @prefix_foo(i32 %0) {
%2 = tail call i32 @alloca(i32 %0)
ret void
}
int check_error4(char *input, int *error) {
  int count = 0;
  for (int i = 0; i < 5; i++) {
    if (error[i] == 1)
      count++;
  }
  if (count > 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_error4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jge    1152 <check_error4+0x52>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    113f <check_error4+0x3f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1144 <check_error4+0x44>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111a <check_error4+0x1a>
cmpl   $0x1,-0x1c(%rbp)
jle    1168 <check_error4+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <check_error4+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_error4>:
xor    %eax,%eax
cmpl   $0x1,0x10(%rsi)
movdqu (%rsi),%xmm0
sete   %al
pcmpeqd 0xeeb(%rip),%xmm0
movmskps %xmm0,%ecx
mov    %ecx,%edx
shr    %dl
and    $0x5,%dl
sub    %dl,%cl
mov    %ecx,%edx
and    $0x33,%dl
shr    $0x2,%cl
and    $0x33,%cl
add    %dl,%cl
mov    %ecx,%edx
shr    $0x4,%dl
add    %cl,%dl
and    $0xf,%dl
movzbl %dl,%ecx
add    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @check_error4(i8* nocapture readnone %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = icmp eq <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1>
%6 = getelementptr inbounds i32, i32* %1, i64 4
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = bitcast <4 x i1> %5 to i4
%11 = call i4 @llvm.ctpop.i4(i4 %10)
%12 = zext i4 %11 to i32
%13 = add nuw nsw i32 %12, %9
%14 = icmp ugt i32 %13, 1
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                int);
int /*<<< orphan*/ glFlush();
void draw(void) {
  glClearColor(0, 1, 0, 1);
  glClear(GL_COLOR_BUFFER_BIT);
  glFlush();
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1040 <glClearColor@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <glClearColor@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @draw() {
%1 = call i32 @glClearColor(i32 0, i32 1, i32 0, i32 1)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = call i32 @glClear(i32 %2)
%4 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @draw() {
%1 = tail call i32 @glClearColor(i32 0, i32 1, i32 0, i32 1)
%2 = load i32, i32* @GL_COLOR_BUFFER_BIT
%3 = tail call i32 @glClear(i32 %2)
%4 = tail call i32 (...) @glFlush()
ret void
}
void init_guard_brd(int fV[((21 + 2) * (21 + 2))]) {
  int j;
  for (j = 0; j < ((21 + 2) * (21 + 2)); j++)
    fV[j] = 0;
}


x86 assembly (clang, -O0):
<init_guard_brd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x211,-0xc(%rbp)
jge    1139 <init_guard_brd+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_guard_brd+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_guard_brd>:
push   %rax
mov    $0x844,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @init_guard_brd(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void draw_head(int c, int s) {
  for (int i = 0; i < c * (s + 1); ++i) {
    printf("*");
  }
  printf("*\n");
}


x86 assembly (clang, -O0):
<draw_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
cmp    %ecx,%eax
jge    1156 <draw_head+0x46>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <draw_head+0x15>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_head>:
push   %rbx
mov    %esi,%ebx
add    $0x1,%ebx
imul   %edi,%ebx
test   %ebx,%ebx
jle    113f <draw_head+0x1f>
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <draw_head+0x10>
lea    0xeba(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"*\00"
define void @draw_head(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = mul i32 %3, %0
%5 = icmp sgt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %8, %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ 0, %2 ]
%10 = tail call i32 @putchar(i32 42)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, %4
br i1 %12, label %6, label %8
}
/* Variables and functions */
void *realloc(void *, size_t);
void *mm_block_realloc(void *ptr, size_t size) { return realloc(ptr, size); }


x86 assembly (clang, -O0):
<mm_block_realloc>:
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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_block_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @mm_block_realloc(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 i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @mm_block_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EMACTxEnable(uint32_t ui32Base) {
  (*((volatile uint32_t *)(ui32Base + 0x00000C18))) |= 0x00002000;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) |= 0x00000008;
}


x86 assembly (clang, -O0):
<EMACTxEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc18,%eax
cltq
mov    (%rax),%ecx
or     $0x2000,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x8,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTxEnable>:
movslq %edi,%rax
orl    $0x2000,0xc18(%rax)
orl    $0x8,(%rax)
ret

LLVM IR (-O0):
define void @EMACTxEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3096
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 8192
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 0
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = or i32 %13, 8
store volatile i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @EMACTxEnable(i32 %0) {
%2 = add nsw i32 %0, 3096
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 8192
store volatile i32 %6, i32* %4
%7 = sext i32 %0 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = or i32 %9, 8
store volatile i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strleng(char *);
int main(void) {
  char *string = "aa\n";
  printf("%d", strleng(string));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strleng@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strleng@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"aa\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @strleng(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
int ubi_dbg_is_write_failure(const struct ubi_device *ubi) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubi_device = type opaque
define i32 @ubi_dbg_is_write_failure(%struct.ubi_device* nocapture readnone %0) {
ret i32 0
}
void g_async_queue_unlock() {}


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

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

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

LLVM IR (-O2):
define void @g_async_queue_unlock() {
ret void
}
double kelvinToCelsius(double kelvin) { return (kelvin - 273.15); }


x86 assembly (clang, -O0):
<kelvinToCelsius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kelvinToCelsius>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @kelvinToCelsius(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 2.731500e+02
ret double %4
}

LLVM IR (-O2):
define double @kelvinToCelsius(double %0) {
%2 = fadd double %0, -2.731500e+02
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ count_int();
int /*<<< orphan*/ rand_int();
int /*<<< orphan*/ rand_int_add();
int /*<<< orphan*/ random_cast_double();
int main() {
  random_cast_double();
  rand_int();
  count_int();
  rand_int_add();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <random_cast_double@plt>
mov    $0x0,%al
call   1060 <rand_int@plt>
mov    $0x0,%al
call   1050 <count_int@plt>
mov    $0x0,%al
call   1030 <rand_int_add@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <random_cast_double@plt>
xor    %eax,%eax
call   1060 <rand_int@plt>
xor    %eax,%eax
call   1050 <count_int@plt>
xor    %eax,%eax
call   1030 <rand_int_add@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @random_cast_double()
%3 = call i32 (...) @rand_int()
%4 = call i32 (...) @count_int()
%5 = call i32 (...) @rand_int_add()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @random_cast_double()
%2 = tail call i32 (...) @rand_int()
%3 = tail call i32 (...) @count_int()
%4 = tail call i32 (...) @rand_int_add()
ret i32 0
}
int main() {
  char a[10];
  a[10] = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int foo(void) {
  static int foo = 0;
  __asm__ __volatile__("" : : : "memory");
  foo++;
  return foo;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
mov    0x2f0b(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@foo.foo = internal global i32 0
define i32 @foo() {
%1 = load i32, i32* @foo.foo
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.foo
%3 = load i32, i32* @foo.foo
ret i32 %3
}

LLVM IR (-O2):
@foo.foo = internal unnamed_addr global i32 0
define i32 @foo() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%1 = load i32, i32* @foo.foo
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.foo
ret i32 %2
}
/* Variables and functions */
char *strdup2(char *);
char *get_program_path() { return strdup2("./lick-fltk"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"./lick-fltk\00"
define i8* @get_program_path() {
%1 = call i8* @strdup2(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"./lick-fltk\00"
define i8* @get_program_path() {
%1 = tail call i8* @strdup2(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void report_gesture_data(struct ssp_data *data, struct sensor_value *ges) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_gesture_data(%struct.ssp_data* %0, %struct.sensor_value* %1) {
%3 = alloca %struct.ssp_data*
%4 = alloca %struct.sensor_value*
store %struct.ssp_data* %0, %struct.ssp_data** %3
store %struct.sensor_value* %1, %struct.sensor_value** %4
ret void
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_gesture_data(%struct.ssp_data* nocapture %0, %struct.sensor_value* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void jc_print() { printf("Hello from jc_print\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello from jc_print\00"
define void @jc_print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void BN_sub_word(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_sub_word() {
ret void
}
int ddsGetAlphaMask(unsigned const char *buffer) {
  return (buffer[104] & 0xFF) | (buffer[105] & 0xFF) << 8 |
         (buffer[106] & 0xFF) << 16 | (buffer[107] & 0xFF) << 24;
}


x86 assembly (clang, -O0):
<ddsGetAlphaMask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x68(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x69(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6a(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6b(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddsGetAlphaMask>:
mov    0x68(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ddsGetAlphaMask(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 104
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 105
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 106
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 107
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ test_gameobj();
scalar_t__ test_score_io();
int main(int argc, char *argv[]) {
  printf("BugWorld Unit Tests\n");
  do {
    if (test_score_io())
      return 1;
  } while (0);
  do {
    if (test_gameobj())
      return 1;
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_score_io@plt>
cmp    $0x0,%rax
je     116f <main+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <main+0x72>
jmp    1174 <main+0x44>
jmp    1179 <main+0x49>
mov    $0x0,%al
call   1050 <test_gameobj@plt>
cmp    $0x0,%rax
je     1196 <main+0x66>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <main+0x72>
jmp    119b <main+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_score_io@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1153 <main+0x23>
pop    %rcx
ret
xor    %eax,%eax
call   1050 <test_gameobj@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"BugWorld Unit Tests\0A\00"
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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2
%8 = call i64 (...) @test_score_io()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %3
br label %19
11: ; preds = %7
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
%14 = call i64 (...) @test_gameobj()
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %3
br label %19
17: ; preds = %13
br label %18
18: ; preds = %17
store i32 0, i32* %3
br label %19
19: ; preds = %18, %16, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str = [20 x i8] c"BugWorld Unit Tests\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i64 (...) @test_score_io()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 (...) @test_gameobj()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 1, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x12() {
  Assert_real((isbdigit(18) == 0),
              "/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_isbdigit.c",
              95, ("isbdigit should be 0 for 0x12"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x12>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x5f,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x12>:
push   %rax
mov    $0x12,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x5f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x12\00"
define void @t_isbdigit_0x12() {
%1 = call i64 @isbdigit(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x12\00"
define void @t_isbdigit_0x12() {
%1 = tail call i64 @isbdigit(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cos(double);
double hamming(int n, int N) {
  return (0.54 - 0.46 * cos(2.0 * 3.14 * (double)n / (double)(N - 1)));
}


x86 assembly (clang, -O0):
<hamming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movsd  0xeb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
add    $0xffffffff,%esi
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
mulsd  0xed3(%rip),%xmm0
addsd  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hamming(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fmul double 6.280000e+00, %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = fdiv double %7, %10
%12 = call double @cos(double %11)
%13 = call double @llvm.fmuladd.f64(double -4.600000e-01, double %12, double 5.400000e-01)
ret double %13
}

LLVM IR (-O2):
define double @hamming(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 6.280000e+00
%5 = add nsw i32 %1, -1
%6 = sitofp i32 %5 to double
%7 = fdiv double %4, %6
%8 = tail call double @cos(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %8, double -4.600000e-01, double 5.400000e-01)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int num1, num2;
  scanf("%d %d", &num1, &num2);
  int sum = num1 + num2;
  printf("%d\n", sum);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ trace_2();
void trace_1() { trace_2(); }


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

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

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

LLVM IR (-O2):
define void @trace_1() {
%1 = tail call i32 (...) @trace_2()
ret void
}
void baz(void) {
  int *p;
  int l;
  p = &l;
  *p = 1;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @baz() {
%1 = alloca i32*
%2 = alloca i32
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @baz() {
ret void
}
/* Type definitions */
typedef int uint16_t;
struct m6800 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ m6800_push(struct m6800 *, int);
void m6800_push16(struct m6800 *cpu, uint16_t val) {
  m6800_push(cpu, val);
  m6800_push(cpu, val >> 8);
}


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

x86 assembly (clang, -O2):
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <m6800_push@plt>
sar    $0x8,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <m6800_push@plt>

LLVM IR (-O0):
%struct.m6800 = type { i32 }
define void @m6800_push16(%struct.m6800* %0, i32 %1) {
%3 = alloca %struct.m6800*
%4 = alloca i32
store %struct.m6800* %0, %struct.m6800** %3
store i32 %1, i32* %4
%5 = load %struct.m6800*, %struct.m6800** %3
%6 = load i32, i32* %4
%7 = call i32 @m6800_push(%struct.m6800* %5, i32 %6)
%8 = load %struct.m6800*, %struct.m6800** %3
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = call i32 @m6800_push(%struct.m6800* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.m6800 = type { i32 }
define void @m6800_push16(%struct.m6800* %0, i32 %1) {
%3 = tail call i32 @m6800_push(%struct.m6800* %0, i32 %1)
%4 = ashr i32 %1, 8
%5 = tail call i32 @m6800_push(%struct.m6800* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ send(int, void const *, size_t, int);
ssize_t Send(int sockfd, const void *buf, size_t len, int flags) {
  ssize_t rc;
  if ((rc = send(sockfd, buf, len, flags)) < 0) {
    perror("send");
    exit(1);
  }
  return (rc);
}


x86 assembly (clang, -O0):
<Send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <send@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    117b <Send+0x4b>
lea    0xe94(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Send>:
push   %rax
call   1030 <send@plt>
test   %eax,%eax
js     113c <Send+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"send\00"
define i32 @Send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i32, i32* %8
%14 = call i32 @send(i32 %10, i8* %11, i64 %12, i32 %13)
store i32 %14, i32* %9
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %4
%20 = load i32, i32* %9
ret i32 %20
}

LLVM IR (-O2):
@.str = [5 x i8] c"send\00"
define i32 @Send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret i32 %5
}
/* Variables and functions */
void aligned_main(int, char **);
void startup(int argc, char *argv[]) { return aligned_main(argc, argv); }


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

x86 assembly (clang, -O2):
<startup>:
jmp    1030 <aligned_main@plt>

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

LLVM IR (-O2):
define void @startup(i32 %0, i8** %1) {
tail call void @aligned_main(i32 %0, i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void RunCommand(char *buf) { system(buf); }


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

x86 assembly (clang, -O2):
<RunCommand>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define void @RunCommand(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret void
}
int __attribute__((target("sse4.2"))) foo(int i) { return 0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
char *ext_pos(char const *);
int find_decoder(char *, char const *, char **);
int /*<<< orphan*/ free(char *);
int find_type(const char *file) {
  int result = -1;
  char *extn, *mime;
  extn = ext_pos(file);
  mime = NULL;
  result = find_decoder(extn, file, &mime);
  free(mime);
  return result;
}


x86 assembly (clang, -O0):
<find_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ext_pos@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <find_decoder@plt>
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_type>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <ext_pos@plt>
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <find_decoder@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @find_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
store i32 -1, i32* %3
%6 = load i8*, i8** %2
%7 = call i8* @ext_pos(i8* %6)
store i8* %7, i8** %4
store i8* null, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %2
%10 = call i32 @find_decoder(i8* %8, i8* %9, i8** %5)
store i32 %10, i32* %3
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @find_type(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = tail call i8* @ext_pos(i8* %0)
store i8* null, i8** %2
%5 = call i32 @find_decoder(i8* %4, i8* %0, i8** %2)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
ret i32 %5
}
/* Variables and functions */
float sqrtf(float);
float dtMathSqrtf(float x) { return sqrtf(x); }


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

x86 assembly (clang, -O2):
<dtMathSqrtf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <dtMathSqrtf+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @dtMathSqrtf(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
int convert(int n) {
  if (n == 0 || n == 1)
    return n;
  else
    return n % 10 + convert(n / 10) * 2;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <convert+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113a <convert+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <convert+0x55>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <convert@plt>
mov    -0xc(%rbp),%edx
shl    $0x1,%eax
add    %eax,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%edi
jbe    113f <convert+0x2f>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
lea    (%rdi,%rdi,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
call   1030 <convert@plt>
lea    (%rbx,%rax,2),%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @convert(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ %0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = srem i32 %0, 10
%7 = sdiv i32 %0, 10
%8 = tail call i32 @convert(i32 %7)
%9 = shl nsw i32 %8, 1
%10 = add nsw i32 %9, %6
br label %3
}
/* Variables and functions */
unsigned long strlen(char const *);
long unsigned int mystrlen(const char *s) {
  if (!s)
    s = "";
  return strlen(s);
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <mystrlen+0x22>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i64 @mystrlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
ret i64 %8
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i64 @mystrlen(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
ret i64 %4
}