xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage_word_format();
void usage(const char *x) {
  fprintf(stderr,
          "Usage: %s -t|-x[e] [-W<input word format>] [-X<output word format>] "
          "<file>\n",
          x);
  usage_word_format();
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <usage_word_format@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Usage: %s -t|-x[e] [-W<input word format>] [-X<output word format>] <file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @usage_word_format()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Usage: %s -t|-x[e] [-W<input word format>] [-X<output word format>] <file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @usage_word_format()
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *fs_fread(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fs_open(char const *, char *);
char *fs_read(const char *path) {
  FILE *file = fs_open(path, "r");
  if (NULL == file)
    return NULL;
  char *data = fs_fread(file);
  fclose(file);
  return data;
}


x86 assembly (clang, -O0):
<fs_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fs_open@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1169 <fs_read+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1187 <fs_read+0x57>
mov    -0x18(%rbp),%rdi
call   1050 <fs_fread@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_read>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rsi
call   1040 <fs_open@plt>
test   %rax,%rax
je     1160 <fs_read+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fs_fread@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
jmp    1162 <fs_read+0x32>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i8* @fs_read(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fs_open(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* null, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %17
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i8* @fs_fread(i32* %12)
store i8* %13, i8** %5
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load i8*, i8** %5
store i8* %16, i8** %2
br label %17
17: ; preds = %11, %10
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i8* @fs_read(i8* %0) {
%2 = tail call i32* @fs_open(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i8* @fs_fread(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ BlankLine();
int /*<<< orphan*/ EmitIndented(int, char *, char *);
void EmitTakedown(int indent, char *name) {
  EmitIndented(indent, "cut_end( \"group-%s\" );", name);
  EmitIndented(indent, "__CUT_TAKEDOWN__%s();", name);
  BlankLine();
}


x86 assembly (clang, -O0):
<EmitTakedown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rsi
call   1040 <EmitIndented@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xec7(%rip),%rsi
call   1040 <EmitIndented@plt>
mov    $0x0,%al
call   1030 <BlankLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmitTakedown>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rsi
mov    %rbx,%rdx
call   1040 <EmitIndented@plt>
lea    0xed9(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1040 <EmitIndented@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <BlankLine@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"cut_end( \22group-%s\22 );\00"
@.str.1 = [22 x i8] c"__CUT_TAKEDOWN__%s();\00"
define void @EmitTakedown(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @EmitIndented(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @EmitIndented(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @BlankLine()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"cut_end( \22group-%s\22 );\00"
@.str.1 = [22 x i8] c"__CUT_TAKEDOWN__%s();\00"
define void @EmitTakedown(i32 %0, i8* %1) {
%3 = tail call i32 @EmitIndented(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @EmitIndented(i32 %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 (...) @BlankLine()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utf8_cont(char const);
size_t utf8_char_next(const char *s, size_t len, size_t point) {
  for (;;) {
    point++;
    if (point >= len)
      return len;
    if (!utf8_cont(s[point]))
      return point;
  }
}


x86 assembly (clang, -O0):
<utf8_char_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     114b <utf8_char_next+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <utf8_char_next+0x67>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <utf8_cont@plt>
cmp    $0x0,%eax
jne    1172 <utf8_char_next+0x62>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <utf8_char_next+0x67>
jmp    1124 <utf8_char_next+0x14>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_char_next>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdx),%rbx
cmp    %r15,%rbx
jae    113d <utf8_char_next+0x2d>
movsbl 0x1(%r14,%rdx,1),%edi
call   1030 <utf8_cont@plt>
mov    %rbx,%rdx
test   %eax,%eax
jne    1120 <utf8_char_next+0x10>
jmp    1140 <utf8_char_next+0x30>
mov    %r15,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @utf8_char_next(i8* %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
br label %8
8: ; preds = %25, %3
%9 = load i64, i64* %7
%10 = add i64 %9, 1
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = load i64, i64* %6
%13 = icmp uge i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = load i64, i64* %6
store i64 %15, i64* %4
br label %26
16: ; preds = %8
%17 = load i8*, i8** %5
%18 = load i64, i64* %7
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @utf8_cont(i8 signext %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %16
%24 = load i64, i64* %7
store i64 %24, i64* %4
br label %26
25: ; preds = %16
br label %8
26: ; preds = %23, %14
%27 = load i64, i64* %4
ret i64 %27
}

LLVM IR (-O2):
define i64 @utf8_char_next(i8* nocapture %0, i64 %1, i64 %2) {
br label %4
4: ; preds = %8, %3
%5 = phi i64 [ %2, %3 ], [ %6, %8 ]
%6 = add i64 %5, 1
%7 = icmp ult i64 %6, %1
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 %6
%10 = load i8, i8* %9
%11 = tail call i32 @utf8_cont(i8 signext %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %8, %4
%14 = phi i64 [ %1, %4 ], [ %6, %8 ]
ret i64 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_from_bytes(uintptr_t, uintptr_t);
void fiat_p384_from_bytes(uint64_t out1[6], const uint8_t arg1[48]) {
  internal_fiat_p384_from_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_from_bytes>:
jmp    1030 <internal_fiat_p384_from_bytes@plt>

LLVM IR (-O0):
define void @fiat_p384_from_bytes(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p384_from_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_from_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p384_from_bytes(i64 %3, i64 %4)
ret void
}
int foo(int len, int magic) { return len % magic; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_message_read_strv(void *m,
                                                                    char ***l) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_read_strv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_read_strv>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_read_strv(i8* %0, i8*** %1) {
%3 = alloca i8*
%4 = alloca i8***
store i8* %0, i8** %3
store i8*** %1, i8**** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_read_strv(i8* nocapture readnone %0, i8*** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endline();
void endlin_() { endline(); }


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

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

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

LLVM IR (-O2):
define void @endlin_() {
%1 = tail call i32 (...) @endline()
ret void
}
/* Variables and functions */
char *strstr(char const *, char const *);
char *my_strstr(const char *s1, const char *s2) {
  register char *last;
  register char *current;
  last = NULL;
  if (*s2 != '\0') {
    current = strstr(s1, s2);
    while (current != NULL) {
      last = current;
      current = strstr(s1, s2);
    }
  }
  return last;
}


x86 assembly (clang, -O0):
<my_strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1177 <my_strstr+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1172 <my_strstr+0x62>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
jmp    1149 <my_strstr+0x39>
jmp    1177 <my_strstr+0x67>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @my_strstr(i8* %0, i8* nocapture %1) {
ret i8* null
}
/* Variables and functions */
int japi_hasfocus(int);
int j_hasfocus(int arg0) { return (japi_hasfocus(arg0)); }


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

x86 assembly (clang, -O2):
<j_hasfocus>:
jmp    1030 <japi_hasfocus@plt>

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

LLVM IR (-O2):
define i32 @j_hasfocus(i32 %0) {
%2 = tail call i32 @japi_hasfocus(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t EEPROMBlockProtectGet(uint32_t ui32Block) {
  ASSERT(ui32Block <
         ((((*((volatile uint32_t *)(0x400AF000)))) & 0x07FF0000) >> 16));
  (*((volatile uint32_t *)(0x400AF004))) = ui32Block;
  return ((*((volatile uint32_t *)(0x400AF030))));
}


x86 assembly (clang, -O0):
<EEPROMBlockProtectGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x400af000,%ecx
mov    (%rcx),%ecx
and    $0x7ff0000,%ecx
sar    $0x10,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%ecx
mov    $0x400af004,%eax
mov    %ecx,(%rax)
mov    $0x400af030,%eax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockProtectGet>:
push   %rbx
mov    %edi,%ebx
mov    0x400af000,%eax
shr    $0x10,%eax
and    $0x7ff,%eax
xor    %edi,%edi
cmp    %ebx,%eax
setg   %dil
call   1030 <ASSERT@plt>
mov    %ebx,0x400af004
mov    0x400af030,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @EEPROMBlockProtectGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load volatile i32, i32* inttoptr (i64 1074458624 to i32*)
%5 = and i32 %4, 134152192
%6 = ashr i32 %5, 16
%7 = icmp slt i32 %3, %6
%8 = zext i1 %7 to i32
%9 = call i32 @ASSERT(i32 %8)
%10 = load i32, i32* %2
store volatile i32 %10, i32* inttoptr (i64 1074458628 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1074458672 to i32*)
ret i32 %11
}

LLVM IR (-O2):
define i32 @EEPROMBlockProtectGet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074458624 to i32*)
%3 = lshr i32 %2, 16
%4 = and i32 %3, 2047
%5 = icmp sgt i32 %4, %0
%6 = zext i1 %5 to i32
%7 = tail call i32 @ASSERT(i32 %6)
store volatile i32 %0, i32* inttoptr (i64 1074458628 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 1074458672 to i32*)
ret i32 %8
}
void func_work(char *x) { *x = 'x'; }


x86 assembly (clang, -O0):
<func_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x78,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_work>:
movb   $0x78,(%rdi)
ret

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

LLVM IR (-O2):
define void @func_work(i8* nocapture writeonly %0) {
store i8 120, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void OK(const char *text, int result) {
  if (result)
    printf("[OK] %s\n", text);
  else
    printf("[--] %s\n", text);
}


x86 assembly (clang, -O0):
<OK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <OK+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <OK+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OK>:
mov    %rdi,%rax
test   %esi,%esi
lea    0xeed(%rip),%rcx
lea    0xedd(%rip),%rdi
cmove  %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"[OK] %s\0A\00"
@.str.1 = [9 x i8] c"[--] %s\0A\00"
define void @OK(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %0)
ret void
}
/* Variables and functions */
size_t round_to_page(size_t value) {
  if (value % 4096 == 0)
    return value;
  return (value / 4096 + 1) * 4096;
}


x86 assembly (clang, -O0):
<round_to_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfff,%rax
cmp    $0x0,%rax
jne    1129 <round_to_page+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113d <round_to_page+0x3d>
mov    -0x10(%rbp),%rax
shr    $0xc,%rax
add    $0x1,%rax
shl    $0xc,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_page>:
lea    0x1000(%rdi),%rax
and    $0xfffffffffffff000,%rax
test   $0xfff,%edi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @round_to_page(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = urem i64 %4, 4096
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i64, i64* %3
store i64 %8, i64* %2
br label %14
9: ; preds = %1
%10 = load i64, i64* %3
%11 = udiv i64 %10, 4096
%12 = add i64 %11, 1
%13 = mul i64 %12, 4096
store i64 %13, i64* %2
br label %14
14: ; preds = %9, %7
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @round_to_page(i64 %0) {
%2 = and i64 %0, 4095
%3 = icmp eq i64 %2, 0
%4 = add i64 %0, 4096
%5 = and i64 %4, -4096
%6 = select i1 %3, i64 %0, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  x = 3;
  x = x * 4;
  assert(x == 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 4
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 12
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, char);
void print_char(char c) { outb(0xe9, c); }


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xe9,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
mov    %edi,%esi
mov    $0xe9,%edi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @print_char(i8 signext %0) {
%2 = tail call i32 @outb(i32 233, i8 signext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void skip_uint64_t(void **data, uint16_t *size) {
  assert(*size >= sizeof(uint64_t));
  *size -= sizeof(uint64_t);
  (*(uint64_t **)data)++;
}


x86 assembly (clang, -O0):
<skip_uint64_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
cmp    $0x4,%rax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movslq (%rax),%rcx
sub    $0x4,%rcx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_uint64_t>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmpl   $0x4,(%rsi)
setae  %dil
call   1030 <assert@plt>
addl   $0xfffffffc,(%rbx)
addq   $0x4,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @skip_uint64_t(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = icmp uge i64 %7, 4
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = sub i64 %13, 4
%15 = trunc i64 %14 to i32
store i32 %15, i32* %11
%16 = load i8**, i8*** %3
%17 = bitcast i8** %16 to i32**
%18 = load i32*, i32** %17
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %17
ret void
}

LLVM IR (-O2):
define void @skip_uint64_t(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp ugt i32 %3, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* %1
%8 = add i32 %7, -4
store i32 %8, i32* %1
%9 = bitcast i8** %0 to i32**
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32* %11, i32** %9
ret void
}
void g2(int x[]) {
  int i;
  for (i = 0; i <= 0; i++) {
    x[i] = i;
  }
}


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1135 <g2+0x35>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <g2+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @g2(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_alpha_mirror(char *);
int /*<<< orphan*/ ft_putchar(char);
int main(int argc, char **argv) {
  if (argc != 2) {
    ft_putchar('\n');
    return (0);
  }
  ft_alpha_mirror(argv[1]);
  ft_putchar('\n');
  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)
cmpl   $0x2,-0x8(%rbp)
je     1156 <main+0x36>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
jmp    1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ft_alpha_mirror@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1030 <ft_alpha_mirror@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@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 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @ft_putchar(i8 signext 10)
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @ft_alpha_mirror(i8* %13)
%15 = call i32 @ft_putchar(i8 signext 10)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_alpha_mirror(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart0SendString(unsigned char *);
void printS(char *buf) { uart0SendString((unsigned char *)buf); }


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

x86 assembly (clang, -O2):
<printS>:
jmp    1030 <uart0SendString@plt>

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

LLVM IR (-O2):
define void @printS(i8* %0) {
%2 = tail call i32 @uart0SendString(i8* %0)
ret void
}
/* Variables and functions */
double pow(double, double);
double farthest_planet(double star_mass_r) {
  return (50.0 * pow(star_mass_r, (1.0 / 3.0)));
}


x86 assembly (clang, -O0):
<farthest_planet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<farthest_planet>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @farthest_planet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FD5555555555555)
%5 = fmul double 5.000000e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @farthest_planet(double %0) {
%2 = tail call double @pow(double %0, double 0x3FD5555555555555)
%3 = fmul double %2, 5.000000e+01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void VBUS_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @VBUS_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @VBUS_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Type definitions */
struct active_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ active_list_clear(struct active_list *);
int /*<<< orphan*/ free(struct active_list *);
void active_list_head_delete(struct active_list *head) {
  active_list_clear(head);
  free(head);
}


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

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

LLVM IR (-O0):
%struct.active_list = type { i32 }
define void @active_list_head_delete(%struct.active_list* %0) {
%2 = alloca %struct.active_list*
store %struct.active_list* %0, %struct.active_list** %2
%3 = load %struct.active_list*, %struct.active_list** %2
%4 = call i32 @active_list_clear(%struct.active_list* %3)
%5 = load %struct.active_list*, %struct.active_list** %2
%6 = call i32 @free(%struct.active_list* %5)
ret void
}

LLVM IR (-O2):
%struct.active_list = type { i32 }
define void @active_list_head_delete(%struct.active_list* %0) {
%2 = tail call i32 @active_list_clear(%struct.active_list* %0)
%3 = tail call i32 @free(%struct.active_list* %0)
ret void
}
void handle_WAITING(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_WAITING(i32 %0) {
ret void
}
/* Variables and functions */
char *GlobalEntity_GetIndex(char const *);
int GlobalEntity_AddToCounter(const char *pGlobalName, int delta) {
  return GlobalEntity_AddToCounter(GlobalEntity_GetIndex(pGlobalName), delta);
}


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

x86 assembly (clang, -O2):
<GlobalEntity_AddToCounter>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <GlobalEntity_GetIndex@plt>
mov    %rax,%rdi
jmp    1120 <GlobalEntity_AddToCounter+0x10>

LLVM IR (-O0):
define i32 @GlobalEntity_AddToCounter(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 = call i8* @GlobalEntity_GetIndex(i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @GlobalEntity_AddToCounter(i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @GlobalEntity_AddToCounter(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = tail call i8* @GlobalEntity_GetIndex(i8* %4)
br label %3
}
XMapWindow() {}


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

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

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

LLVM IR (-O2):
define i32 @XMapWindow() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ GPIO1_INT3_DriverIRQHandler();
__attribute__((weak)) void GPIO1_INT3_IRQHandler(void) {
  GPIO1_INT3_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPIO1_INT3_IRQHandler() {
%1 = call i32 (...) @GPIO1_INT3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPIO1_INT3_IRQHandler() {
%1 = tail call i32 (...) @GPIO1_INT3_DriverIRQHandler()
ret void
}
/* Variables and functions */
int write(int, void *, int);
int socket_write(int sockfd, void *data, int siz) {
  int written = 0;
  if ((written = write(sockfd, data, siz)) < 0) {
    return -1;
  }
  return written;
}


x86 assembly (clang, -O0):
<socket_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1150 <socket_write+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <socket_write+0x46>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_write>:
push   %rax
call   1030 <write@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @socket_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
/* Variables and functions */
char *print_vfpu_reg(int, int, char, char, char *);
char *print_vfputriple(int reg, char *output) {
  if ((reg >> 6) & 1) {
    return print_vfpu_reg(reg, 1, 'C', 'R', output);
  } else {
    return print_vfpu_reg(reg, 0, 'C', 'R', output);
  }
}


x86 assembly (clang, -O0):
<print_vfputriple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x6,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1155 <print_vfputriple+0x45>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%r8
mov    $0x1,%esi
mov    $0x43,%edx
mov    $0x52,%ecx
call   1030 <print_vfpu_reg@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <print_vfputriple+0x61>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%r8
xor    %esi,%esi
mov    $0x43,%edx
mov    $0x52,%ecx
call   1030 <print_vfpu_reg@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vfputriple>:
mov    %rsi,%r8
mov    %edi,%esi
shr    $0x6,%esi
and    $0x1,%esi
mov    $0x43,%edx
mov    $0x52,%ecx
jmp    1030 <print_vfpu_reg@plt>

LLVM IR (-O0):
define i8* @print_vfputriple(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = ashr i32 %6, 6
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = call i8* @print_vfpu_reg(i32 %11, i32 1, i8 signext 67, i8 signext 82, i8* %12)
store i8* %13, i8** %3
br label %18
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i8*, i8** %5
%17 = call i8* @print_vfpu_reg(i32 %15, i32 0, i8 signext 67, i8 signext 82, i8* %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %14, %10
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @print_vfputriple(i32 %0, i8* %1) {
%3 = lshr i32 %0, 6
%4 = and i32 %3, 1
%5 = tail call i8* @print_vfpu_reg(i32 %0, i32 %4, i8 signext 67, i8 signext 82, i8* %1)
ret i8* %5
}
void foo088() {}


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

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

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

LLVM IR (-O2):
define void @foo088() {
ret void
}
int __attribute__((target("default"))) redef2(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @redef2() {
ret i32 1
}

LLVM IR (-O2):
define i32 @redef2() {
ret i32 1
}
int elog_clear(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @elog_clear() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @elog_clear() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int /*<<< orphan*/, int *, int *, int *, int *);
int have_cpuid(void) {
  int eax, ebx, ecx, edx;
  cpuid(0, &eax, &ebx, &ecx, &edx);
  return eax;
}


x86 assembly (clang, -O0):
<have_cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_cpuid>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %edi,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @have_cpuid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @cpuid(i32 0, i32* %1, i32* %2, i32* %3, i32* %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @have_cpuid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 0, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct fmtctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _out(struct fmtctx *, char);
void _fmtpct(struct fmtctx *ctx, char c, va_list va) {
  (void)c;
  (void)va;
  _out(ctx, '%');
}


x86 assembly (clang, -O0):
<_fmtpct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x25,%esi
call   1030 <_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fmtpct>:
mov    $0x25,%esi
jmp    1030 <_out@plt>

LLVM IR (-O0):
%struct.fmtctx = type { i32 }
define void @_fmtpct(%struct.fmtctx* %0, i8 signext %1, i32 %2) {
%4 = alloca %struct.fmtctx*
%5 = alloca i8
%6 = alloca i32
store %struct.fmtctx* %0, %struct.fmtctx** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8, i8* %5
%8 = load i32, i32* %6
%9 = load %struct.fmtctx*, %struct.fmtctx** %4
%10 = call i32 @_out(%struct.fmtctx* %9, i8 signext 37)
ret void
}

LLVM IR (-O2):
%struct.fmtctx = type { i32 }
define void @_fmtpct(%struct.fmtctx* %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @_out(%struct.fmtctx* %0, i8 signext 37)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
int CanSee(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ LevelOf(int /*<<< orphan*/);
int /*<<< orphan*/ Me();
int Cnd_CanSee(void) { return (CanSee(LevelOf(Me()), ArgItem())); }


x86 assembly (clang, -O0):
<Cnd_CanSee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <Me@plt>
mov    %eax,%edi
call   1040 <LevelOf@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ArgItem@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <CanSee@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_CanSee>:
push   %rbx
xor    %eax,%eax
call   1060 <Me@plt>
mov    %eax,%edi
call   1040 <LevelOf@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <ArgItem@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <CanSee@plt>

LLVM IR (-O0):
define i32 @Cnd_CanSee() {
%1 = call i32 (...) @Me()
%2 = call i32 @LevelOf(i32 %1)
%3 = call i32 (...) @ArgItem()
%4 = call i32 @CanSee(i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @Cnd_CanSee() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 @LevelOf(i32 %1)
%3 = tail call i32 (...) @ArgItem()
%4 = tail call i32 @CanSee(i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
float random_between_a_and_b(float, float);
float random_between_two_float(float min, float max) {
  float result;
  min = min * 1000;
  max = max * 1000;
  result = random_between_a_and_b(min, max);
  result = result / 1000;
  return (result);
}


x86 assembly (clang, -O0):
<random_between_two_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xec4(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <random_between_a_and_b@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe99(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between_two_float>:
push   %rax
movss  0xee7(%rip),%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm2,%xmm1
call   1030 <random_between_a_and_b@plt>
divss  0xed2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_between_two_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fmul float %6, 1.000000e+03
store float %7, float* %3
%8 = load float, float* %4
%9 = fmul float %8, 1.000000e+03
store float %9, float* %4
%10 = load float, float* %3
%11 = load float, float* %4
%12 = call float @random_between_a_and_b(float %10, float %11)
store float %12, float* %5
%13 = load float, float* %5
%14 = fdiv float %13, 1.000000e+03
store float %14, float* %5
%15 = load float, float* %5
ret float %15
}

LLVM IR (-O2):
define float @random_between_two_float(float %0, float %1) {
%3 = fmul float %0, 1.000000e+03
%4 = fmul float %1, 1.000000e+03
%5 = tail call float @random_between_a_and_b(float %3, float %4)
%6 = fdiv float %5, 1.000000e+03
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ pool_return(void *);
void mlt_pool_release(void *release) { pool_return(release); }


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

x86 assembly (clang, -O2):
<mlt_pool_release>:
jmp    1030 <pool_return@plt>

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

LLVM IR (-O2):
define void @mlt_pool_release(i8* %0) {
%2 = tail call i32 @pool_return(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t align(uint32_t base, uint32_t alignment) {
  uint32_t ret;
  if (alignment) {
    ret = (base + alignment - 1);
    ret &= ~(alignment - 1);
  } else {
    ret = base;
  }
  return ret;
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1134 <align+0x34>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113a <align+0x3a>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %esi,%eax
neg    %eax
and    %ecx,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @align(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 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = xor i32 %14, -1
%16 = load i32, i32* %5
%17 = and i32 %16, %15
store i32 %17, i32* %5
br label %20
18: ; preds = %2
%19 = load i32, i32* %3
store i32 %19, i32* %5
br label %20
20: ; preds = %18, %8
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @align(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add i32 %0, -1
%5 = add i32 %4, %1
%6 = sub i32 0, %1
%7 = and i32 %5, %6
%8 = select i1 %3, i32 %0, i32 %7
ret i32 %8
}
void gdk_drag_action_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_action_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rotate_text(char *);
void direct_mode(char *a) {
  char *s = a;
  rotate_text(s);
  printf("Rotated text: %s\n", s);
  exit(0);
}


x86 assembly (clang, -O0):
<direct_mode>:
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   1040 <rotate_text@plt>
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<direct_mode>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rotate_text@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Rotated text: %s\0A\00"
define void @direct_mode(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 = call i32 @rotate_text(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"Rotated text: %s\0A\00"
define void @direct_mode(i8* %0) {
%2 = tail call i32 @rotate_text(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}