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

/* Variables and functions */
int /*<<< orphan*/ _STAT_VER;
int __xstat(int /*<<< orphan*/, char const *, struct stat *);
int __stat(const char *file, struct stat *buf) {
  return __xstat(_STAT_VER, file, buf);
}


x86 assembly (clang, -O0):
<__stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <__xstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__xstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@_STAT_VER = global i32 0
define i32 @__stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @_STAT_VER
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @__xstat(i32 %5, i8* %6, %struct.stat* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@_STAT_VER = global i32 0
define i32 @__stat(i8* %0, %struct.stat* %1) {
%3 = load i32, i32* @_STAT_VER
%4 = tail call i32 @__xstat(i32 %3, i8* %0, %struct.stat* %1)
ret i32 %4
}
/* Variables and functions */
char *NESConvertTileDataToRom(char *compositeData, int size) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @NESConvertTileDataToRom(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @NESConvertTileDataToRom(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ private_array_check(int *);
void initialize_array() {
  int i, numbers[20];
  while (i < 20) {
    numbers[i] = i + 1;
    i++;
  }
  private_array_check(numbers);
}


x86 assembly (clang, -O0):
<initialize_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
cmpl   $0x14,-0x4(%rbp)
jge    113e <initialize_array+0x2e>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1118 <initialize_array+0x8>
lea    -0x60(%rbp),%rdi
call   1030 <private_array_check@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_array>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1030 <private_array_check@plt>
add    $0x58,%rsp
ret

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

LLVM IR (-O2):
define void @initialize_array() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @private_array_check(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a();
__attribute__((no)) void test_trap() { a(); }


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

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

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

LLVM IR (-O2):
define void @test_trap() {
%1 = tail call i32 (...) @a()
ret void
}
/* Variables and functions */
char *ctime(long *);
int /*<<< orphan*/ printf(char *, char *);
void show_time(long time) {
  char *cp;
  cp = ctime(&time);
  printf("%s", cp);
}


x86 assembly (clang, -O0):
<show_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_time>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <ctime@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @show_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i8* @ctime(i64* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void fn_test3(void) {
  int ia, ib;
  ia++;
  ib++;
  printf("fn_test3: %d, %d\n", ia, ib);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"fn_test3: %d, %d\0A\00"
define void @fn_test3() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef)
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t min32(int32_t a, int32_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<min32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
size_t CMSG_SPACE(size_t);
size_t cmsg_space(size_t length) { return CMSG_SPACE(length); }


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

x86 assembly (clang, -O2):
<cmsg_space>:
jmp    1030 <CMSG_SPACE@plt>

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

LLVM IR (-O2):
define i64 @cmsg_space(i64 %0) {
%2 = tail call i64 @CMSG_SPACE(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void firePlayerMissle() { printf("fire missile\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"fire missile\00"
define void @firePlayerMissle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ cmp1(void const *, void const *);
scalar_t__ cmp4(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool cmp5(const void *a, const void *b) {
  return cmp1(a, b) && cmp4((uint8_t *)a + 1, (uint8_t *)b + 1);
}


x86 assembly (clang, -O0):
<cmp5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cmp1@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116e <cmp5+0x4e>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1040 <cmp4@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp5>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cmp1@plt>
test   %rax,%rax
je     1154 <cmp5+0x34>
add    $0x4,%rbx
add    $0x4,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <cmp4@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1156 <cmp5+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmp5(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 = call i64 @cmp1(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = call i64 @cmp4(i32* %12, i32* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmp5(i8* %0, i8* %1) {
%3 = tail call i64 @cmp1(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i8, i8* %1, i64 4
%9 = bitcast i8* %8 to i32*
%10 = tail call i64 @cmp4(i32* %7, i32* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_words(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char *a = "  abcde   fg ";
  char s[32];
  strcpy(s, a);
  printf("%s\n", s);
  reverse_words(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <reverse_words@plt>
lea    -0x40(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xec2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xebe(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <reverse_words@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c" abcde fg \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %6
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%14 = call i32 @reverse_words(i8* %13)
%15 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c" abcde fg \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @reverse_words(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
int f(_Bool x) {
  if (x == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
jne    1129 <f+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1130 <f+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = zext i1 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = trunc i8 %5 to i1
%7 = zext i1 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i1 zeroext %0) {
%2 = zext i1 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lcd_control_init();
int /*<<< orphan*/ lcd_port_init();
void lcd_init() {
  lcd_port_init();
  lcd_control_init();
  (*(volatile unsigned long *)0x56000060) |= (0x3 << 8);
  (*(volatile unsigned long *)0x4D000000) |= (1 << 0);
  (*(volatile unsigned long *)0x4D000010) |= (1 << 3);
}


x86 assembly (clang, -O0):
<lcd_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lcd_port_init@plt>
mov    $0x0,%al
call   1030 <lcd_control_init@plt>
mov    $0x56000060,%eax
mov    (%rax),%rcx
or     $0x300,%rcx
mov    $0x56000060,%eax
mov    %rcx,(%rax)
mov    $0x4d000000,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x4d000000,%eax
mov    %rcx,(%rax)
mov    $0x4d000010,%eax
mov    (%rax),%rcx
or     $0x8,%rcx
mov    $0x4d000010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_init>:
push   %rax
xor    %eax,%eax
call   1040 <lcd_port_init@plt>
xor    %eax,%eax
call   1030 <lcd_control_init@plt>
orq    $0x300,0x56000060
orq    $0x1,0x4d000000
4d 01
orq    $0x8,0x4d000010
4d 08
pop    %rax
ret

LLVM IR (-O0):
define void @lcd_init() {
%1 = call i32 (...) @lcd_port_init()
%2 = call i32 (...) @lcd_control_init()
%3 = load volatile i64, i64* inttoptr (i64 1442840672 to i64*)
%4 = or i64 %3, 768
store volatile i64 %4, i64* inttoptr (i64 1442840672 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1291845632 to i64*)
%6 = or i64 %5, 1
store volatile i64 %6, i64* inttoptr (i64 1291845632 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1291845648 to i64*)
%8 = or i64 %7, 8
store volatile i64 %8, i64* inttoptr (i64 1291845648 to i64*)
ret void
}

LLVM IR (-O2):
define void @lcd_init() {
%1 = tail call i32 (...) @lcd_port_init()
%2 = tail call i32 (...) @lcd_control_init()
%3 = load volatile i64, i64* inttoptr (i64 1442840672 to i64*)
%4 = or i64 %3, 768
store volatile i64 %4, i64* inttoptr (i64 1442840672 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1291845632 to i64*)
%6 = or i64 %5, 1
store volatile i64 %6, i64* inttoptr (i64 1291845632 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1291845648 to i64*)
%8 = or i64 %7, 8
store volatile i64 %8, i64* inttoptr (i64 1291845648 to i64*)
ret void
}
int do_432() { return 432; }


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

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

LLVM IR (-O0):
define i32 @do_432() {
ret i32 432
}

LLVM IR (-O2):
define i32 @do_432() {
ret i32 432
}
/* Variables and functions */
int /*<<< orphan*/ bst_reset(int *, int *, int *, int *);
void rbt_reset(int *items, int *_size, int *left, int *right, int *parent,
               int *color) {
  bst_reset(items, _size, left, right);
}


x86 assembly (clang, -O0):
<rbt_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <bst_reset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbt_reset>:
jmp    1030 <bst_reset@plt>

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

LLVM IR (-O2):
define void @rbt_reset(i32* %0, i32* %1, i32* %2, i32* %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = tail call i32 @bst_reset(i32* %0, i32* %1, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
void test3(void **ptr) {
  if (!ptr || !*ptr)
    return;
  *ptr = NULL;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1121 <test3+0x21>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1126 <test3+0x26>
jmp    1131 <test3+0x31>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
test   %rdi,%rdi
je     1112 <test3+0x12>
cmpq   $0x0,(%rdi)
je     1112 <test3+0x12>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @test3(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %5, %1
br label %12
10: ; preds = %5
%11 = load i8**, i8*** %2
store i8* null, i8** %11
br label %12
12: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @test3(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i8* null, i8** %0
br label %7
7: ; preds = %1, %3, %6
ret void
}
unsigned int min(unsigned int a, unsigned int b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void my_o_m_a_p_kernel_hal_dummy_function(void) {}


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

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

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

LLVM IR (-O2):
define void @my_o_m_a_p_kernel_hal_dummy_function() {
ret void
}
int fun_aa_int_so(int x[][5], int y[][5]) { return 20 + x[0][0] + y[0][0]; }


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

x86 assembly (clang, -O2):
<fun_aa_int_so>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
add    %ecx,%eax
add    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @fun_aa_int_so([5 x i32]* %0, [5 x i32]* %1) {
%3 = alloca [5 x i32]*
%4 = alloca [5 x i32]*
store [5 x i32]* %0, [5 x i32]** %3
store [5 x i32]* %1, [5 x i32]** %4
%5 = load [5 x i32]*, [5 x i32]** %3
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%8 = load i32, i32* %7
%9 = add nsw i32 20, %8
%10 = load [5 x i32]*, [5 x i32]** %4
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %10, i64 0
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%13 = load i32, i32* %12
%14 = add nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fun_aa_int_so([5 x i32]* nocapture %0, [5 x i32]* nocapture %1) {
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 0, i64 0
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 20
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}
void gp2x_deinit() {}


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

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

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

LLVM IR (-O2):
define void @gp2x_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simulate_thread_main();
__attribute__((no)) int main() {
  simulate_thread_main();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @simulate_thread_main()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i = 0;
  int a = 0;
  int b = 3;
  int c = 0;
  int d = 4;
  while (i < 5) {
    a = 5 * b / (2 - b) + d * 2;
    c = i * 2;
    i++;
  }
  __print_int(a);
  __print_int(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    117d <main+0x6d>
imul   $0x5,-0x10(%rbp),%eax
mov    $0x2,%ecx
sub    -0x10(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x14(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 3, i32* %4
store i32 0, i32* %5
store i32 4, i32* %6
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %4
%12 = mul nsw i32 5, %11
%13 = load i32, i32* %4
%14 = sub nsw i32 2, %13
%15 = sdiv i32 %12, %14
%16 = load i32, i32* %6
%17 = mul nsw i32 %16, 2
%18 = add nsw i32 %15, %17
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = mul nsw i32 %19, 2
store i32 %20, i32* %5
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %7
23: ; preds = %7
%24 = load i32, i32* %3
%25 = call i32 @__print_int(i32 %24)
%26 = load i32, i32* %5
%27 = call i32 @__print_int(i32 %26)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 -7)
%2 = tail call i32 @__print_int(i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ gmvread_close();
int /*<<< orphan*/ stderr;
void gmvrdmemerr2() {
  fprintf(stderr, "Not enough memory to fill gmv mesh data.\n");
  gmvread_close();
  exit(0);
}


x86 assembly (clang, -O0):
<gmvrdmemerr2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <gmvread_close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<gmvrdmemerr2>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <gmvread_close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Not enough memory to fill gmv mesh data.\0A\00"
define void @gmvrdmemerr2() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @gmvread_close()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Not enough memory to fill gmv mesh data.\0A\00"
define void @gmvrdmemerr2() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @gmvread_close()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void main() {
  pid_t pid_01, pid_02;
  pid_01 = fork();
  if (pid_01 > 0) {
    wait(NULL);
    printf("father\n");
  } else {
    execl("/bin/ls", "ls", "/arm/", NULL);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1178 <main+0x38>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    1196 <main+0x56>
lea    0xe89(%rip),%rdi
lea    0xe87(%rip),%rsi
lea    0xe83(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <execl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
jle    1161 <main+0x21>
xor    %edi,%edi
call   1050 <wait@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
lea    0xe98(%rip),%rdi
lea    0xe96(%rip),%rsi
lea    0xe92(%rip),%rdx
xor    %ecx,%ecx
pop    %rax
jmp    1040 <execl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"father\0A\00"
@.str.1 = [8 x i8] c"/bin/ls\00"
@.str.2 = [3 x i8] c"ls\00"
@.str.3 = [6 x i8] c"/arm/\00"
define void @main() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @fork()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @wait(i32* null)
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* null)
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/ls\00"
@.str.2 = [3 x i8] c"ls\00"
@.str.3 = [6 x i8] c"/arm/\00"
@str = [7 x i8] c"father\00"
define void @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @wait(i32* null)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* null)
br label %8
8: ; preds = %6, %3
ret void
}
void psync_fs_stop() {}


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

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

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

LLVM IR (-O2):
define void @psync_fs_stop() {
ret void
}
void Test3(void) {
  int i;
  volatile float dummy = 0.0;
  for (i = 0; i < 500000; i++) {
    dummy++;
  }
}


x86 assembly (clang, -O0):
<Test3>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x7a120,-0x4(%rbp)
jge    1144 <Test3+0x44>
movss  -0x8(%rbp),%xmm0
movss  0xed3(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <Test3+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test3>:
movl   $0x0,-0x4(%rsp)
mov    $0x7a120,%eax
movss  0xeeb(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movss  -0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,-0x4(%rsp)
movss  -0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,-0x4(%rsp)
movss  -0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,-0x4(%rsp)
movss  -0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,-0x4(%rsp)
movss  -0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,-0x4(%rsp)
add    $0xfffffffb,%eax
jne    1120 <Test3+0x20>
ret

LLVM IR (-O0):
define void @Test3() {
%1 = alloca i32
%2 = alloca float
store volatile float 0.000000e+00, float* %2
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 500000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load volatile float, float* %2
%8 = fadd float %7, 1.000000e+00
store volatile float %8, float* %2
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @Test3() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store volatile float 0.000000e+00, float* %1
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %15, %3 ]
%5 = load volatile float, float* %1
%6 = fadd float %5, 1.000000e+00
store volatile float %6, float* %1
%7 = load volatile float, float* %1
%8 = fadd float %7, 1.000000e+00
store volatile float %8, float* %1
%9 = load volatile float, float* %1
%10 = fadd float %9, 1.000000e+00
store volatile float %10, float* %1
%11 = load volatile float, float* %1
%12 = fadd float %11, 1.000000e+00
store volatile float %12, float* %1
%13 = load volatile float, float* %1
%14 = fadd float %13, 1.000000e+00
store volatile float %14, float* %1
%15 = add nuw nsw i32 %4, 5
%16 = icmp eq i32 %15, 500000
br i1 %16, label %17, label %3
17: ; preds = %3
ret void
}
int ord(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @ord(i32 returned %0) {
ret i32 %0
}
int PortBurn_FinishStaging(void *handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PortBurn_FinishStaging(i8* nocapture readnone %0) {
ret i32 0
}
int setup_robopig(int green) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setup_robopig(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ParseForCommand(void *);
void msn_callback_handler(void *data) { ParseForCommand(data); }


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

x86 assembly (clang, -O2):
<msn_callback_handler>:
jmp    1030 <ParseForCommand@plt>

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

LLVM IR (-O2):
define void @msn_callback_handler(i8* %0) {
%2 = tail call i32 @ParseForCommand(i8* %0)
ret void
}
int test_imm_C5uint16_reg(unsigned short val) {
  return ((val) & (0xC5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C5uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xc5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int recv_proc(int, int /*<<< orphan*/ *);
void do_client(int sockfd, sqlite3 *db) {
  int ret = 0;
  int len = 0;
  while (1) {
    ret = recv_proc(sockfd, db);
    if (-1 == ret || 0 == ret) {
      break;
    }
  }
  close(sockfd);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<do_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <recv_proc@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
je     1175 <do_client+0x45>
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jne    117a <do_client+0x4a>
jmp    117f <do_client+0x4f>
jmp    114d <do_client+0x1d>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<do_client>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <recv_proc@plt>
add    $0x1,%eax
cmp    $0x1,%eax
ja     1140 <do_client+0x10>
mov    %ebp,%edi
call   1040 <close@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @do_client(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %2, %17
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
%10 = call i32 @recv_proc(i32 %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 -1, %11
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = load i32, i32* %5
%15 = icmp eq i32 0, %14
br i1 %15, label %16, label %17
16: ; preds = %13, %7
br label %18
17: ; preds = %13
br label %7
18: ; preds = %16
%19 = load i32, i32* %3
%20 = call i32 @close(i32 %19)
%21 = load i32, i32* @EXIT_SUCCESS
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @do_client(i32 %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @recv_proc(i32 %0, i32* %1)
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 2
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = tail call i32 @close(i32 %0)
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
int main(void) {
  char a[5] = {1, 2, 3, 4, 5};
  *(char *)(&a[4]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeea(%rip),%al
mov    %al,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i8] c"\01\02\03\04\05"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
%5 = load i8, i8* %4
ret i32 0
}

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

/* Variables and functions */
int Get32(int);
int /*<<< orphan*/ Set32(int, int);
void set_next_tick_default() {
  uint32_t date_lowbits = Get32(0x20003004);
  date_lowbits += 2500000;
  Set32(0x20003010, date_lowbits);
}


x86 assembly (clang, -O0):
<set_next_tick_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20003004,%edi
call   1030 <Get32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2625a0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x20003010,%edi
call   1040 <Set32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_next_tick_default>:
push   %rax
mov    $0x20003004,%edi
call   1030 <Get32@plt>
lea    0x2625a0(%rax),%esi
mov    $0x20003010,%edi
pop    %rax
jmp    1040 <Set32@plt>

LLVM IR (-O0):
define void @set_next_tick_default() {
%1 = alloca i32
%2 = call i32 @Get32(i32 536883204)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 2500000
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @Set32(i32 536883216, i32 %5)
ret void
}

LLVM IR (-O2):
define void @set_next_tick_default() {
%1 = tail call i32 @Get32(i32 536883204)
%2 = add nsw i32 %1, 2500000
%3 = tail call i32 @Set32(i32 536883216, i32 %2)
ret void
}
int xtc_sizeofint(int size) {
  unsigned int num = 1;
  unsigned int ssize = (unsigned int)size;
  int nbits = 0;
  while (ssize >= num && nbits < 32) {
    nbits++;
    num <<= 1;
  }
  return nbits;
}


x86 assembly (clang, -O0):
<xtc_sizeofint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jb     1136 <xtc_sizeofint+0x36>
cmpl   $0x20,-0x10(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1146 <xtc_sizeofint+0x46>
jmp    115d <xtc_sizeofint+0x5d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <xtc_sizeofint+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtc_sizeofint>:
test   %edi,%edi
je     1121 <xtc_sizeofint+0x21>
mov    $0x1,%ecx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdx),%eax
add    %ecx,%ecx
cmp    %edi,%ecx
ja     1120 <xtc_sizeofint+0x20>
cmp    $0x1f,%edx
mov    %eax,%edx
jb     1110 <xtc_sizeofint+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @xtc_sizeofint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
store i32 %6, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %16, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp uge i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 32
br label %14
14: ; preds = %11, %7
%15 = phi i1 [ false, %7 ], [ %13, %11 ]
br i1 %15, label %16, label %21
16: ; preds = %14
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = shl i32 %19, 1
store i32 %20, i32* %3
br label %7
21: ; preds = %14
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @xtc_sizeofint(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 1, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = shl i32 %5, 1
%8 = icmp ule i32 %7, %0
%9 = icmp ult i32 %4, 31
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %12
}
/* Variables and functions */
char *jsonTopoAddDevice(char *, char *, char *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/);
char *jsonTopoAddPlug(char *mac, char *name) {
  return (jsonTopoAddDevice("plg", mac, name, NULL, 0));
}


x86 assembly (clang, -O0):
<jsonTopoAddPlug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <jsonTopoAddDevice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonTopoAddPlug>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <jsonTopoAddDevice@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"plg\00"
define i8* @jsonTopoAddPlug(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 = call i8* @jsonTopoAddDevice(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i32* null, i32 0)
ret i8* %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"plg\00"
define i8* @jsonTopoAddPlug(i8* %0, i8* %1) {
%3 = tail call i8* @jsonTopoAddDevice(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32* null, i32 0)
ret i8* %3
}
void svm_struct_classify_api_init(int argc, char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @svm_struct_classify_api_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int musbgm_stop(int, int);
int mus_bgm_stop(int no, int time) { return musbgm_stop(no, time); }


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

x86 assembly (clang, -O2):
<mus_bgm_stop>:
jmp    1030 <musbgm_stop@plt>

LLVM IR (-O0):
define i32 @mus_bgm_stop(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 @musbgm_stop(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mus_bgm_stop(i32 %0, i32 %1) {
%3 = tail call i32 @musbgm_stop(i32 %0, i32 %1)
ret i32 %3
}
void slipdev_char_poll() {}


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

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

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

LLVM IR (-O2):
define void @slipdev_char_poll() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void fatal(char *label) {
  fprintf(stderr, "asmconv: %s: %s\n", label, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"asmconv: %s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"asmconv: %s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}