xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t get_le32(const uint8_t *ptr) {
  return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
}


x86 assembly (clang, -O0):
<get_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le32>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_le32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = shl i32 %18, 24
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_le32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
void RGMlockcur(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @DebugStep() {
ret void
}
char *test_func_01(char *p, int *x) {
  int r = 0;
  r += *p++;
  r += *p++;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
<test_func_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_01>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%edx
lea    0x3(%rdi),%rax
add    %ecx,%edx
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define i8* @test_func_01(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = add nsw i32 %10, %9
store i32 %11, i32* %5
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8, i8* %18
%21 = sext i8 %20 to i32
%22 = load i32, i32* %5
%23 = add nsw i32 %22, %21
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = load i32*, i32** %4
store i32 %24, i32* %25
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @test_func_01(i8* %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, %5
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
%13 = add nsw i32 %9, %12
store i32 %13, i32* %1
ret i8* %10
}
/* Type definitions */
struct feed_tty {
  int dummy;
};

/* Variables and functions */
char feed_tty_clear(struct feed_tty *const, int /*<<< orphan*/);
char feed_tty_clear_bottom(struct feed_tty *const p_tty) {
  return feed_tty_clear(p_tty, 0);
}


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

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

LLVM IR (-O0):
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_clear_bottom(%struct.feed_tty* %0) {
%2 = alloca %struct.feed_tty*
store %struct.feed_tty* %0, %struct.feed_tty** %2
%3 = load %struct.feed_tty*, %struct.feed_tty** %2
%4 = call signext i8 @feed_tty_clear(%struct.feed_tty* %3, i32 0)
ret i8 %4
}

LLVM IR (-O2):
%struct.feed_tty = type { i32 }
define signext i8 @feed_tty_clear_bottom(%struct.feed_tty* %0) {
%2 = tail call signext i8 @feed_tty_clear(%struct.feed_tty* %0, i32 0)
ret i8 %2
}
/* Variables and functions */
__attribute__((visibility("default"))) const char *
sd_utf8_is_valid(const char *s) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_utf8_is_valid(i8* nocapture readnone %0) {
ret i8* null
}
int test_imm_67uint8_reg(unsigned char val) {
  return ((val) & (0x67 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_67uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x67,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_67uint8_reg>:
test   $0x67,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_67uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 103
%6 = icmp ne i32 %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_67uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 103
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ungetc(int, int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundmpx_ungetc(int c,
                                                               FILE *stream) {
  return ungetc(c, stream);
}


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

x86 assembly (clang, -O2):
<softboundmpx_ungetc>:
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_ungetc(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 = call i32 @ungetc(i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @softboundmpx_ungetc(i32 %0, i32* %1) {
%3 = tail call i32 @ungetc(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int f(int);
int main(void) { return f(8) + 1; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 8)
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 8)
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
void strappend(char *s, char *add) {
  s += strlen(s);
  while (*add != 0) {
    *s = *add;
    s++;
    add++;
  }
}


x86 assembly (clang, -O0):
<strappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1172 <strappend+0x62>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <strappend+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strappend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    (%r14),%cl
test   %cl,%cl
je     1141 <strappend+0x31>
cltq
add    %rax,%rbx
xor    %eax,%eax
nopl   (%rax)
mov    %cl,(%rbx,%rax,1)
movzbl 0x1(%r14,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1130 <strappend+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strappend(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %2
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %6, %9
%10 = phi i8 [ %15, %9 ], [ %4, %6 ]
%11 = phi i8* [ %14, %9 ], [ %1, %6 ]
%12 = phi i8* [ %13, %9 ], [ %8, %6 ]
store i8 %10, i8* %12
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t sdnv_len(const uint8_t *bp) {
  size_t val_len = 1;
  for (; *bp++ & 0x80; ++val_len)
    ;
  return val_len;
}


x86 assembly (clang, -O0):
<sdnv_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1145 <sdnv_len+0x45>
jmp    1134 <sdnv_len+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sdnv_len+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdnv_len>:
mov    $0x1,%eax
testb  $0x80,(%rdi)
je     111d <sdnv_len+0x1d>
mov    $0x1,%ecx
nop
lea    0x1(%rcx),%rax
testb  $0x80,(%rdi,%rcx,4)
mov    %rax,%rcx
jne    1110 <sdnv_len+0x10>
ret

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

LLVM IR (-O2):
define i64 @sdnv_len(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 1, %1 ]
%7 = phi i32* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = add i64 %6, 1
%10 = load i32, i32* %8
%11 = and i32 %10, 128
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i64 [ 1, %1 ], [ %9, %5 ]
ret i64 %14
}
/* Variables and functions */
void *malloc(size_t);
void *lwm2m_malloc(size_t s) { return malloc(s); }


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

x86 assembly (clang, -O2):
<lwm2m_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @lwm2m_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
char *dll_function();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("dll_function says: %s\n", dll_function());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <dll_function@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"dll_function says: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i8* (...) @dll_function()
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"dll_function says: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @dll_function()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void update_position(int *line, int *column, char c) {
  switch (c) {
  case '\n':
    ++*line;
    *column = 1;
    break;
  case '\t':
    *column += 8;
  default:
    ++*column;
  }
}


x86 assembly (clang, -O0):
<update_position>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x9,%eax
je     1151 <update_position+0x51>
jmp    1126 <update_position+0x26>
mov    -0x18(%rbp),%eax
sub    $0xa,%eax
jne    115c <update_position+0x5c>
jmp    1137 <update_position+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1167 <update_position+0x67>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x8,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_position>:
cmp    $0x9,%edx
je     1115 <update_position+0x15>
cmp    $0xa,%edx
jne    111c <update_position+0x1c>
addl   $0x1,(%rdi)
mov    $0x1,%eax
mov    %eax,(%rsi)
ret
mov    (%rsi),%eax
add    $0x8,%eax
jmp    111e <update_position+0x1e>
mov    (%rsi),%eax
add    $0x1,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @update_position(i32* %0, i32* %1, i8 signext %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %18 [
i32 10, label %9
i32 9, label %14
]
9: ; preds = %3
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i32*, i32** %5
store i32 1, i32* %13
br label %22
14: ; preds = %3
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 8
store i32 %17, i32* %15
br label %18
18: ; preds = %3, %14
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
store i32 %21, i32* %19
br label %22
22: ; preds = %18, %9
ret void
}

LLVM IR (-O2):
define void @update_position(i32* nocapture %0, i32* nocapture %1, i8 signext %2) {
%4 = sext i8 %2 to i32
switch i32 %4, label %5 [
i32 10, label %7
i32 9, label %10
]
5: ; preds = %3
%6 = load i32, i32* %1
br label %13
7: ; preds = %3
%8 = load i32, i32* %0
%9 = add nsw i32 %8, 1
store i32 %9, i32* %0
br label %16
10: ; preds = %3
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 8
br label %13
13: ; preds = %5, %10
%14 = phi i32 [ %6, %5 ], [ %12, %10 ]
%15 = add nsw i32 %14, 1
br label %16
16: ; preds = %13, %7
%17 = phi i32 [ %15, %13 ], [ 1, %7 ]
store i32 %17, i32* %1
ret void
}
void statFreeColumnBatch(void) {}


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

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

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

LLVM IR (-O2):
define void @statFreeColumnBatch() {
ret void
}
int UtfCount(ch)
int ch;
{
  if ((ch > 0) && (ch < 0x80)) {
    return 1;
  }
  if (ch <= 0x7FF) {
    return 2;
  }
  if (ch <= 0xFFFF) {
    return 3;
  }
  return 3;
}


x86 assembly (clang, -O0):
<UtfCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112a <UtfCount+0x2a>
cmpl   $0x80,-0x8(%rbp)
jge    112a <UtfCount+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1163 <UtfCount+0x63>
cmpl   $0x7ff,-0x8(%rbp)
jg     1143 <UtfCount+0x43>
movl   $0x2,-0x4(%rbp)
jmp    1163 <UtfCount+0x63>
cmpl   $0xffff,-0x8(%rbp)
jg     115c <UtfCount+0x5c>
movl   $0x3,-0x4(%rbp)
jmp    1163 <UtfCount+0x63>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UtfCount>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x800,%edi
setl   %cl
xor    $0x3,%ecx
cmp    $0x7f,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @UtfCount(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 128
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %19
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 2047
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 2, i32* %2
br label %19
14: ; preds = %10
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 65535
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 3, i32* %2
br label %19
18: ; preds = %14
store i32 3, i32* %2
br label %19
19: ; preds = %18, %17, %13, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @UtfCount(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 127
%4 = icmp slt i32 %0, 2048
%5 = select i1 %4, i32 2, i32 3
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
void pmu_enable_4V_harvesting() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_button_get_use_stock() {
ret void
}
int g(long long a, long long b, int c) {
  int d = a != b;
  return d + c;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @g(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = icmp ne i64 %8, %9
%11 = zext i1 %10 to i32
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @g(i64 %0, i64 %1, i32 %2) {
%4 = icmp ne i64 %0, %1
%5 = zext i1 %4 to i32
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
char *strchr(char const *, char);
int cow_str_find(const char *str, char c) {
  char *p = strchr(str, c);
  return (p) ? (p - str) : -1;
}


x86 assembly (clang, -O0):
<cow_str_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <cow_str_find+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <cow_str_find+0x52>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <cow_str_find+0x52>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow_str_find>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cow_str_find(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i8* @strchr(i8* %6, i8 signext %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
br label %18
17: ; preds = %2
br label %18
18: ; preds = %17, %11
%19 = phi i64 [ %16, %11 ], [ -1, %17 ]
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cow_str_find(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
double sample_Gam(double, double);
double initialize_alpha() {
  double alpha;
  alpha = sample_Gam(1.0, 1.0);
  return (alpha);
}


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

x86 assembly (clang, -O2):
<initialize_alpha>:
movsd  0xee8(%rip),%xmm0
movaps %xmm0,%xmm1
jmp    1030 <sample_Gam@plt>

LLVM IR (-O0):
define double @initialize_alpha() {
%1 = alloca double
%2 = call double @sample_Gam(double 1.000000e+00, double 1.000000e+00)
store double %2, double* %1
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @initialize_alpha() {
%1 = tail call double @sample_Gam(double 1.000000e+00, double 1.000000e+00)
ret double %1
}
/* Variables and functions */
char *strdup(char *);
char *StripLeading(char *string) { return strdup(string + 1); }


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

x86 assembly (clang, -O2):
<StripLeading>:
add    $0x1,%rdi
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @StripLeading(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = call i8* @strdup(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @StripLeading(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i8* @strdup(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ handleError(char);
int serial_waitc(void) {
  char mySSR;
  mySSR = (*((volatile unsigned char *)0x05FFFECC)) & (0x08 | 0x10 | 0x20);
  if (mySSR)
    handleError(mySSR);
  return (*((volatile unsigned char *)0x05FFFECC)) & 0x40;
}


x86 assembly (clang, -O0):
<serial_waitc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5fffecc,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x38,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113b <serial_waitc+0x2b>
movsbl -0x1(%rbp),%edi
call   1030 <handleError@plt>
mov    $0x5fffecc,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x40,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_waitc>:
push   %rax
mov    0x5fffecc,%al
and    $0x38,%al
je     1124 <serial_waitc+0x14>
movsbl %al,%edi
call   1030 <handleError@plt>
movzbl 0x5fffecc,%eax
05
and    $0x40,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_waitc() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 56
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i8, i8* %1
%10 = call i32 @handleError(i8 signext %9)
br label %11
11: ; preds = %8, %0
%12 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%13 = zext i8 %12 to i32
%14 = and i32 %13, 64
ret i32 %14
}

LLVM IR (-O2):
define i32 @serial_waitc() {
%1 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%2 = and i8 %1, 56
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @handleError(i8 signext %2)
br label %6
6: ; preds = %4, %0
%7 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%8 = and i8 %7, 64
%9 = zext i8 %8 to i32
ret i32 %9
}
void view_goToTop(void) {}


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

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

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

LLVM IR (-O2):
define void @view_goToTop() {
ret void
}
double rho_ruby_get_double(unsigned long val) { return 0; }


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

x86 assembly (clang, -O2):
<rho_ruby_get_double>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @rho_ruby_get_double(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @rho_ruby_get_double(i64 %0) {
ret double 0.000000e+00
}
int bq24261_get_bat_status(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @bq24261_get_bat_status() {
ret i32 0
}

LLVM IR (-O2):
define i32 @bq24261_get_bat_status() {
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t reverseBits_fun_int32_t(int32_t x) {
  int32_t r = x;
  int i = 31;
  for (x = x >> 1 & 0x7fffffff; x; x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x7fffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1154 <reverseBits_fun_int32_t+0x54>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <reverseBits_fun_int32_t+0x22>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_int32_t>:
mov    $0x1f,%ecx
cmp    $0x2,%edi
jae    110e <reverseBits_fun_int32_t+0xe>
mov    %edi,%eax
jmp    1134 <reverseBits_fun_int32_t+0x34>
mov    $0x1f,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
shr    %edx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <reverseBits_fun_int32_t+0x20>
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @reverseBits_fun_int32_t(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
store i32 31, i32* %4
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = and i32 %7, 2147483647
store i32 %8, i32* %2
br label %9
9: ; preds = %20, %1
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
%15 = load i32, i32* %2
%16 = and i32 %15, 1
%17 = or i32 %14, %16
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %20
20: ; preds = %12
%21 = load i32, i32* %2
%22 = ashr i32 %21, 1
store i32 %22, i32* %2
br label %9
23: ; preds = %9
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = shl i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @reverseBits_fun_int32_t(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 31, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = lshr i32 %4, 1
%8 = shl i32 %6, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i32 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 31, %1 ], [ %11, %3 ]
%16 = shl i32 %14, %15
ret i32 %16
}
int BGBDT_MsImaAdpcm_StereoSamplesFromBlockSize(int sz) { return (sz - 8); }


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

x86 assembly (clang, -O2):
<BGBDT_MsImaAdpcm_StereoSamplesFromBlockSize>:
lea    -0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @BGBDT_MsImaAdpcm_StereoSamplesFromBlockSize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 8
ret i32 %4
}

LLVM IR (-O2):
define i32 @BGBDT_MsImaAdpcm_StereoSamplesFromBlockSize(i32 %0) {
%2 = add nsw i32 %0, -8
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ disconnectWebservice();
int /*<<< orphan*/ init();
void reset(void) {
  disconnectWebservice();
  init();
}


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

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

LLVM IR (-O0):
define void @reset() {
%1 = call i32 (...) @disconnectWebservice()
%2 = call i32 (...) @init()
ret void
}

LLVM IR (-O2):
define void @reset() {
%1 = tail call i32 (...) @disconnectWebservice()
%2 = tail call i32 (...) @init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
rd_fatal() { fatal("Read error\n"); }


x86 assembly (clang, -O0):
<rd_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <fatal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Read error\0A\00"
define i32 @rd_fatal() {
%1 = alloca i32
%2 = call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [12 x i8] c"Read error\0A\00"
define i32 @rd_fatal() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ luaL_opt_number(int, int /*<<< orphan*/);
int /*<<< orphan*/ lua_collectgarbage(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void luaB_collectgarbage(void) {
  lua_pushnumber(lua_collectgarbage(((int)luaL_opt_number(1, 0))));
}


x86 assembly (clang, -O0):
<luaB_collectgarbage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <luaL_opt_number@plt>
mov    %eax,%edi
call   1050 <lua_collectgarbage@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaB_collectgarbage>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <luaL_opt_number@plt>
mov    %eax,%edi
call   1050 <lua_collectgarbage@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @luaB_collectgarbage() {
%1 = call i64 @luaL_opt_number(i32 1, i32 0)
%2 = trunc i64 %1 to i32
%3 = call i32 @lua_collectgarbage(i32 %2)
%4 = call i32 @lua_pushnumber(i32 %3)
ret void
}

LLVM IR (-O2):
define void @luaB_collectgarbage() {
%1 = tail call i64 @luaL_opt_number(i32 1, i32 0)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @lua_collectgarbage(i32 %2)
%4 = tail call i32 @lua_pushnumber(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MD4_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD4_Final(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD4_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD4_Update(int /*<<< orphan*/ *, char const *, size_t);
void md4(const char *buf, size_t len, unsigned char *res) {
  MD4_CTX ctx;
  MD4_Init(&ctx);
  MD4_Update(&ctx, buf, len);
  MD4_Final(res, &ctx);
}


x86 assembly (clang, -O0):
<md4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <MD4_Init@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x1c(%rbp),%rdi
call   1030 <MD4_Update@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <MD4_Final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md4>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1040 <MD4_Init@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <MD4_Update@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <MD4_Final@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @md4(i8* %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @MD4_Init(i32* %4)
%7 = call i32 @MD4_Update(i32* %4, i8* %0, i64 %1)
%8 = call i32 @MD4_Final(i8* %2, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  printf("x = %d\n", x == 0xCAFEBABE ? 99 : 88);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x58,%esi
mov    $0x63,%eax
cmp    $0xcafebabe,%ecx
cmove  %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -889275714
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 99, i32 88
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 88)
ret i32 0
}
/* Variables and functions */
int spctrne(char const *, double, double, double, double, char *, double *,
            double *, int /*<<< orphan*/ *);
int spctrn(const char ctypeS1[9], double crvalS1, double cdeltS1,
           double restfrq, double restwav, char ctypeS2[9], double *crvalS2,
           double *cdeltS2) {
  return spctrne(ctypeS1, crvalS1, cdeltS1, restfrq, restwav, ctypeS2, crvalS2,
                 cdeltS2, NULL);
}


x86 assembly (clang, -O0):
<spctrn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <spctrne@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spctrn>:
xor    %r8d,%r8d
jmp    1030 <spctrne@plt>

LLVM IR (-O0):
define i32 @spctrn(i8* %0, double %1, double %2, double %3, double %4, i8* %5, double* %6, double* %7) {
%9 = alloca i8*
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i8*
%15 = alloca double*
%16 = alloca double*
store i8* %0, i8** %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store i8* %5, i8** %14
store double* %6, double** %15
store double* %7, double** %16
%17 = load i8*, i8** %9
%18 = load double, double* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = load double, double* %13
%22 = load i8*, i8** %14
%23 = load double*, double** %15
%24 = load double*, double** %16
%25 = call i32 @spctrne(i8* %17, double %18, double %19, double %20, double %21, i8* %22, double* %23, double* %24, i32* null)
ret i32 %25
}

LLVM IR (-O2):
define i32 @spctrn(i8* %0, double %1, double %2, double %3, double %4, i8* %5, double* %6, double* %7) {
%9 = tail call i32 @spctrne(i8* %0, double %1, double %2, double %3, double %4, i8* %5, double* %6, double* %7, i32* null)
ret i32 %9
}
int fun858() { return 858; }


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

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

LLVM IR (-O0):
define i32 @fun858() {
ret i32 858
}

LLVM IR (-O2):
define i32 @fun858() {
ret i32 858
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t, char *, char *);
void wtypeStr_foreachIndexPrint(const void *element, size_t index,
                                const void *foreachData) {
  printf("%zu/%s%s", index, (char *)element,
         foreachData ? (char *)foreachData : "");
}


x86 assembly (clang, -O0):
<wtypeStr_foreachIndexPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <wtypeStr_foreachIndexPrint+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <wtypeStr_foreachIndexPrint+0x4c>
lea    0xeb5(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <wtypeStr_foreachIndexPrint+0x4c>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rcx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtypeStr_foreachIndexPrint>:
mov    %rdi,%rax
test   %rdx,%rdx
lea    0xeeb(%rip),%rcx
cmovne %rdx,%rcx
lea    0xed8(%rip),%rdi
mov    %rax,%rdx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%zu/%s%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @wtypeStr_foreachIndexPrint(i8* %0, i64 %1, i8* %2) {
%4 = icmp eq i8* %2, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %1, i8* %0, i8* %5)
ret void
}
OP(op, e7) { RST(0x20); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x20,%edi
mov    $0x0,%al
call   1030 <RST@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
mov    $0x20,%edi
xor    %eax,%eax
jmp    1030 <RST@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 32)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @RST to i32 (i32, ...)*)(i32 32)
ret i32 undef
}
int compare_ptrs(const void *k1, const void *k2) { return (k1 == k2); }


x86 assembly (clang, -O0):
<compare_ptrs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ptrs>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @compare_ptrs(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @compare_ptrs(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void refund() {
  printf("Your order has been refunded. Sorry for the inconvenience.\n");
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"Your order has been refunded. Sorry for the inconvenience.\0A\00"
define void @refund() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [59 x i8] c"Your order has been refunded. Sorry for the inconvenience.\00"
define void @refund() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void TimerDMAEventSet(uint32_t ui32Base, uint32_t ui32DMAEvent) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000006C))) = ui32DMAEvent;
}


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

x86 assembly (clang, -O2):
<TimerDMAEventSet>:
mov    %rsi,0x6c(%rdi)
ret

LLVM IR (-O0):
define void @TimerDMAEventSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 108
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerDMAEventSet(i64 %0, i64 %1) {
%3 = add i64 %0, 108
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pinctrl = type opaque
%struct.pinctrl_dev = type opaque
define i32 @pinctrl_dt_to_map(%struct.pinctrl* %0, %struct.pinctrl_dev* %1) {
%3 = alloca %struct.pinctrl*
%4 = alloca %struct.pinctrl_dev*
store %struct.pinctrl* %0, %struct.pinctrl** %3
store %struct.pinctrl_dev* %1, %struct.pinctrl_dev** %4
ret i32 0
}

LLVM IR (-O2):
%struct.pinctrl = type opaque
%struct.pinctrl_dev = type opaque
define i32 @pinctrl_dt_to_map(%struct.pinctrl* nocapture readnone %0, %struct.pinctrl_dev* nocapture readnone %1) {
ret i32 0
}
void ProcAfter(int x) {}


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

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

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

LLVM IR (-O2):
define void @ProcAfter(i32 %0) {
ret void
}
void XtCreateSelectionRequest() {}


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

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

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

LLVM IR (-O2):
define void @XtCreateSelectionRequest() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_player();
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ cleanup_zombies();
void cleanup_game(void) {
  cleanup_screen();
  cleanup_player();
  cleanup_zombies();
}


x86 assembly (clang, -O0):
<cleanup_game>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
mov    $0x0,%al
call   1050 <cleanup_player@plt>
mov    $0x0,%al
call   1040 <cleanup_zombies@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_game>:
push   %rax
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
call   1050 <cleanup_player@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup_zombies@plt>

LLVM IR (-O0):
define void @cleanup_game() {
%1 = call i32 (...) @cleanup_screen()
%2 = call i32 (...) @cleanup_player()
%3 = call i32 (...) @cleanup_zombies()
ret void
}

LLVM IR (-O2):
define void @cleanup_game() {
%1 = tail call i32 (...) @cleanup_screen()
%2 = tail call i32 (...) @cleanup_player()
%3 = tail call i32 (...) @cleanup_zombies()
ret void
}