xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char *_EncodeData(unsigned char *, char const *, unsigned int);
unsigned char *SEGGER_SYSVIEW_EncodeData(unsigned char *pPayload,
                                         const char *pSrc, unsigned NumBytes) {
  return _EncodeData(pPayload, pSrc, NumBytes);
}


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

x86 assembly (clang, -O2):
<SEGGER_SYSVIEW_EncodeData>:
jmp    1030 <_EncodeData@plt>

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

LLVM IR (-O2):
define i8* @SEGGER_SYSVIEW_EncodeData(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @_EncodeData(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ XTextItem;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XTextItem(void) {
  XTextItem *_p = (XTextItem *)malloc(sizeof(XTextItem));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XTextItem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XTextItem+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XTextItem>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XTextItem+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XTextItem() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XTextItem() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
wmcshello() {}


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

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

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

LLVM IR (-O2):
define i32 @wmcshello() {
ret i32 undef
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
void *__pw_dup(struct passwd const *);
void *passwd_dup(const void *ent) {
  const struct passwd *pw = ent;
  return __pw_dup(pw);
}


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

x86 assembly (clang, -O2):
<passwd_dup>:
jmp    1030 <__pw_dup@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i8* @passwd_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.passwd*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.passwd*
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = call i8* @__pw_dup(%struct.passwd* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i8* @passwd_dup(i8* %0) {
%2 = bitcast i8* %0 to %struct.passwd*
%3 = tail call i8* @__pw_dup(%struct.passwd* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DecodeI_xxxxxxxxssmmmrrr();
int /*<<< orphan*/ DoBinOpEor(int /*<<< orphan*/);
void DoCodeEorI(void) { DoBinOpEor(DecodeI_xxxxxxxxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeEorI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
call   1030 <DoBinOpEor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeEorI>:
push   %rax
xor    %eax,%eax
call   1040 <DecodeI_xxxxxxxxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DoBinOpEor@plt>

LLVM IR (-O0):
define void @DoCodeEorI() {
%1 = call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = call i32 @DoBinOpEor(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeEorI() {
%1 = tail call i32 (...) @DecodeI_xxxxxxxxssmmmrrr()
%2 = tail call i32 @DoBinOpEor(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x1f() {
  Assert_real((isspace(31) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              160, ("isspace should be 0 for 0x1f"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x1f>:
push   %rax
mov    $0x1f,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xa0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1f\00"
define void @t_isspace_0x1f() {
%1 = call i64 @isspace(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x1f\00"
define void @t_isspace_0x1f() {
%1 = tail call i64 @isspace(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char);
int strtol(char *, char **, int);
int parseInt(char *arg, char opt) {
  char *endptr;
  int val;
  val = strtol(arg, &endptr, 10);
  if (*arg == '\0' || *endptr != '\0')
    fatal("Invalid integer argument for -%c flag\n", opt);
  return val;
}


x86 assembly (clang, -O0):
<parseInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1167 <parseInt+0x47>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <parseInt+0x57>
lea    0xe92(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <fatal@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseInt>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ebp
cmpb   $0x0,(%rbx)
je     114e <parseInt+0x2e>
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
je     115e <parseInt+0x3e>
movsbl %r14b,%esi
lea    0xea7(%rip),%rdi
call   1040 <fatal@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Invalid integer argument for -%c flag\0A\00"
define i32 @parseInt(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = call i32 @strtol(i8* %7, i8** %5, i32 10)
store i32 %8, i32* %6
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13, %2
%19 = load i8, i8* %4
%20 = call i32 @fatal(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8 signext %19)
br label %21
21: ; preds = %18, %13
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
@.str = [39 x i8] c"Invalid integer argument for -%c flag\0A\00"
define i32 @parseInt(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %0, i8** %3, i32 10)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8, %2
%13 = tail call i32 @fatal(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8 signext %1)
br label %14
14: ; preds = %12, %8
ret i32 %5
}
/* Variables and functions */
scalar_t__ kputc(int /*<<< orphan*/);
int kputs(const char *s) {
  if (!s)
    return -1;
  while (*s) {
    if (kputc(*s++) < 0)
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <kputs+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <kputs+0x6e>
jmp    1138 <kputs+0x28>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1177 <kputs+0x67>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <kputc@plt>
cmp    $0x0,%rax
jge    1172 <kputs+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <kputs+0x6e>
jmp    1138 <kputs+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffffffff,%ebp
test   %rdi,%rdi
je     1139 <kputs+0x29>
mov    %rdi,%rbx
movsbl (%rbx),%edi
test   %edi,%edi
je     1137 <kputs+0x27>
add    $0x1,%rbx
call   1030 <kputc@plt>
test   %rax,%rax
jns    1120 <kputs+0x10>
jmp    1139 <kputs+0x29>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @kputs(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i64 @kputc(i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %7, %1
%13 = phi i32 [ -1, %1 ], [ 0, %3 ], [ -1, %7 ]
ret i32 %13
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char, ...);
int /*<<< orphan*/ sleep(int);
int cfunc(void *arg) {
  char *p = (void *)arg;
  printf("child got: %c\n", *p);
  sleep(12);
  *p = 'C';
  printf("child set: %c %s\n", *p, getenv("HOME"));
  return 0;
}


x86 assembly (clang, -O0):
<cfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xeb1(%rip),%rdi
movsbl (%rax),%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xc,%edi
call   1050 <sleep@plt>
mov    -0x10(%rbp),%rax
movb   $0x43,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdx
mov    -0x11(%rbp),%al
lea    0xe83(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfunc>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%esi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xc,%edi
call   1050 <sleep@plt>
movb   $0x43,(%rbx)
lea    0xec8(%rip),%rdi
call   1030 <getenv@plt>
lea    0xeaa(%rip),%rdi
mov    $0x43,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"child got: %c\0A\00"
@.str.1 = [18 x i8] c"child set: %c %s\0A\00"
@.str.2 = [5 x i8] c"HOME\00"
define i32 @cfunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = call i32 @sleep(i32 12)
%9 = load i8*, i8** %3
store i8 67, i8* %9
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8 signext %11, i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"child got: %c\0A\00"
@.str.1 = [18 x i8] c"child set: %c %s\0A\00"
@.str.2 = [5 x i8] c"HOME\00"
define i32 @cfunc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = tail call i32 @sleep(i32 12)
store i8 67, i8* %0
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8 signext 67, i8* %5)
ret i32 0
}
int f1(char *p1) {
  int count = 0;
  while (*p1 != '\0') {
    count++;
    *p1++;
  }
  return count;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <f1+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <f1+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
cmpb   $0x0,(%rdi)
je     111c <f1+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <f1+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ _dbg_check_lock_from_isr();
int /*<<< orphan*/ _stats_start_measure_crit_isr();
int /*<<< orphan*/ port_lock_from_isr();
void chSysLockFromISR(void) {
  port_lock_from_isr();
  _stats_start_measure_crit_isr();
  _dbg_check_lock_from_isr();
}


x86 assembly (clang, -O0):
<chSysLockFromISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <port_lock_from_isr@plt>
mov    $0x0,%al
call   1040 <_stats_start_measure_crit_isr@plt>
mov    $0x0,%al
call   1050 <_dbg_check_lock_from_isr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chSysLockFromISR>:
push   %rax
xor    %eax,%eax
call   1030 <port_lock_from_isr@plt>
xor    %eax,%eax
call   1040 <_stats_start_measure_crit_isr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <_dbg_check_lock_from_isr@plt>

LLVM IR (-O0):
define void @chSysLockFromISR() {
%1 = call i32 (...) @port_lock_from_isr()
%2 = call i32 (...) @_stats_start_measure_crit_isr()
%3 = call i32 (...) @_dbg_check_lock_from_isr()
ret void
}

LLVM IR (-O2):
define void @chSysLockFromISR() {
%1 = tail call i32 (...) @port_lock_from_isr()
%2 = tail call i32 (...) @_stats_start_measure_crit_isr()
%3 = tail call i32 (...) @_dbg_check_lock_from_isr()
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ abort();
int test(int);
int main() {
  int x = INT_MAX;
  if (test(x) == x)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test@plt>
cmp    -0x8(%rbp),%eax
jne    1153 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1040 <test@plt>
cmp    %ebx,%eax
je     1139 <main+0x19>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @INT_MAX
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @test(i32 %4)
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = tail call i32 @test(i32 %1)
%3 = icmp eq i32 %2, %1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ driver(int, char **);
int main(int argc, char *argv[]) {
  driver(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <driver@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @driver(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_point(void *point) { free(point); }


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

x86 assembly (clang, -O2):
<free_point>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_point(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit_group;
int /*<<< orphan*/ abort();
scalar_t__ foo();
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int);
int main() {
  if (foo() <= 0)
    abort();
  syscall(SYS_exit_group, 55);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <foo@plt>
cmp    $0x0,%rax
jg     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    $0x37,%esi
call   1040 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <foo@plt>
test   %rax,%rax
jle    1154 <main+0x24>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    $0x37,%esi
call   1040 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SYS_exit_group = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp sle i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = load i32, i32* @SYS_exit_group
%8 = call i32 @syscall(i32 %7, i32 55)
ret i32 0
}

LLVM IR (-O2):
@SYS_exit_group = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp slt i64 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = load i32, i32* @SYS_exit_group
%7 = tail call i32 @syscall(i32 %6, i32 55)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_send_buffer(int);
void send_signals(int *signals, int n) {
  int i;
  for (i = 0; i < n; i++) {
    add_send_buffer(signals[i]);
  }
}


x86 assembly (clang, -O0):
<send_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <send_signals+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <add_send_buffer@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <send_signals+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_signals>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <send_signals+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <add_send_buffer@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <send_signals+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @send_signals(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @add_send_buffer(i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void HSpoolGraf(char *fname) {}


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

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

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

LLVM IR (-O2):
define void @HSpoolGraf(i8* nocapture %0) {
ret void
}
int test_imm_4Auint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x4A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Auint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4849664
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double median_double(int, double *);
double median(int n, double *data) { return median_double(n, data); }


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

x86 assembly (clang, -O2):
<median>:
jmp    1030 <median_double@plt>

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

LLVM IR (-O2):
define double @median(i32 %0, double* %1) {
%3 = tail call double @median_double(i32 %0, double* %1)
ret double %3
}
__attribute__((section("socket/3"), used)) int data_sections() { return 0; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @data_sections to i8*)], section "llvm.metadata"
define i32 @data_sections() section "socket/3" {
ret i32 0
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @data_sections to i8*)], section "llvm.metadata"
define i32 @data_sections() section "socket/3" {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void genieFlush(int fd) { tcflush(fd, TCIOFLUSH); }


x86 assembly (clang, -O0):
<genieFlush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genieFlush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcflush@plt>

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

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @genieFlush(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
ret void
}
float am2315_compute_humidity(unsigned char msb, unsigned char lsb) {
  int humidity_h, humidity_l;
  float hum;
  humidity_h = msb << 8;
  humidity_l = lsb;
  hum = (humidity_h + humidity_l) / 10.0;
  return hum;
}


x86 assembly (clang, -O0):
<am2315_compute_humidity>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<am2315_compute_humidity>:
shl    $0x8,%edi
or     %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xeef(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @am2315_compute_humidity(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
store i32 %10, i32* %5
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 1.000000e+01
%18 = fptrunc double %17 to float
store float %18, float* %7
%19 = load float, float* %7
ret float %19
}

LLVM IR (-O2):
define float @am2315_compute_humidity(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+01
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ maxHeapify(int *, int, int);
void buildMaxHeap(int *A, int n) {
  for (int i = n / 2; i >= 0; i--) {
    maxHeapify(A, i, n);
  }
}


x86 assembly (clang, -O0):
<buildMaxHeap>:
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
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <buildMaxHeap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <maxHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <buildMaxHeap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildMaxHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0xffffffff,%esi
jl     1141 <buildMaxHeap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%ebp
shr    $0x1f,%ebp
add    %esi,%ebp
sar    %ebp
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <maxHeapify@plt>
add    $0xffffffff,%ebp
jb     1130 <buildMaxHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @buildMaxHeap(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
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @maxHeapify(i32* %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @buildMaxHeap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, -2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = sdiv i32 %1, 2
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %5, %4 ]
%9 = tail call i32 @maxHeapify(i32* %0, i32 %8, i32 %1)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %6, label %7
}
double SFMKGToLBS(double kg) { return (kg / 0.453592); }


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

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

LLVM IR (-O0):
define double @SFMKGToLBS(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 4.535920e-01
ret double %4
}

LLVM IR (-O2):
define double @SFMKGToLBS(double %0) {
%2 = fdiv double %0, 4.535920e-01
ret double %2
}
long rho_ruby_get_int(unsigned long val) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @rho_ruby_get_int(i64 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Message 1 defined in header file");
  if (0) {
    puts("MSG_2 is active");
  }
  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 <puts@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>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Message 1 defined in header file\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Message 1 defined in header file\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int findString(const char source[], const char search[]);
  printf("%i", findString("a chatterbox", "hoat"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [13 x i8] c"a chatterbox\00"
@.str.2 = [5 x i8] c"hoat\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @findString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [13 x i8] c"a chatterbox\00"
@.str.2 = [5 x i8] c"hoat\00"
define i32 @main() {
%1 = tail call i32 @findString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __SETPRIMASK();
void NVIC_SETPRIMASK(void) { __SETPRIMASK(); }


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

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

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

LLVM IR (-O2):
define void @NVIC_SETPRIMASK() {
%1 = tail call i32 (...) @__SETPRIMASK()
ret void
}
void soru_9() {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @soru_9() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ xcb_atom_t;

/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ XCB_ATOM_WINDOW;
int /*<<< orphan*/ xcb_get_property(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
xcb_get_property_cookie_t
xcb_icccm_get_wm_colormap_windows(xcb_connection_t *c, xcb_window_t window,
                                  xcb_atom_t wm_colormap_windows_atom) {
  return xcb_get_property(c, 0, window, wm_colormap_windows_atom,
                          XCB_ATOM_WINDOW, 0, UINT_MAX);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_colormap_windows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2ec5(%rip),%rax
mov    (%rax),%r8d
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %eax,(%rsp)
call   1030 <xcb_get_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_colormap_windows>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2edc(%rip),%rax
mov    (%rax),%r8d
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_WINDOW = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_colormap_windows(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @XCB_ATOM_WINDOW
%11 = load i32, i32* @UINT_MAX
%12 = call i32 @xcb_get_property(i32* %7, i32 0, i32 %8, i32 %9, i32 %10, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@XCB_ATOM_WINDOW = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_colormap_windows(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @XCB_ATOM_WINDOW
%5 = load i32, i32* @UINT_MAX
%6 = tail call i32 @xcb_get_property(i32* %0, i32 0, i32 %1, i32 %2, i32 %4, i32 0, i32 %5)
ret i32 %6
}
char *skip_eol(char *s, char *e) {
  while (s < e && *s != '\0' && *s != '\n' && *s != '\r')
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_eol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x11(%rbp)
jae    1159 <skip_eol+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1159 <skip_eol+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x11(%rbp)
je     1159 <skip_eol+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1169 <skip_eol+0x69>
jmp    117a <skip_eol+0x7a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <skip_eol+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_eol>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    1139 <skip_eol+0x39>
mov    %rsi,%rcx
sub    %rax,%rcx
mov    $0x2401,%edx
jmp    112a <skip_eol+0x2a>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
je     113a <skip_eol+0x3a>
movzbl (%rax),%edi
cmp    $0xd,%rdi
ja     1120 <skip_eol+0x20>
bt     %rdi,%rdx
jae    1120 <skip_eol+0x20>
ret
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @skip_eol(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %4, %12
%10 = phi i8* [ %13, %12 ], [ %0, %4 ]
%11 = load i8, i8* %10
switch i8 %11, label %12 [
i8 0, label %15
i8 10, label %15
i8 13, label %15
]
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = icmp eq i8* %13, %8
br i1 %14, label %15, label %9
15: ; preds = %12, %9, %9, %9, %2
%16 = phi i8* [ %0, %2 ], [ %10, %9 ], [ %10, %9 ], [ %10, %9 ], [ %8, %12 ]
ret i8* %16
}
unsigned int btcl_mem(unsigned char *base, int bitno) {
  unsigned char res;
  __asm__ __volatile__("btcl\t%2, %0\n\t"
                       "setc\t%1"
                       : "=m"(*base), "=q"(res)
                       : "r"(bitno));
  return res;
}


x86 assembly (clang, -O0):
<btcl_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
btc    %ecx,(%rax)
setb   %al
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btcl_mem>:
btc    %esi,(%rdi)
setb   %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @btcl_mem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8 asm sideeffect "btcl\09$2, $0\0A\09setc\09$1", "=*m,=q,r,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %6, i32 %7)
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @btcl_mem(i8* %0, i32 %1) {
%3 = tail call i8 asm sideeffect "btcl\09$2, $0\0A\09setc\09$1", "=*m,=q,r,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i32 %1)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
struct cec_msg {
  int len;
  int /*<<< orphan*/ *msg;
};

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_REPORT_ARC_TERMINATED;
void cec_msg_report_arc_terminated(struct cec_msg *msg) {
  msg->len = 2;
  msg->msg[1] = CEC_MSG_REPORT_ARC_TERMINATED;
}


x86 assembly (clang, -O0):
<cec_msg_report_arc_terminated>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_report_arc_terminated>:
movl   $0x2,(%rdi)
mov    0x2ee3(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_REPORT_ARC_TERMINATED = global i32 0
define void @cec_msg_report_arc_terminated(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 2, i32* %4
%5 = load i32, i32* @CEC_MSG_REPORT_ARC_TERMINATED
%6 = load %struct.cec_msg*, %struct.cec_msg** %2
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %6, i32 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_REPORT_ARC_TERMINATED = global i32 0
define void @cec_msg_report_arc_terminated(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 2, i32* %2
%3 = load i32, i32* @CEC_MSG_REPORT_ARC_TERMINATED
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %3, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int wait(int /*<<< orphan*/ *);
extern void parent_code(int child_pid) {
  int wait_rv = wait(NULL);
  printf("done waiting for %d, wait returned %d\n", child_pid, wait_rv);
}


x86 assembly (clang, -O0):
<parent_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent_code>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <wait@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"done waiting for %d, wait returned %d\0A\00"
define void @parent_code(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @wait(i32* null)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"done waiting for %d, wait returned %d\0A\00"
define void @parent_code(i32 %0) {
%2 = tail call i32 @wait(i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
int test_imm_11int64_lowword_mem(long long *val) {
  return ((*val) & (0x11 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_11int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 17
%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_11int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 17
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double ceil(d)
double d;
{ return (-floor(-d)); }


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <floor@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @llvm.floor.f64(double %4)
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fneg double %3
ret double %4
}