xunge/DecIR huggingface dataset:
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
struct plainstring *plainstring_new();
int /*<<< orphan*/ plainstring_set_double(struct plainstring *, double);
struct plainstring *plainstring_new_double(double d) {
  struct plainstring *str = plainstring_new();
  if (!str)
    return str;
  plainstring_set_double(str, d);
  return str;
}


x86 assembly (clang, -O0):
<plainstring_new_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <plainstring_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <plainstring_new_double+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <plainstring_new_double+0x46>
mov    -0x18(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1040 <plainstring_set_double@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_new_double>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <plainstring_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1148 <plainstring_new_double+0x28>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <plainstring_set_double@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define %struct.plainstring* @plainstring_new_double(double %0) {
%2 = alloca %struct.plainstring*
%3 = alloca double
%4 = alloca %struct.plainstring*
store double %0, double* %3
%5 = call %struct.plainstring* (...) @plainstring_new()
store %struct.plainstring* %5, %struct.plainstring** %4
%6 = load %struct.plainstring*, %struct.plainstring** %4
%7 = icmp ne %struct.plainstring* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load %struct.plainstring*, %struct.plainstring** %4
store %struct.plainstring* %9, %struct.plainstring** %2
br label %15
10: ; preds = %1
%11 = load %struct.plainstring*, %struct.plainstring** %4
%12 = load double, double* %3
%13 = call i32 @plainstring_set_double(%struct.plainstring* %11, double %12)
%14 = load %struct.plainstring*, %struct.plainstring** %4
store %struct.plainstring* %14, %struct.plainstring** %2
br label %15
15: ; preds = %10, %8
%16 = load %struct.plainstring*, %struct.plainstring** %2
ret %struct.plainstring* %16
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define %struct.plainstring* @plainstring_new_double(double %0) {
%2 = tail call %struct.plainstring* (...) @plainstring_new()
%3 = icmp eq %struct.plainstring* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @plainstring_set_double(%struct.plainstring* %2, double %0)
br label %6
6: ; preds = %1, %4
ret %struct.plainstring* %2
}
void initgraph(int *pInt, int *pInt1, char *string) {}


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

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

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

LLVM IR (-O2):
define void @initgraph(i32* nocapture %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int core6_safe(char const *);
int U_EMRPOLYLINETO16_safe(const char *record) { return (core6_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRPOLYLINETO16_safe>:
jmp    1030 <core6_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYLINETO16_safe(i8* %0) {
%2 = tail call i32 @core6_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WsLoadEeprom();
void WsInit(void) { WsLoadEeprom(); }


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

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

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

LLVM IR (-O2):
define void @WsInit() {
%1 = tail call i32 (...) @WsLoadEeprom()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("Yay! You DID it!\n\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Yay! You DID it!\0A\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Yay! You DID it!\0A\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
void *malloc(size_t);
int /*<<< orphan*/ oom();
void *lmalloc(size_t size) {
  void *ptr;
  assert(size);
  ptr = malloc(size);
  if (ptr == NULL)
    oom();
  return ptr;
}


x86 assembly (clang, -O0):
<lmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <lmalloc+0x34>
mov    $0x0,%al
call   1030 <oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <lmalloc+0x20>
xor    %eax,%eax
call   1030 <oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @assert(i64 %4)
%6 = load i64, i64* %2
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (...) @oom()
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @lmalloc(i64 %0) {
%2 = tail call i32 @assert(i64 %0)
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @oom()
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void describe(void) {
  fputs("Usage: pltek filename \nAt the prompt, the following replies are "
        "recognized:\n   h,?	  Give this help message.\n    q	  Quit "
        "program.\n   <n>	  Go to the specified page number.\n   -<n>   "
        "Go back <n> pages.\n   +<n>   Go forward <n> pages.\n <Return> Go to "
        "the next page.\n\n",
        stdout);
}


x86 assembly (clang, -O0):
<describe>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<describe>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [267 x i8] c"Usage: pltek filename \0AAt the prompt, the following replies are recognized:\0A h,?\09 Give this help message.\0A q\09 Quit program.\0A <n>\09 Go to the specified page number.\0A -<n> Go back <n> pages.\0A +<n> Go forward <n> pages.\0A <Return> Go to the next page.\0A\0A\00"
@stdout = global i32 0
define void @describe() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [267 x i8] c"Usage: pltek filename \0AAt the prompt, the following replies are recognized:\0A h,?\09 Give this help message.\0A q\09 Quit program.\0A <n>\09 Go to the specified page number.\0A -<n> Go back <n> pages.\0A +<n> Go forward <n> pages.\0A <Return> Go to the next page.\0A\0A\00"
@stdout = global i32 0
define void @describe() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([267 x i8], [267 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
int sdo_is_toggled(const struct can_frame *frame) {
  return !!(frame->data[0] & 1 << 4);
}


x86 assembly (clang, -O0):
<sdo_is_toggled>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_is_toggled>:
mov    (%rdi),%rax
mov    (%rax),%eax
shr    $0x4,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i32 @sdo_is_toggled(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
store %struct.can_frame* %0, %struct.can_frame** %2
%3 = load %struct.can_frame*, %struct.can_frame** %2
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, 16
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define i32 @sdo_is_toggled(%struct.can_frame* nocapture %0) {
%2 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = lshr i32 %4, 4
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testDiv() { printf("%d / %d = %d\n", 11, 4, 11 / 4); }


x86 assembly (clang, -O0):
<testDiv>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xb,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDiv>:
lea    0xee9(%rip),%rdi
mov    $0xb,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d / %d = %d\0A\00"
define void @testDiv() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 11, i32 4, i32 2)
ret void
}
/* Variables and functions */
int CHAR_BIT;
int main(void) { return (int)1 >> sizeof(int) * CHAR_BIT; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2ece(%rip),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%ecx
mov    $0x1,%eax
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%cl
shl    $0x2,%cl
mov    $0x1,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @CHAR_BIT
%3 = sext i32 %2 to i64
%4 = mul i64 4, %3
%5 = trunc i64 %4 to i32
%6 = ashr i32 1, %5
ret i32 %6
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @main() {
%1 = load i32, i32* @CHAR_BIT
%2 = shl i32 %1, 2
%3 = lshr i32 1, %2
ret i32 %3
}
/* Variables and functions */
char rand();
void mkrand(void *buf, int size) {
  char *p;
  int i;
  p = buf;
  for (i = 0; i < size; i++)
    p[i] = rand();
}


x86 assembly (clang, -O0):
<mkrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <mkrand+0x4c>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %al,%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <mkrand+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkrand>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <mkrand+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <mkrand+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @mkrand(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call signext i8 (...) @rand()
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage:  localbus [-c] command1 [command ...]\n");
  fprintf(stderr, "Bidirectional 'tee'. Stdout from command1 to Stdin of all "
                  "other commands and vice versa\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeef(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"usage: localbus [-c] command1 [command ...]\0A\00"
@.str.1 = [89 x i8] c"Bidirectional 'tee'. Stdout from command1 to Stdin of all other commands and vice versa\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"usage: localbus [-c] command1 [command ...]\0A\00"
@.str.1 = [89 x i8] c"Bidirectional 'tee'. Stdout from command1 to Stdin of all other commands and vice versa\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned int armv8_pmu_pmcr_read();
int /*<<< orphan*/ armv8_pmu_pmcr_write(unsigned int);
void enable_all_counters(void) {
  unsigned int val;
  val = armv8_pmu_pmcr_read();
  val |= (1 << 0) | (1 << 4);
  armv8_pmu_pmcr_write(val);
}


x86 assembly (clang, -O0):
<enable_all_counters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <armv8_pmu_pmcr_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x11,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <armv8_pmu_pmcr_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_all_counters>:
push   %rax
xor    %eax,%eax
call   1040 <armv8_pmu_pmcr_read@plt>
or     $0x11,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <armv8_pmu_pmcr_write@plt>

LLVM IR (-O0):
define void @enable_all_counters() {
%1 = alloca i32
%2 = call i32 (...) @armv8_pmu_pmcr_read()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 17
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @armv8_pmu_pmcr_write(i32 %5)
ret void
}

LLVM IR (-O2):
define void @enable_all_counters() {
%1 = tail call i32 (...) @armv8_pmu_pmcr_read()
%2 = or i32 %1, 17
%3 = tail call i32 @armv8_pmu_pmcr_write(i32 %2)
ret void
}
void MaskCpuFlags() {}


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

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

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

LLVM IR (-O2):
define void @MaskCpuFlags() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct diff_addr_store {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addr_cmd(struct diff_addr_store *, char *,
                            int /*<<< orphan*/ const *, size_t);
void add_item(struct diff_addr_store *store, const uint8_t *addr,
              size_t length) {
  addr_cmd(store, "add", addr, length);
}


x86 assembly (clang, -O0):
<add_item>:
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),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <addr_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_item>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <addr_cmd@plt>

LLVM IR (-O0):
%struct.diff_addr_store = type { i32 }
@.str = [4 x i8] c"add\00"
define void @add_item(%struct.diff_addr_store* %0, i32* %1, i64 %2) {
%4 = alloca %struct.diff_addr_store*
%5 = alloca i32*
%6 = alloca i64
store %struct.diff_addr_store* %0, %struct.diff_addr_store** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load %struct.diff_addr_store*, %struct.diff_addr_store** %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = call i32 @addr_cmd(%struct.diff_addr_store* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %8, i64 %9)
ret void
}

LLVM IR (-O2):
%struct.diff_addr_store = type { i32 }
@.str = [4 x i8] c"add\00"
define void @add_item(%struct.diff_addr_store* %0, i32* %1, i64 %2) {
%4 = tail call i32 @addr_cmd(%struct.diff_addr_store* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_entry(char *key, char *value, void *data) {
  printf("%s %s\n", key, value);
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
define void @print_entry(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
double sin(double);
int /*<<< orphan*/ track_stats(void *);
double sinx2(double x, void *params) {
  track_stats(params);
  return sin(x * x);
}


x86 assembly (clang, -O0):
<sinx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <track_stats@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinx2>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <track_stats@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
pop    %rax
jmp    1040 <sin@plt>

LLVM IR (-O0):
define double @sinx2(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @track_stats(i8* %5)
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = call double @sin(double %9)
ret double %10
}

LLVM IR (-O2):
define double @sinx2(double %0, i8* %1) {
%3 = tail call i32 @track_stats(i8* %1)
%4 = fmul double %0, %0
%5 = tail call double @sin(double %4)
ret double %5
}
int parser_IsWhite(char c) {
  return (c == ' ' || c == 0x9 || c == '\n' || c == '\r');
}


x86 assembly (clang, -O0):
<parser_IsWhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <parser_IsWhite+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <parser_IsWhite+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <parser_IsWhite+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_IsWhite>:
cmp    $0x20,%dil
ja     1120 <parser_IsWhite+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <parser_IsWhite+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @parser_IsWhite(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @parser_IsWhite(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int write(int, unsigned char *, int);
int send_control(int fd, int code) {
  unsigned char c = (unsigned char)code;
  const ssize_t size = write(fd, &c, sizeof(c));
  if (size == sizeof(c))
    return (int)size;
  else
    return -1;
}


x86 assembly (clang, -O0):
<send_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x1,%rax
jne    1151 <send_control+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <send_control+0x48>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_control>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @send_control(i32 %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = call i32 @write(i32 %0, i8* %3, i32 1)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i32 1, i32 -1
ret i32 %7
}
/* Variables and functions */
int foo1(int, int);
int foo2(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() { printf("%d // %d\n", foo1(2, 3), foo2(2, 3)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <foo1@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <foo2@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <foo1@plt>
mov    %eax,%ebx
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <foo2@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d // %d\0A\00"
define i32 @main() {
%1 = call i32 @foo1(i32 2, i32 3)
%2 = call i32 @foo2(i32 2, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d // %d\0A\00"
define i32 @main() {
%1 = tail call i32 @foo1(i32 2, i32 3)
%2 = tail call i32 @foo2(i32 2, i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int const stat(char *, struct stat *);
void checkDirectoryExistsAndCreate(char *directory) {
  const int MISSING = -1;
  struct stat st = {0};
  if (stat(directory, &st) == MISSING) {
    printf("Creating directory: %s\n", directory);
    mkdir(directory, 0700);
  }
}


x86 assembly (clang, -O0):
<checkDirectoryExistsAndCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <stat@plt>
cmp    $0xffffffff,%eax
jne    1197 <checkDirectoryExistsAndCreate+0x57>
mov    -0x8(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkDirectoryExistsAndCreate>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1050 <stat@plt>
cmp    $0xffffffff,%eax
je     1155 <checkDirectoryExistsAndCreate+0x25>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1c0,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [24 x i8] c"Creating directory: %s\0A\00"
define void @checkDirectoryExistsAndCreate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
store i32 -1, i32* %3
%5 = bitcast %struct.stat* %4 to i8*
%6 = load i8*, i8** %2
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 @mkdir(i8* %12, i32 448)
br label %14
14: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [24 x i8] c"Creating directory: %s\0A\00"
define void @checkDirectoryExistsAndCreate(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @mkdir(i8* %0, i32 448)
br label %10
10: ; preds = %7, %1
ret void
}
int cmodel_bc_to_x(int color_model) {
  switch (color_model) {
  case 7:
    return 0x32315659;
    break;
  case 19:
    return 0x32595559;
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<cmodel_bc_to_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x7,%eax
je     112c <cmodel_bc_to_x+0x2c>
jmp    111b <cmodel_bc_to_x+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x13,%eax
je     1138 <cmodel_bc_to_x+0x38>
jmp    1144 <cmodel_bc_to_x+0x44>
movl   $0x32315659,-0x4(%rbp)
jmp    114b <cmodel_bc_to_x+0x4b>
movl   $0x32595559,-0x4(%rbp)
jmp    114b <cmodel_bc_to_x+0x4b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmodel_bc_to_x>:
cmp    $0x13,%edi
mov    $0x32595559,%eax
mov    $0xffffffff,%ecx
cmove  %eax,%ecx
cmp    $0x7,%edi
mov    $0x32315659,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmodel_bc_to_x(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 7, label %5
i32 19, label %6
]
5: ; preds = %1
store i32 842094169, i32* %2
br label %8
6: ; preds = %1
store i32 844715353, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @cmodel_bc_to_x(i32 %0) {
%2 = icmp eq i32 %0, 19
%3 = select i1 %2, i32 844715353, i32 -1
%4 = icmp eq i32 %0, 7
%5 = select i1 %4, i32 842094169, i32 %3
ret i32 %5
}
void DH_new(void) {}


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

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

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

LLVM IR (-O2):
define void @DH_new() {
ret void
}
/* Variables and functions */
unsigned int f2u(float);
scalar_t__ isnan(float);
float u2f(unsigned int);
unsigned test_float_abs(unsigned uf) {
  float f = u2f(uf);
  unsigned unf = f2u(-f);
  if (isnan(f))
    return uf;
  if ((int)uf < 0)
    return unf;
  else
    return uf;
}


x86 assembly (clang, -O0):
<test_float_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <u2f@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1050 <f2u@plt>
mov    %eax,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     1181 <test_float_abs+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119c <test_float_abs+0x6c>
cmpl   $0x0,-0x8(%rbp)
jge    1196 <test_float_abs+0x66>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119c <test_float_abs+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float_abs>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
call   1030 <u2f@plt>
movaps %xmm0,%xmm1
movaps %xmm0,(%rsp)
movaps 0xeb5(%rip),%xmm0
xorps  %xmm1,%xmm0
call   1050 <f2u@plt>
mov    %eax,%ebp
movaps (%rsp),%xmm0
call   1040 <isnan@plt>
test   %rax,%rax
cmovne %ebx,%ebp
test   %ebx,%ebx
cmovns %ebx,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_float_abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call float @u2f(i32 %6)
store float %7, float* %4
%8 = load float, float* %4
%9 = fneg float %8
%10 = call i32 @f2u(float %9)
store i32 %10, i32* %5
%11 = load float, float* %4
%12 = call i64 @isnan(float %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i32, i32* %3
store i32 %15, i32* %2
br label %23
16: ; preds = %1
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32, i32* %5
store i32 %20, i32* %2
br label %23
21: ; preds = %16
%22 = load i32, i32* %3
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %19, %14
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @test_float_abs(i32 %0) {
%2 = tail call float @u2f(i32 %0)
%3 = fneg float %2
%4 = tail call i32 @f2u(float %3)
%5 = tail call i64 @isnan(float %2)
%6 = icmp eq i64 %5, 0
%7 = icmp slt i32 %0, 0
%8 = and i1 %7, %6
%9 = select i1 %8, i32 %4, i32 %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ jet_sleep(int);
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/, int /*<<< orphan*/);
int dynamixelExecuteSynchMove() {
  int ret = write_block(108, 0, 0, 0, 0, 0);
  jet_sleep(50);
  return ret;
}


x86 assembly (clang, -O0):
<dynamixelExecuteSynchMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6c,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <write_block@plt>
mov    %eax,-0x4(%rbp)
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamixelExecuteSynchMove>:
push   %rbx
mov    $0x6c,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <write_block@plt>
mov    %eax,%ebx
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dynamixelExecuteSynchMove() {
%1 = alloca i32
%2 = call i32 @write_block(i32 108, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %2, i32* %1
%3 = call i32 @jet_sleep(i32 50)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @dynamixelExecuteSynchMove() {
%1 = tail call i32 @write_block(i32 108, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @jet_sleep(i32 50)
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t detexPixel32GetG16(uint32_t pixel) {
  return (pixel & 0xFFFF0000) >> 16;
}


x86 assembly (clang, -O0):
<detexPixel32GetG16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<detexPixel32GetG16>:
mov    %edi,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @detexPixel32GetG16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = lshr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @detexPixel32GetG16(i32 %0) {
%2 = lshr i32 %0, 16
ret i32 %2
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, unsigned int, unsigned int,
                          unsigned int);
void RNDResponseSink_ContentDirectory_Browse(struct UPnPService *Service,
                                             int ErrorCode, void *User,
                                             char *Result,
                                             unsigned int NumberReturned,
                                             unsigned int TotalMatches,
                                             unsigned int UpdateID) {
  printf("RND Invoke Response: "
         "ContentDirectory/Browse[ErrorCode:%d](%s,%u,%u,%u)\r\n",
         ErrorCode, Result, NumberReturned, TotalMatches, UpdateID);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ContentDirectory_Browse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_ContentDirectory_Browse>:
mov    %r9d,%eax
mov    0x8(%rsp),%r9d
lea    0xee1(%rip),%rdi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %eax,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: ContentDirectory/Browse[ErrorCode:%d](%s,%u,%u,%u)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_Browse(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.UPnPService*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.UPnPService* %0, %struct.UPnPService** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %9
%16 = load i8*, i8** %11
%17 = load i32, i32* %12
%18 = load i32, i32* %13
%19 = load i32, i32* %14
%20 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: ContentDirectory/Browse[ErrorCode:%d](%s,%u,%u,%u)\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_Browse(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i32 %4, i32 %5, i32 %6)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAChannelRequest(uint32_t ui32ChannelNum) {
  ;
  (*((volatile unsigned long *)(0x400FF014))) = 1 << (ui32ChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelRequest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelRequest>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff014
40
ret

LLVM IR (-O0):
define void @uDMAChannelRequest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 1074786324 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelRequest(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1074786324 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_213() {
  Assert_real((isqrt(213) == 14),
              "/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/stdlib/isqrt.c",
              1070, ("Integer square root of 213 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_213>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd5,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x42e,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_213>:
push   %rax
mov    $0xd5,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x42e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 213 should be 14\00"
define void @t_sqrt_213() {
%1 = call i32 @isqrt(i32 213)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 213 should be 14\00"
define void @t_sqrt_213() {
%1 = tail call i32 @isqrt(i32 213)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SavePrefs();
void xBoard(void) { SavePrefs(); }


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

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

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

LLVM IR (-O2):
define void @xBoard() {
%1 = tail call i32 (...) @SavePrefs()
ret void
}
int vlistInqVarIntKey(int vlistID, int varID, const char *name) {
  long int value = 0;
  (void)vlistID;
  (void)varID;
  (void)name;
  return (int)value;
}


x86 assembly (clang, -O0):
<vlistInqVarIntKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vlistInqVarIntKey(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i64 0, i64* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @vlistInqVarIntKey(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
struct file_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_dbppc_comment(char *, char *, int, char *, char,
                                       struct file_header *);
void print_ppc_comment(int *tab, int action, char *cur_date, char *cur_time,
                       int utc, char *comment, struct file_header *file_hdr) {
  if (action & 0x02) {
    print_dbppc_comment(cur_date, cur_time, utc, comment, '\t', file_hdr);
  }
}


x86 assembly (clang, -O0):
<print_ppc_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1160 <print_ppc_comment+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    0x10(%rbp),%r9
mov    $0x9,%r8d
call   1030 <print_dbppc_comment@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ppc_comment>:
test   $0x2,%sil
jne    1117 <print_ppc_comment+0x7>
ret
mov    0x8(%rsp),%rax
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
mov    %r9,%rcx
mov    $0x9,%r8d
mov    %rax,%r9
jmp    1030 <print_dbppc_comment@plt>

LLVM IR (-O0):
%struct.file_header = type { i32 }
define void @print_ppc_comment(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, %struct.file_header* %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca %struct.file_header*
store i32* %0, i32** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store %struct.file_header* %6, %struct.file_header** %14
%15 = load i32, i32* %9
%16 = and i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %7
%19 = load i8*, i8** %10
%20 = load i8*, i8** %11
%21 = load i32, i32* %12
%22 = load i8*, i8** %13
%23 = load %struct.file_header*, %struct.file_header** %14
%24 = call i32 @print_dbppc_comment(i8* %19, i8* %20, i32 %21, i8* %22, i8 signext 9, %struct.file_header* %23)
br label %25
25: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
%struct.file_header = type { i32 }
define void @print_ppc_comment(i32* nocapture readnone %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, %struct.file_header* %6) {
%8 = and i32 %1, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @print_dbppc_comment(i8* %2, i8* %3, i32 %4, i8* %5, i8 signext 9, %struct.file_header* %6)
br label %12
12: ; preds = %10, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRCB_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRCB_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRCB_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void readAllPmc() {}


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

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

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

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