xunge/DecIR huggingface dataset:
int abs(int i) {
  if (i < 0)
    return -i;
  else
    return i;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int xGL(int cF, int TwQ_, int y8zj, int kdlK, int OQov, int Sndq) {
  int p842;
  int Ip;
}


x86 assembly (clang, -O0):
<xGL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xGL(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @xGL(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i32 undef
}
int dummy02(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @dummy02(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
int /*<<< orphan*/ strncat(char *, char const *, int);
char *append(const char *a, const char *b) {
  char *c = malloc((strlen(a) + strlen(b) + 1) * sizeof(char));
  strcpy(c, a);
  strncat(c, b, strlen(b));
  return c;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1050 <strncat@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r12,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   1050 <strncat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @append(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %7, %9
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i8* @malloc(i32 %14)
store i8* %15, i8** %5
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %5
%20 = load i8*, i8** %4
%21 = load i8*, i8** %4
%22 = call i32 @strlen(i8* %21)
%23 = call i32 @strncat(i8* %19, i8* %20, i32 %22)
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @append(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i8* @malloc(i32 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strlen(i8* %1)
%10 = tail call i32 @strncat(i8* %7, i8* %1, i32 %9)
ret i8* %7
}
pct(n) {
  unsigned rand();
  register r;
  r = (rand() >> 2) & 037777;
  return ((r % 100) < n);
}


x86 assembly (clang, -O0):
<pct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
shr    $0x2,%eax
and    $0x3fff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    -0x4(%rbp),%edx
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pct>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movzwl %ax,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
shr    $0x4,%eax
imul   $0x147b,%eax,%eax
shr    $0x11,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ecx
movzwl %cx,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setl   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
%5 = lshr i32 %4, 2
%6 = and i32 %5, 16383
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = srem i32 %7, 100
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @pct(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = trunc i32 %2 to i16
%4 = lshr i16 %3, 2
%5 = urem i16 %4, 100
%6 = zext i16 %5 to i32
%7 = icmp slt i32 %6, %0
%8 = zext i1 %7 to i32
ret i32 %8
}
void pci_set_master(struct pci_dev *dev) { return; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_set_master(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
size_t shift_right(void *f, unsigned short pass) {
  printf("%d\n", *(int *)f);
  return (size_t)((unsigned char)(*((unsigned int *)f) << pass * 8));
}


x86 assembly (clang, -O0):
<shift_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movzwl -0xa(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_right>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    (%r14),%eax
shl    $0x3,%ebx
mov    %ebx,%ecx
shl    %cl,%rax
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i64 @shift_right(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = mul nsw i32 %13, 8
%15 = shl i32 %11, %14
%16 = trunc i32 %15 to i8
%17 = zext i8 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i64 @shift_right(i8* nocapture %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = zext i16 %1 to i32
%8 = shl nuw nsw i32 %7, 3
%9 = shl i32 %6, %8
%10 = and i32 %9, 255
%11 = zext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int close(int);
int net_close(int sock) { return close(sock); }


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

x86 assembly (clang, -O2):
<net_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @net_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void gtk_text_iter_backward_visible_cursor_position() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_2_1_1_1() {
ret void
}
unsigned char convert_signed_char_to_unsigned_char(signed char x) { return x; }


x86 assembly (clang, -O0):
<convert_signed_char_to_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @convert_signed_char_to_unsigned_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @convert_signed_char_to_unsigned_char(i8 returned signext %0) {
ret i8 %0
}
/* Type definitions */
struct Global {
  int dummy;
};

/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *savestring(struct Global *global, char *text) {
  char *result;
  result = malloc(strlen(text) + 1);
  strcpy(result, text);
  return (result);
}


x86 assembly (clang, -O0):
<savestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.Global = type { i32 }
define i8* @savestring(%struct.Global* %0, i8* %1) {
%3 = alloca %struct.Global*
%4 = alloca i8*
%5 = alloca i8*
store %struct.Global* %0, %struct.Global** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.Global = type { i32 }
define i8* @savestring(%struct.Global* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ glDepthFunc(unsigned int);
void DepthFunc(unsigned int f) { glDepthFunc(f); }


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

x86 assembly (clang, -O2):
<DepthFunc>:
jmp    1030 <glDepthFunc@plt>

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

LLVM IR (-O2):
define void @DepthFunc(i32 %0) {
%2 = tail call i32 @glDepthFunc(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int *arr, int len) {
  int i;
  for (i = len / 2 - 1; i >= 0; i--) {
    max_heapify(arr, len, i);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <build_max_heap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_max_heap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <build_max_heap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %5, %4 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @max_heapify(i32* %0, i32 %1, i32 %8)
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_add(uintptr_t, uintptr_t, uintptr_t);
void fiat_p256_add(uint64_t out1[4], const uint64_t arg1[4],
                   const uint64_t arg2[4]) {
  internal_fiat_p256_add((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p256_add>:
jmp    1030 <internal_fiat_p256_add@plt>

LLVM IR (-O0):
define void @fiat_p256_add(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p256_add(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_add(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p256_add(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *const);
int flashrom_data_free(void *const p) {
  free(p);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @flashrom_data_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage_machine(void) {
  fprintf(stderr, "Valid machines are: 166, KA10, KI10, KL10, and KS10.\n");
  fprintf(stderr, "For KA/KL/KS, append ITS to get the MIT instructions.\n");
}


x86 assembly (clang, -O0):
<usage_machine>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xefd(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage_machine>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf07(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"Valid machines are: 166, KA10, KI10, KL10, and KS10.\0A\00"
@.str.1 = [55 x i8] c"For KA/KL/KS, append ITS to get the MIT instructions.\0A\00"
define void @usage_machine() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"Valid machines are: 166, KA10, KI10, KL10, and KS10.\0A\00"
@.str.1 = [55 x i8] c"For KA/KL/KS, append ITS to get the MIT instructions.\0A\00"
define void @usage_machine() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
void winit(struct timeval *t) { gettimeofday(t, (struct timezone *)0); }


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define void @winit(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define void @winit(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, %struct.timezone* null)
ret void
}
void MPURegionGet(unsigned long ulRegion, unsigned long *pulAddr,
                  unsigned long *pulFlags) {
  ;
  ;
  ;
  (*((volatile unsigned long *)(0xE000ED98))) = ulRegion;
  *pulAddr = (*((volatile unsigned long *)(0xE000ED9C)));
  *pulFlags = (*((volatile unsigned long *)(0xE000EDA0)));
}


x86 assembly (clang, -O0):
<MPURegionGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xe000ed98,%eax
mov    %rcx,(%rax)
mov    $0xe000ed9c,%eax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionGet>:
mov    $0xe000ed98,%eax
mov    %rdi,(%rax)
mov    0x4(%rax),%rcx
mov    %rcx,(%rsi)
mov    0x8(%rax),%rax
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
define void @MPURegionGet(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
store volatile i64 %7, i64* inttoptr (i64 3758157208 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 3758157212 to i64*)
%9 = load i64*, i64** %5
store i64 %8, i64* %9
%10 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%11 = load i64*, i64** %6
store i64 %10, i64* %11
ret void
}

LLVM IR (-O2):
define void @MPURegionGet(i64 %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
store volatile i64 %0, i64* inttoptr (i64 3758157208 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 3758157212 to i64*)
store i64 %4, i64* %1
%5 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
store i64 %5, i64* %2
ret void
}
/* Type definitions */
struct Graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ createGraph(struct Graph *, int, int);
void creator1(struct Graph *graph) {
  createGraph(graph, 0, 1);
  createGraph(graph, 0, 2);
  createGraph(graph, 1, 2);
  createGraph(graph, 2, 0);
  createGraph(graph, 2, 3);
  createGraph(graph, 3, 3);
}


x86 assembly (clang, -O0):
<creator1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <createGraph@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%edx
mov    %edx,%esi
call   1030 <createGraph@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creator1>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <createGraph@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
pop    %rbx
jmp    1030 <createGraph@plt>

LLVM IR (-O0):
%struct.Graph = type { i32 }
define void @creator1(%struct.Graph* %0) {
%2 = alloca %struct.Graph*
store %struct.Graph* %0, %struct.Graph** %2
%3 = load %struct.Graph*, %struct.Graph** %2
%4 = call i32 @createGraph(%struct.Graph* %3, i32 0, i32 1)
%5 = load %struct.Graph*, %struct.Graph** %2
%6 = call i32 @createGraph(%struct.Graph* %5, i32 0, i32 2)
%7 = load %struct.Graph*, %struct.Graph** %2
%8 = call i32 @createGraph(%struct.Graph* %7, i32 1, i32 2)
%9 = load %struct.Graph*, %struct.Graph** %2
%10 = call i32 @createGraph(%struct.Graph* %9, i32 2, i32 0)
%11 = load %struct.Graph*, %struct.Graph** %2
%12 = call i32 @createGraph(%struct.Graph* %11, i32 2, i32 3)
%13 = load %struct.Graph*, %struct.Graph** %2
%14 = call i32 @createGraph(%struct.Graph* %13, i32 3, i32 3)
ret void
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define void @creator1(%struct.Graph* %0) {
%2 = tail call i32 @createGraph(%struct.Graph* %0, i32 0, i32 1)
%3 = tail call i32 @createGraph(%struct.Graph* %0, i32 0, i32 2)
%4 = tail call i32 @createGraph(%struct.Graph* %0, i32 1, i32 2)
%5 = tail call i32 @createGraph(%struct.Graph* %0, i32 2, i32 0)
%6 = tail call i32 @createGraph(%struct.Graph* %0, i32 2, i32 3)
%7 = tail call i32 @createGraph(%struct.Graph* %0, i32 3, i32 3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t callback_callback(uint64_t x) { return x + 1; }


x86 assembly (clang, -O0):
<callback_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback_callback>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @callback_callback(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @callback_callback(i64 %0) {
%2 = add nsw i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int rand();
int end(int param1, char *param2) { return rand(); }


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

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

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

LLVM IR (-O2):
define i32 @end(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
ret i32 %3
}
void grib_set_bit_on(unsigned char *p, long *bitp) {
  p += *bitp / 8;
  *p |= (1u << (7 - ((*bitp) % 8)));
  (*bitp)++;
}


x86 assembly (clang, -O0):
<grib_set_bit_on>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    $0x7,%eax
sub    %rdx,%rax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_set_bit_on>:
mov    (%rsi),%rax
lea    0x7(%rax),%rdx
test   %rax,%rax
cmovns %rax,%rdx
sar    $0x3,%rdx
lea    0x0(,%rdx,8),%ecx
sub    %ecx,%eax
mov    $0x7,%cl
sub    %al,%cl
mov    $0x1,%eax
shl    %cl,%eax
or     %al,(%rdi,%rdx,1)
addq   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @grib_set_bit_on(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %5
%7 = sdiv i64 %6, 8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 %7
store i8* %9, i8** %3
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
%12 = srem i64 %11, 8
%13 = sub nsw i64 7, %12
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, %15
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
%21 = load i64*, i64** %4
%22 = load i64, i64* %21
%23 = add nsw i64 %22, 1
store i64 %23, i64* %21
ret void
}

LLVM IR (-O2):
define void @grib_set_bit_on(i8* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = sdiv i64 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = srem i64 %3, 8
%7 = trunc i64 %6 to i32
%8 = sub nsw i32 7, %7
%9 = shl nuw nsw i32 1, %8
%10 = load i8, i8* %5
%11 = trunc i32 %9 to i8
%12 = or i8 %10, %11
store i8 %12, i8* %5
%13 = load i64, i64* %1
%14 = add nsw i64 %13, 1
store i64 %14, i64* %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ ERR;
scalar_t__ erase();
uint8_t ccbi_erase() { return ((erase()) == ERR ? 0 : 1); }


x86 assembly (clang, -O0):
<ccbi_erase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <erase@plt>
mov    %rax,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccbi_erase>:
push   %rax
xor    %eax,%eax
call   1030 <erase@plt>
mov    0x2ec9(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ERR = global i64 0
define i32 @ccbi_erase() {
%1 = call i64 (...) @erase()
%2 = load i64, i64* @ERR
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 1
ret i32 %5
}

LLVM IR (-O2):
@ERR = global i64 0
define i32 @ccbi_erase() {
%1 = tail call i64 (...) @erase()
%2 = load i64, i64* @ERR
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
void Log(char *fmt, ...) { ; }


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

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

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

LLVM IR (-O2):
define void @Log(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void diff_precoder(uint8_t W, uint8_t Z, uint8_t *Xp, uint8_t *Yp) {
  uint8_t common, newX, newY;
  common = (Z & (*Xp ^ *Yp));
  newX = W ^ *Xp ^ common;
  newY = Z ^ W ^ *Yp ^ common;
  *Xp = newX;
  *Yp = newY;
}


x86 assembly (clang, -O0):
<diff_precoder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x18(%rbp),%rdx
xor    (%rdx),%ecx
and    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
xor    (%rcx),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    -0x18(%rbp),%rcx
xor    (%rcx),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_precoder>:
mov    (%rdx),%r9d
mov    (%rcx),%r8d
mov    %r8d,%eax
xor    %r9d,%eax
and    %esi,%eax
xor    %edi,%eax
xor    %eax,%r9d
xor    %r8d,%esi
xor    %eax,%esi
mov    %r9d,(%rdx)
mov    %esi,(%rcx)
ret

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

LLVM IR (-O2):
define void @diff_precoder(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = xor i32 %6, %5
%8 = and i32 %7, %1
%9 = xor i32 %8, %0
%10 = xor i32 %9, %5
%11 = xor i32 %9, %1
%12 = xor i32 %11, %6
store i32 %10, i32* %2
store i32 %12, i32* %3
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int bsearch_strcmp(const void *_a, const void *_b) {
  const char *a = _a;
  const char *b = *(const char **)_b;
  return strcmp(a, b);
}


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

x86 assembly (clang, -O2):
<bsearch_strcmp>:
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @bsearch_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @strcmp(i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @bsearch_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %4)
ret i32 %5
}
void null_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @null_resume() {
ret void
}
/* Variables and functions */
int __send_to_ppe(int, int, char const **);
int rmdir(const char *path) { return __send_to_ppe(0x2101, 37, &path); }


x86 assembly (clang, -O0):
<rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2101,%edi
mov    $0x25,%esi
lea    -0x8(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdx
mov    $0x2101,%edi
mov    $0x25,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 37, i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @rmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 37, i8** %2)
ret i32 %3
}
void ADC_RestoreConfig(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ChargeDelay_Stop() {
ret void
}
void trace(char *str, ...) {}


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

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

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

LLVM IR (-O2):
define void @trace(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_182(void) {
  if (*(uint32_t *)0x10000130ul == 0x6ul) {
    if (*(uint32_t *)0x10000134ul == 0x6ul) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_182>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x6,%rax
jne    1139 <errata_182+0x39>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x6,%rax
jne    1134 <errata_182+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_182+0x40>
jmp    1139 <errata_182+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_182>:
cmpl   $0x6,0x10000130
06
jne    1119 <errata_182+0x19>
mov    $0x1,%eax
cmpl   $0x6,0x10000134
06
je     111b <errata_182+0x1b>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @errata_182() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 6
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 6
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10, %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @errata_182() {
%1 = load i32, i32* inttoptr (i64 268435760 to i32*)
%2 = icmp eq i32 %1, 6
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 268435764 to i32*)
%5 = icmp eq i32 %4, 6
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("superimage: superimage.c libimage.so\n");
  printf("\tgcc -std=c11 -Wall -fmax-errors=10 -Wextra superimage.c "
         "libimage.so -o superimage\n");
  printf("libimage.so: libimage.c libimage.h\n");
  printf("\tgcc -std=c11 -Wall -fmax-errors=10 -Wextra -c libimage.c "
         "libimage.h -o libimage.so\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf54(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"superimage: superimage.c libimage.so\0A\00"
@.str.1 = [84 x i8] c"\09gcc -std=c11 -Wall -fmax-errors=10 -Wextra superimage.c libimage.so -o superimage\0A\00"
@.str.2 = [36 x i8] c"libimage.so: libimage.c libimage.h\0A\00"
@.str.3 = [85 x i8] c"\09gcc -std=c11 -Wall -fmax-errors=10 -Wextra -c libimage.c libimage.h -o libimage.so\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [37 x i8] c"superimage: superimage.c libimage.so\00"
@str.4 = [83 x i8] c"\09gcc -std=c11 -Wall -fmax-errors=10 -Wextra superimage.c libimage.so -o superimage\00"
@str.5 = [35 x i8] c"libimage.so: libimage.c libimage.h\00"
@str.6 = [84 x i8] c"\09gcc -std=c11 -Wall -fmax-errors=10 -Wextra -c libimage.c libimage.h -o libimage.so\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *strchr(char *, char);
void readline(FILE *f, char *s) {
  char *cp;
  if (NULL == fgets(s, 4096, f))
    *s = 0;
  else {
    cp = strchr(s, '\n');
    if (cp != NULL)
      *cp = 0;
  }
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1000,%esi
call   1040 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    115c <readline+0x3c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1185 <readline+0x65>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1180 <readline+0x60>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1185 <readline+0x65>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    $0x1000,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     114e <readline+0x2e>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <readline+0x31>
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @readline(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32*, i32** %3
%8 = call i32* @fgets(i8* %6, i32 4096, i32* %7)
%9 = icmp eq i32* null, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %4
store i8 0, i8* %11
br label %20
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i8* @strchr(i8* %13, i8 signext 10)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i8*, i8** %5
store i8 0, i8* %18
br label %19
19: ; preds = %17, %12
br label %20
20: ; preds = %19, %10
ret void
}

LLVM IR (-O2):
define void @readline(i32* nocapture %0, i8* %1) {
%3 = tail call i32* @fgets(i8* %1, i32 4096, i32* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i8* @strchr(i8* dereferenceable(1) %1, i8 signext 10)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5, %2
%9 = phi i8* [ %1, %2 ], [ %6, %5 ]
store i8 0, i8* %9
br label %10
10: ; preds = %8, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *a, int b) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_mutexattr_setprotocol>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_setprotocol(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int RSA_is8_finish(RSA *rsa) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @RSA_is8_finish(i32* nocapture readnone %0) {
ret i32 1
}
void h6280_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @h6280_exit() {
ret void
}
void *buildTCP_answer(int bool) {
  void *pkg = calloc(1, sizeof(int));
  if (bool) {
    setInt(pkg, 0, 10);
  } else {
    setInt(pkg, 0, 0);
  }
  return pkg;
}


x86 assembly (clang, -O0):
<buildTCP_answer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115f <buildTCP_answer+0x3f>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
mov    $0x0,%al
call   1030 <setInt@plt>
jmp    116e <buildTCP_answer+0x4e>
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <setInt@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildTCP_answer>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
mov    $0xa,%edx
cmove  %ebx,%edx
mov    %rax,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <setInt@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @buildTCP_answer(i32 %0) {
%2 = tail call dereferenceable_or_null(4) i8* @calloc(i64 1, i64 4)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 0, i32 10
%5 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @setInt to i32 (i8*, i32, i32, ...)*)(i8* %2, i32 0, i32 %4)
ret i8* %2
}
int do_994() { return 994; }


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

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

LLVM IR (-O0):
define i32 @do_994() {
ret i32 994
}

LLVM IR (-O2):
define i32 @do_994() {
ret i32 994
}
void g_path_skip_root() {}


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

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

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

LLVM IR (-O2):
define void @g_path_skip_root() {
ret void
}
int test_imm_04int64_highword_reg(long long val) {
  return ((val >> 32) & (0x04 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_04int64_highword_reg>:
bt     $0x22,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_04int64_highword_reg(i64 %0) {
%2 = and i64 %0, 17179869184
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ALWAYS_ON_SNR_destroy(void *snr) { return; }


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

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

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

LLVM IR (-O2):
define void @ALWAYS_ON_SNR_destroy(i8* nocapture %0) {
ret void
}
int printw(const char *s, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @printw(i8* nocapture readnone %0, ...) {
ret i32 0
}