xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf(argv[1]);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\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 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
void s_command(unsigned int j) {}


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

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

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

LLVM IR (-O2):
define void @s_command(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_carry(uintptr_t, uintptr_t);
void fiat_poly1305_carry(uint64_t out1[3], const uint64_t arg1[3]) {
  internal_fiat_poly1305_carry((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_poly1305_carry>:
jmp    1030 <internal_fiat_poly1305_carry@plt>

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

LLVM IR (-O2):
define void @fiat_poly1305_carry(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_poly1305_carry(i64 %3, i64 %4)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dfs(struct TreeNode *, struct TreeNode *, int *);
int isSubtree(struct TreeNode *s, struct TreeNode *t) {
  int isSub = 0;
  dfs(s, t, &isSub);
  return isSub;
}


x86 assembly (clang, -O0):
<isSubtree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <dfs@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSubtree>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <dfs@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @isSubtree(%struct.TreeNode* %0, %struct.TreeNode* %1) {
%3 = alloca %struct.TreeNode*
%4 = alloca %struct.TreeNode*
%5 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %3
store %struct.TreeNode* %1, %struct.TreeNode** %4
store i32 0, i32* %5
%6 = load %struct.TreeNode*, %struct.TreeNode** %3
%7 = load %struct.TreeNode*, %struct.TreeNode** %4
%8 = call i32 @dfs(%struct.TreeNode* %6, %struct.TreeNode* %7, i32* %5)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @isSubtree(%struct.TreeNode* %0, %struct.TreeNode* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @dfs(%struct.TreeNode* %0, %struct.TreeNode* %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int);
int main() {
  printf("shell exit 44 %s\n", strerror(44));
  printf("shell max exit 133 %s\n", strerror(133));
  printf("shell  exit 134 %s\n", strerror(134));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2c,%edi
call   1040 <strerror@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x85,%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x86,%edi
call   1040 <strerror@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"shell exit 44 %s\0A\00"
@.str.1 = [23 x i8] c"shell max exit 133 %s\0A\00"
@.str.2 = [20 x i8] c"shell exit 134 %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @strerror(i32 44)
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @strerror(i32 133)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i8* @strerror(i32 134)
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"shell exit 44 %s\0A\00"
@.str.1 = [23 x i8] c"shell max exit 133 %s\0A\00"
@.str.2 = [20 x i8] c"shell exit 134 %s\0A\00"
define i32 @main() {
%1 = tail call i8* @strerror(i32 44)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @strerror(i32 133)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i8* @strerror(i32 134)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, char,
                           int, char);
void logmsg(FILE *f, const char *s, char c1, int i, char c2) {
  if (f != 0) {
    fprintf(f, "%s %c %d %c\n", s, c1, i, c2);
    fflush(f);
  }
}


x86 assembly (clang, -O0):
<logmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %dl,-0x11(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1173 <logmsg+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x11(%rbp),%al
mov    -0x18(%rbp),%r8d
lea    0xea3(%rip),%rsi
movsbl %al,%ecx
movsbl -0x19(%rbp),%r9d
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logmsg>:
test   %rdi,%rdi
je     1151 <logmsg+0x31>
push   %rbx
mov    %ecx,%r10d
mov    %rsi,%rax
mov    %rdi,%rbx
movsbl %dl,%ecx
movsbl %r8b,%r9d
lea    0xec3(%rip),%rsi
mov    %rax,%rdx
mov    %r10d,%r8d
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s %c %d %c\0A\00"
define void @logmsg(i32* %0, i8* %1, i8 signext %2, i32 %3, i8 signext %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i32
%10 = alloca i8
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8 %2, i8* %8
store i32 %3, i32* %9
store i8 %4, i8* %10
%11 = load i32*, i32** %6
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %22
13: ; preds = %5
%14 = load i32*, i32** %6
%15 = load i8*, i8** %7
%16 = load i8, i8* %8
%17 = load i32, i32* %9
%18 = load i8, i8* %10
%19 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %15, i8 signext %16, i32 %17, i8 signext %18)
%20 = load i32*, i32** %6
%21 = call i32 @fflush(i32* %20)
br label %22
22: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s %c %d %c\0A\00"
define void @logmsg(i32* %0, i8* %1, i8 signext %2, i32 %3, i8 signext %4) {
%6 = icmp eq i32* %0, null
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8 signext %2, i32 %3, i8 signext %4)
%9 = tail call i32 @fflush(i32* %0)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
void *memcpy(void *const, void const *const, size_t const);
void *safe_memcpy(void *const dst, void const *const src, size_t const n) {
  return n != 0 ? memcpy(dst, src, n) : dst;
}


x86 assembly (clang, -O0):
<safe_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <safe_memcpy+0x41>
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1159 <safe_memcpy+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_memcpy>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <safe_memcpy+0x11>
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @safe_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
br label %6
6: ; preds = %3, %5
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void testTortureExecute(void) {
  int tmp;
  foo();
  tmp = 1;
  return;
}


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

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

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca i32
%2 = call i32 (...) @foo()
store i32 1, i32* %1
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 (...) @foo()
ret void
}
int create_velocity() {}


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

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

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

LLVM IR (-O2):
define i32 @create_velocity() {
ret i32 undef
}
void short2le(unsigned short val, unsigned char *addr) {
  addr[0] = val & 0xFF;
  addr[1] = (val >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<short2le>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<short2le>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @short2le(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @short2le(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = trunc i16 %0 to i8
store i8 %3, i8* %1
%4 = lshr i16 %0, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int g_random_int();
int getRandom(int low, int high) {
  if (low - high < 0x10000)
    return (low + ((g_random_int() >> 8) % (high + 1 - low)));
  return (low + (g_random_int() % (high + 1 - low)));
}


x86 assembly (clang, -O0):
<getRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x10000,%eax
jge    1158 <getRandom+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <g_random_int@plt>
sar    $0x8,%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <getRandom+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <g_random_int@plt>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandom>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%r14d
sub    %esi,%r14d
xor    %eax,%eax
call   1030 <g_random_int@plt>
mov    %eax,%ecx
sar    $0x8,%ecx
cmp    $0x10000,%r14d
cmovl  %ecx,%eax
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getRandom(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 = sub nsw i32 %6, %7
%9 = icmp slt i32 %8, 65536
br i1 %9, label %10, label %20
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 (...) @g_random_int()
%13 = ashr i32 %12, 8
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %4
%17 = sub nsw i32 %15, %16
%18 = srem i32 %13, %17
%19 = add nsw i32 %11, %18
store i32 %19, i32* %3
br label %29
20: ; preds = %2
%21 = load i32, i32* %4
%22 = call i32 (...) @g_random_int()
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
%25 = load i32, i32* %4
%26 = sub nsw i32 %24, %25
%27 = srem i32 %22, %26
%28 = add nsw i32 %21, %27
store i32 %28, i32* %3
br label %29
29: ; preds = %20, %10
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @getRandom(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp slt i32 %3, 65536
%5 = tail call i32 (...) @g_random_int()
%6 = ashr i32 %5, 8
%7 = select i1 %4, i32 %6, i32 %5
%8 = add nsw i32 %1, 1
%9 = sub i32 %8, %0
%10 = srem i32 %7, %9
%11 = add nsw i32 %10, %0
ret i32 %11
}
/* Variables and functions */
scalar_t__ isspace(char);
int isempty(char chr) { return (chr == ':' || chr == ',' || isspace(chr)); }


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3a,%ecx
mov    %al,-0x2(%rbp)
je     1155 <isempty+0x45>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     1155 <isempty+0x45>
movsbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isempty>:
mov    $0x1,%eax
cmp    $0x2c,%dil
je     1121 <isempty+0x11>
cmp    $0x3a,%dil
jne    1122 <isempty+0x12>
ret
push   %rax
movsbl %dil,%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @isempty(i8 signext %0) {
switch i8 %0, label %2 [
i8 58, label %6
i8 44, label %6
]
2: ; preds = %1
%3 = tail call i64 @isspace(i8 signext %0)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %2
%7 = phi i32 [ 1, %1 ], [ %5, %2 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int feholdexcept(fenv_t *envp) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @feholdexcept(i32* nocapture readnone %0) {
ret i32 1
}
void delay_nus(short us) {
  us /= 12;
  while ((--us) >= 0)
    ;
}


x86 assembly (clang, -O0):
<delay_nus>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
cwtl
cmp    $0x0,%eax
jl     1136 <delay_nus+0x36>
jmp    111b <delay_nus+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay_nus(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = sdiv i32 %4, 12
%6 = trunc i32 %5 to i16
store i16 %6, i16* %2
br label %7
7: ; preds = %12, %1
%8 = load i16, i16* %2
%9 = add i16 %8, -1
store i16 %9, i16* %2
%10 = sext i16 %9 to i32
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @delay_nus(i16 signext %0) {
ret void
}
/* Variables and functions */
int intdivint(long, int);
int opp(int);
long sum(long, int);
int sep(int i, int u, int gi2, int gu2) {
  return intdivint(sum(sum((long)(u * u - i * i), gu2), opp(gi2)), 2 * (u - i));
}


x86 assembly (clang, -O0):
<sep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
sub    %ecx,%eax
movslq %eax,%rdi
mov    -0x10(%rbp),%esi
call   1040 <sum@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <opp@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <sum@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%esi
sub    -0x4(%rbp),%esi
shl    $0x1,%esi
call   1050 <intdivint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sep>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%r15d
mov    %esi,%eax
imul   %esi,%eax
mov    %edi,%edx
imul   %edi,%edx
sub    %edx,%eax
movslq %eax,%rdi
mov    %ecx,%esi
call   1040 <sum@plt>
mov    %rax,%rbp
mov    %r14d,%edi
call   1030 <opp@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   1040 <sum@plt>
sub    %r15d,%ebx
add    %ebx,%ebx
mov    %rax,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <intdivint@plt>

LLVM IR (-O0):
define i32 @sep(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %11, %14
%16 = sext i32 %15 to i64
%17 = load i32, i32* %8
%18 = call i64 @sum(i64 %16, i32 %17)
%19 = load i32, i32* %7
%20 = call i32 @opp(i32 %19)
%21 = call i64 @sum(i64 %18, i32 %20)
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = sub nsw i32 %22, %23
%25 = mul nsw i32 2, %24
%26 = call i32 @intdivint(i64 %21, i32 %25)
ret i32 %26
}

LLVM IR (-O2):
define i32 @sep(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, %1
%6 = mul nsw i32 %0, %0
%7 = sub nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = tail call i64 @sum(i64 %8, i32 %3)
%10 = tail call i32 @opp(i32 %2)
%11 = tail call i64 @sum(i64 %9, i32 %10)
%12 = sub nsw i32 %1, %0
%13 = shl nsw i32 %12, 1
%14 = tail call i32 @intdivint(i64 %11, i32 %13)
ret i32 %14
}
int RGB2Cb(int r, int g, int b) {
  return (-148 * r - 291 * g + 439 * b + 128500) / 1000;
}


x86 assembly (clang, -O0):
<RGB2Cb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0xffffff6c,-0x4(%rbp),%eax
imul   $0x123,-0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x1b7,-0xc(%rbp),%ecx
add    %ecx,%eax
add    $0x1f5f4,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGB2Cb>:
imul   $0xffffff6c,%edi,%eax
imul   $0xfffffedd,%esi,%ecx
add    %eax,%ecx
imul   $0x1b7,%edx,%eax
add    %ecx,%eax
add    $0x1f5f4,%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @RGB2Cb(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 -148, %7
%9 = load i32, i32* %5
%10 = mul nsw i32 291, %9
%11 = sub nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 439, %12
%14 = add nsw i32 %11, %13
%15 = add nsw i32 %14, 128500
%16 = sdiv i32 %15, 1000
ret i32 %16
}

LLVM IR (-O2):
define i32 @RGB2Cb(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, -148
%5 = mul i32 %1, -291
%6 = mul nsw i32 %2, 439
%7 = add i32 %4, 128500
%8 = add i32 %7, %5
%9 = add i32 %8, %6
%10 = sdiv i32 %9, 1000
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
void test(void) {
  time_t time;
  struct tm *timestruct;
  timestruct = localtime(&time);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @test() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %3, %struct.tm** %2
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call %struct.tm* @localtime(i32* %1)
ret void
}
int sgetch(int dummy, char **cpp) {
  return (*(*cpp) == '\0' ? (-2) : *(*cpp)++);
}


x86 assembly (clang, -O0):
<sgetch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112b <sgetch+0x2b>
mov    $0xfffffffe,%eax
mov    %eax,-0x14(%rbp)
jmp    1142 <sgetch+0x42>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgetch>:
mov    (%rsi),%rax
cmpb   $0x0,(%rax)
je     1113 <sgetch+0x13>
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
movsbl (%rax),%eax
ret
mov    $0xfffffffe,%eax
ret

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

LLVM IR (-O2):
define i32 @sgetch(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %7, i8** %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ -2, %2 ]
ret i32 %11
}
int main(void) {
  int a[4][5] = {0};
  a[1][7];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [4 x [5 x i32]]* %2 to i8*
%4 = getelementptr inbounds [4 x [5 x i32]], [4 x [5 x i32]]* %2, i64 0, i64 1
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 7
%6 = load i32, i32* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int multiply(int x, int y) {
  int i;
  int result = 0;
  for (i = 0; i < 32; i++) {
    if ((x & 0x1) == 1)
      result = result + y;
    x = x >> 1;
    y = y << 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    115a <multiply+0x5a>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    113a <multiply+0x3a>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <multiply+0x18>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
xor    %eax,%eax
mov    $0x20,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
neg    %edx
and    %esi,%edx
add    %eax,%edx
lea    (%rsi,%rsi,1),%r8d
mov    %edi,%eax
shl    $0x1e,%eax
sar    $0x1f,%eax
and    %r8d,%eax
add    %edx,%eax
sar    $0x2,%edi
shl    $0x2,%esi
add    $0xfffffffe,%ecx
jne    1110 <multiply+0x10>
ret

LLVM IR (-O0):
define i32 @multiply(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* %6
store i32 0, i32* %5
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %3
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
store i32 %17, i32* %6
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %3
%20 = ashr i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %4
%22 = shl i32 %21, 1
store i32 %22, i32* %4
br label %23
23: ; preds = %18
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %7
%27 = load i32, i32* %6
ret i32 %27
}

LLVM IR (-O2):
define i32 @multiply(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %16, %3 ]
%5 = phi i32 [ 0, %2 ], [ %19, %3 ]
%6 = phi i32 [ %1, %2 ], [ %18, %3 ]
%7 = phi i32 [ %0, %2 ], [ %17, %3 ]
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 %6
%11 = add nsw i32 %4, %10
%12 = shl i32 %6, 1
%13 = and i32 %7, 2
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i32 0, i32 %12
%16 = add nsw i32 %11, %15
%17 = ashr i32 %7, 2
%18 = shl i32 %6, 2
%19 = add nuw nsw i32 %5, 2
%20 = icmp eq i32 %19, 32
br i1 %20, label %21, label %3
21: ; preds = %3
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32_xxh32s_data32(float const *, size_t, uintptr_t);
uint32_t rgph_u32_xxh32s_f32a(const float *key, size_t len, uintptr_t seed) {
  return rgph_u32_xxh32s_data32(key, len, seed);
}


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

x86 assembly (clang, -O2):
<rgph_u32_xxh32s_f32a>:
jmp    1030 <rgph_u32_xxh32s_data32@plt>

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

LLVM IR (-O2):
define i32 @rgph_u32_xxh32s_f32a(float* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u32_xxh32s_data32(float* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int core4_swap(char *, int);
int U_EMREXCLUDECLIPRECT_swap(char *record, int torev) {
  return (core4_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMREXCLUDECLIPRECT_swap>:
jmp    1030 <core4_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMREXCLUDECLIPRECT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ _Exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int fork_routine(void *arg) {
  write(1, "fork_routine\n", 13);
  _Exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<fork_routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
lea    0xec8(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <_Exit@plt>

x86 assembly (clang, -O2):
<fork_routine>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <write@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <_Exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fork_routine\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @fork_routine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @_Exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"fork_routine\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @fork_routine(i8* nocapture readnone %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @_Exit(i32 %3)
unreachable
}
yyPrint_INT(i) long i;
{ printf("%d", i); }


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

x86 assembly (clang, -O2):
<yyPrint_INT>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @yyPrint_INT(i64 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 undef
}
void outsl(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("cld ; rep ; outs"
                       "l"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
cld
rep outsl %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsl>:
mov    %rdx,%rcx
mov    %edi,%edx
cld
rep outsl %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsl", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_unset_many() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_unset_many"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_proplist_unset_many\0A\00"
define i32 @pa_proplist_unset_many() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_proplist_unset_many\00"
define i32 @pa_proplist_unset_many() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int rand();
int RandPerc() { return ((rand() >> 7) % 100); }


x86 assembly (clang, -O0):
<RandPerc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
sar    $0x7,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandPerc>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
sar    $0x7,%eax
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @RandPerc() {
%1 = call i32 (...) @rand()
%2 = ashr i32 %1, 7
%3 = srem i32 %2, 100
ret i32 %3
}

LLVM IR (-O2):
define i32 @RandPerc() {
%1 = tail call i32 (...) @rand()
%2 = ashr i32 %1, 7
%3 = srem i32 %2, 100
ret i32 %3
}
int setup_footer() {}


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

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

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

LLVM IR (-O2):
define i32 @setup_footer() {
ret i32 undef
}
unsigned xrop3_220_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T & stk3;
  stk1 = S | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_220_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_220_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
not    %eax
and    %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_220_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_220_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int get_nprocs();
int get_num_cores(void) { return get_nprocs(); }


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

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

LLVM IR (-O0):
define i32 @get_num_cores() {
%1 = call i32 (...) @get_nprocs()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_num_cores() {
%1 = tail call i32 (...) @get_nprocs()
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void ece_write_uint32_be(uint8_t *bytes, uint32_t value) {
  bytes[0] = (value >> 24) & 0xff;
  bytes[1] = (value >> 16) & 0xff;
  bytes[2] = (value >> 8) & 0xff;
  bytes[3] = value & 0xff;
}


x86 assembly (clang, -O0):
<ece_write_uint32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece_write_uint32_be>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @ece_write_uint32_be(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void abstraction_aligned_free(void *memory) {
  free(memory);
  return;
}


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

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

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

LLVM IR (-O2):
define void @abstraction_aligned_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init_green_led();
int /*<<< orphan*/ gpio_toggle_green_led();
int /*<<< orphan*/ some_delay(unsigned int);
int main(void) {
  gpio_init_green_led();
  while (1) {
    gpio_toggle_green_led();
    some_delay(100000u);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gpio_init_green_led@plt>
mov    $0x0,%al
call   1030 <gpio_toggle_green_led@plt>
mov    $0x186a0,%edi
call   1050 <some_delay@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gpio_init_green_led@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gpio_toggle_green_led@plt>
mov    $0x186a0,%edi
call   1050 <some_delay@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gpio_init_green_led()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @gpio_toggle_green_led()
%5 = call i32 @some_delay(i32 100000)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gpio_init_green_led()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @gpio_toggle_green_led()
%4 = tail call i32 @some_delay(i32 100000)
br label %2
}
void NWL(n) int n;
{
  int i = 1;
  while (i <= n) {
    printf("\n");
    i++;
  }
}


x86 assembly (clang, -O0):
<NWL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114a <NWL+0x3a>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <NWL+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NWL>:
push   %rbx
test   %edi,%edi
jle    112f <NWL+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <NWL+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @NWL(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @putchar(i32 10)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
int /*<<< orphan*/ initJuliaColors();
int /*<<< orphan*/ initVBO();
void init(void) {
  initVBO();
  initJuliaColors();
  glEnable(GL_DEPTH_TEST);
  glClearColor(0.25, 0.25, 0.25, 1.0);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initVBO@plt>
mov    $0x0,%al
call   1030 <initJuliaColors@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
movsd  0xe88(%rip),%xmm2
movsd  0xe88(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glClearColor@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1070 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1050 <initVBO@plt>
xor    %eax,%eax
call   1030 <initJuliaColors@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
movsd  0xe8b(%rip),%xmm0
movsd  0xe8b(%rip),%xmm3
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1060 <glClearColor@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1070 <glShadeModel@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_FLAT = global i32 0
define void @init() {
%1 = call i32 (...) @initVBO()
%2 = call i32 (...) @initJuliaColors()
%3 = load i32, i32* @GL_DEPTH_TEST
%4 = call i32 @glEnable(i32 %3)
%5 = call i32 @glClearColor(double 2.500000e-01, double 2.500000e-01, double 2.500000e-01, double 1.000000e+00)
%6 = load i32, i32* @GL_FLAT
%7 = call i32 @glShadeModel(i32 %6)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_FLAT = global i32 0
define void @init() {
%1 = tail call i32 (...) @initVBO()
%2 = tail call i32 (...) @initJuliaColors()
%3 = load i32, i32* @GL_DEPTH_TEST
%4 = tail call i32 @glEnable(i32 %3)
%5 = tail call i32 @glClearColor(double 2.500000e-01, double 2.500000e-01, double 2.500000e-01, double 1.000000e+00)
%6 = load i32, i32* @GL_FLAT
%7 = tail call i32 @glShadeModel(i32 %6)
ret void
}