xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getenv(int /*<<< orphan*/);
int /*<<< orphan*/ lua_check_string(int, char *);
int /*<<< orphan*/ lua_pushstring(char *);
void io_getenv(void) {
  char *env = getenv(lua_check_string(1, "getenv"));
  lua_pushstring(env);
}


x86 assembly (clang, -O0):
<io_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xebc(%rip),%rsi
call   1040 <lua_check_string@plt>
mov    %eax,%edi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <lua_pushstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_getenv>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1040 <lua_check_string@plt>
mov    %eax,%edi
call   1030 <getenv@plt>
mov    %rax,%rdi
pop    %rax
jmp    1050 <lua_pushstring@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"getenv\00"
define void @io_getenv() {
%1 = alloca i8*
%2 = call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @getenv(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @lua_pushstring(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"getenv\00"
define void @io_getenv() {
%1 = tail call i32 @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @getenv(i32 %1)
%3 = tail call i32 @lua_pushstring(i8* %2)
ret void
}
void func2(int a, int *b, char c) { *(1 + b) = 200; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xc8,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
movl   $0xc8,0x4(%rsi)
ret

LLVM IR (-O0):
define void @func2(i32 %0, i32* %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 200, i32* %8
ret void
}

LLVM IR (-O2):
define void @func2(i32 %0, i32* nocapture writeonly %1, i8 signext %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 200, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stfl_form_reset();
void stfl_reset() { stfl_form_reset(); }


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

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

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

LLVM IR (-O2):
define void @stfl_reset() {
%1 = tail call i32 (...) @stfl_form_reset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_crc32_u32(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t rte_hash_crc_4byte(uint32_t data, uint32_t init_val) {
  return _mm_crc32_u32(data, init_val);
}


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

x86 assembly (clang, -O2):
<rte_hash_crc_4byte>:
jmp    1030 <_mm_crc32_u32@plt>

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

LLVM IR (-O2):
define i32 @rte_hash_crc_4byte(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_crc32_u32(i32 %0, i32 %1)
ret i32 %3
}
int NewFile2() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @NewFile2() {
ret i32 1
}
int func(int blah) { char *rindex(); }


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

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

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
ret i32 undef
}
/* Variables and functions */
char *strchr(char *, char);
void func() {
  char *c;
  c = strchr("dfdfedfd", 'e');
  *c = 'd';
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x65,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x64,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"dfdfedfd\00"
define void @func() {
%1 = alloca i8*
%2 = call i8* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext 101)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
store i8 100, i8* %3
ret void
}

LLVM IR (-O2):
define void @func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stack_test_internal_popping();
int /*<<< orphan*/ stack_test_internal_popping_and_pushing();
int /*<<< orphan*/ stack_test_internal_pushing();
int /*<<< orphan*/ stack_test_internal_rapid_popping_and_pushing();
void test_lfds611_stack(void) {
  printf("\n"
         "Stack Tests\n"
         "===========\n");
  stack_test_internal_popping();
  stack_test_internal_pushing();
  stack_test_internal_popping_and_pushing();
  stack_test_internal_rapid_popping_and_pushing();
  return;
}


x86 assembly (clang, -O0):
<test_lfds611_stack>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <stack_test_internal_popping@plt>
mov    $0x0,%al
call   1060 <stack_test_internal_pushing@plt>
mov    $0x0,%al
call   1070 <stack_test_internal_popping_and_pushing@plt>
mov    $0x0,%al
call   1040 <stack_test_internal_rapid_popping_and_pushing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lfds611_stack>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <stack_test_internal_popping@plt>
xor    %eax,%eax
call   1060 <stack_test_internal_pushing@plt>
xor    %eax,%eax
call   1070 <stack_test_internal_popping_and_pushing@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <stack_test_internal_rapid_popping_and_pushing@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0AStack Tests\0A===========\0A\00"
define void @test_lfds611_stack() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @stack_test_internal_popping()
%3 = call i32 (...) @stack_test_internal_pushing()
%4 = call i32 (...) @stack_test_internal_popping_and_pushing()
%5 = call i32 (...) @stack_test_internal_rapid_popping_and_pushing()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\0AStack Tests\0A===========\00"
define void @test_lfds611_stack() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @stack_test_internal_popping()
%3 = tail call i32 (...) @stack_test_internal_pushing()
%4 = tail call i32 (...) @stack_test_internal_popping_and_pushing()
%5 = tail call i32 (...) @stack_test_internal_rapid_popping_and_pushing()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void DeduceScore(int sum, int subtract) {
  int scoreA = (sum + subtract) / 2;
  int scoreB = sum - scoreA;
  if (scoreB < 0)
    printf("impossible\n");
  else
    printf("%d %d\n", scoreA, scoreB);
}


x86 assembly (clang, -O0):
<DeduceScore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1155 <DeduceScore+0x45>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1169 <DeduceScore+0x59>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeduceScore>:
mov    %esi,%eax
mov    %edi,%edx
add    %edi,%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
sub    %esi,%edx
js     1141 <DeduceScore+0x21>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xebf(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"impossible\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define void @DeduceScore(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
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = sdiv i32 %9, 2
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %22
18: ; preds = %2
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %20)
br label %22
22: ; preds = %18, %16
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d %d\0A\00"
@str = [11 x i8] c"impossible\00"
define void @DeduceScore(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, 2
%5 = sub nsw i32 %0, %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int fib(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", fib(atoi(argv[1])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <fib@plt>
mov    %eax,%esi
lea    0xe9d(%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   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <fib@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
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 @atoi(i8* %4)
%6 = tail call i32 @fib(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
int fun424() { return 424; }


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

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

LLVM IR (-O0):
define i32 @fun424() {
ret i32 424
}

LLVM IR (-O2):
define i32 @fun424() {
ret i32 424
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x40() {
  Assert_real((isgraph(64)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              325, ("isgraph should be 1 for @"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x40>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x145,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x40>:
push   %rax
mov    $0x40,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x145,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for @\00"
define void @t_isgraph_0x40() {
%1 = call i32 @isgraph(i32 64)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for @\00"
define void @t_isgraph_0x40() {
%1 = tail call i32 @isgraph(i32 64)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_78uint32_reg(unsigned int val) {
  return ((val) & (0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x78,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_78uint32_reg(i32 %0) {
%2 = and i32 %0, 120
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void varintWrite32(unsigned char *z, unsigned int y) {
  z[0] = (unsigned char)(y >> 24);
  z[1] = (unsigned char)(y >> 16);
  z[2] = (unsigned char)(y >> 8);
  z[3] = (unsigned char)(y);
}


x86 assembly (clang, -O0):
<varintWrite32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<varintWrite32>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @varintWrite32(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int random(int range, int x) {
  int a = 438, b = 153;
  return (a * x + b) % range;
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1b6,-0xc(%rbp)
movl   $0x99,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
imul   $0x1b6,%esi,%eax
add    $0x99,%eax
cltd
idiv   %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @random(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 438, i32* %5
store i32 153, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @random(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 438
%4 = add nsw i32 %3, 153
%5 = srem i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int invalid(char *msg, size_t size) {
  for (int i = 0; i < size; i++) {
    if (!msg[i])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<invalid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1152 <invalid+0x52>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    113f <invalid+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1159 <invalid+0x59>
jmp    1144 <invalid+0x44>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <invalid+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid>:
test   %rsi,%rsi
je     112b <invalid+0x2b>
cmpb   $0x0,(%rdi)
je     112e <invalid+0x2e>
mov    $0x1,%eax
nop
mov    %rax,%rcx
cmp    %rax,%rsi
je     1122 <invalid+0x22>
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
jne    1110 <invalid+0x10>
xor    %eax,%eax
cmp    %rsi,%rcx
setb   %al
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @invalid(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %4, %10
%8 = phi i64 [ %14, %10 ], [ 1, %4 ]
%9 = icmp eq i64 %8, %1
br i1 %9, label %15, label %10
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = add nuw i64 %8, 1
br i1 %13, label %15, label %7
15: ; preds = %7, %10
%16 = icmp ult i64 %8, %1
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %15, %4, %2
%19 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %17, %15 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ HwSparky2Handle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HwSparky2RequestUpdate() { UAVObjRequestUpdate(HwSparky2Handle()); }


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

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

LLVM IR (-O0):
define void @HwSparky2RequestUpdate() {
%1 = call i32 (...) @HwSparky2Handle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwSparky2RequestUpdate() {
%1 = tail call i32 (...) @HwSparky2Handle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
char *RCSid() {
  return RCSid("$Id: doc2gih.c,v 1.16 2007/10/24 00:47:51 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"$Id: doc2gih.c,v 1.16 2007/10/24 00:47:51 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ RemoveUselessBraces(char *);
int /*<<< orphan*/ TrimTrailingWhitespace(char *);
char *XTL_FindComment(char *);
scalar_t__ strlen(char *);
char *TrimLogLine(char *OldBuf) {
  char *p, *q;
  p = OldBuf;
  TrimTrailingWhitespace(p);
  q = XTL_FindComment(p);
  if (q != NULL)
    *q = 0;
  if (strlen(p) != 0)
    RemoveUselessBraces(p);
  return p;
}


x86 assembly (clang, -O0):
<TrimLogLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <TrimTrailingWhitespace@plt>
mov    -0x10(%rbp),%rdi
call   1060 <XTL_FindComment@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <TrimLogLine+0x3c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     1198 <TrimLogLine+0x58>
mov    -0x10(%rbp),%rdi
call   1040 <RemoveUselessBraces@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrimLogLine>:
push   %rbx
mov    %rdi,%rbx
call   1040 <TrimTrailingWhitespace@plt>
mov    %rbx,%rdi
call   1050 <XTL_FindComment@plt>
test   %rax,%rax
je     1149 <TrimLogLine+0x19>
movb   $0x0,(%rax)
cmpb   $0x0,(%rbx)
je     1156 <TrimLogLine+0x26>
mov    %rbx,%rdi
call   1030 <RemoveUselessBraces@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @TrimLogLine(i8* returned %0) {
%2 = tail call i32 @TrimTrailingWhitespace(i8* %0)
%3 = tail call i8* @XTL_FindComment(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %3
br label %6
6: ; preds = %5, %1
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @RemoveUselessBraces(i8* %0)
br label %11
11: ; preds = %9, %6
ret i8* %0
}
int re_search(bufp, string, size, startpos, range, regs)
struct re_pattern_buffer *bufp;
char *string;
int size, startpos, range;
struct re_registers *regs;
{
  return re_search_2(bufp, 0, 0, string, size, startpos, range, regs, size);
}


x86 assembly (clang, -O0):
<re_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    -0x28(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <re_search_2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_search>:
push   %rax
mov    %r9,%r10
mov    %r8d,%r11d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
push   %r11
call   1030 <re_search_2@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = alloca %struct.re_pattern_buffer*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.re_registers* %5, %struct.re_registers** %12
%13 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.re_registers*, %struct.re_registers** %12
%19 = load i32, i32* %9
%20 = call i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_search_2 to i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %13, i32 0, i32 0, i8* %14, i32 %15, i32 %16, i32 %17, %struct.re_registers* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = tail call i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_search_2 to i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i32 0, i32 0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char const *, int);
char *substr(char *buffer, const char *string, int nStart, int nStop) {
  memmove(buffer, string + nStart, nStop - nStart);
  buffer[nStop - nStart] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
sub    -0x14(%rbp),%edx
call   1030 <memmove@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rdi,%r14
movslq %edx,%rax
add    %rax,%rsi
sub    %eax,%ebx
mov    %ebx,%edx
call   1030 <memmove@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @substr(i8* returned %0, i8* %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = sub nsw i32 %3, %2
%8 = tail call i32 @memmove(i8* %0, i8* %6, i32 %7)
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret i8* %0
}
int anx7808_init(struct drm_encoder *encoder) { return 0; }


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

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

LLVM IR (-O0):
%struct.drm_encoder = type opaque
define i32 @anx7808_init(%struct.drm_encoder* %0) {
%2 = alloca %struct.drm_encoder*
store %struct.drm_encoder* %0, %struct.drm_encoder** %2
ret i32 0
}

LLVM IR (-O2):
%struct.drm_encoder = type opaque
define i32 @anx7808_init(%struct.drm_encoder* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getint(int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int n;
  getint(&n);
  printf("The number is %i", n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <getint@plt>
mov    0x4(%rsp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"The number is %i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @getint(i32* %6)
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"The number is %i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @getint(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  const char *text = "second node\n";
  write(STDOUT_FILENO, text, strlen(text));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%rax
mov    (%rax),%ebx
lea    0xecc(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"second node\0A\00"
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* @STDOUT_FILENO
%8 = load i8*, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"second node\0A\00"
@STDOUT_FILENO = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash(const char *str) {
  uint32_t hash = 5381;
  int c;
  while ((c = *str++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash & 0x0ff;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <hash+0x2b>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movzbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
movzbl %al,%eax
ret
mov    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 255
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5, %1 ], [ %15, %14 ]
ret i32 %17
}
void RTSgBufCopyToBuf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSgBufCopyToBuf() {
ret void
}
char *langRomTypeSvi328Cart() { return "SVI-328 Cartridge"; }


x86 assembly (clang, -O0):
<langRomTypeSvi328Cart>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeSvi328Cart>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"SVI-328 Cartridge\00"
define i8* @langRomTypeSvi328Cart() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"SVI-328 Cartridge\00"
define i8* @langRomTypeSvi328Cart() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
int strcmp(char *s1, char *s2) {
  int i = 0, c = 0;
  while (c == 0) {
    c = s1[i] - s2[i];
    i++;
  }
  return c;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    114f <strcmp+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <strcmp+0x1a>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
add    $0x1,%rcx
sub    %edx,%eax
je     1110 <strcmp+0x10>
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %16, %22
store i32 %23, i32* %6
%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 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %12, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %1, i64 %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
%12 = add nuw i64 %4, 1
%13 = icmp eq i32 %11, 0
br i1 %13, label %3, label %14
14: ; preds = %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ co_vp_init();
void __ompc_init_vp() { co_vp_init(); }


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

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

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

LLVM IR (-O2):
define void @__ompc_init_vp() {
%1 = tail call i32 (...) @co_vp_init()
ret void
}
struct D {
  int i, j;
  float f, g, h;
} i() {
  return (struct D){1, 2, 3};
}


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rax
movl   $0x1,(%rdi)
movl   $0x2,0x4(%rdi)
movss  0xee4(%rip),%xmm0
movss  %xmm0,0x8(%rdi)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rdi)
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
mov    %rdi,%rax
movabs $0x200000001,%rcx
mov    %rcx,(%rdi)
movq   $0x40400000,0x8(%rdi)
40
movl   $0x0,0x10(%rdi)
ret

LLVM IR (-O0):
%struct.D = type { i32, i32, float, float, float }
define void @i(%struct.D* noalias sret(%struct.D) align 4 %0) {
%2 = getelementptr inbounds %struct.D, %struct.D* %0, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.D, %struct.D* %0, i32 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.D, %struct.D* %0, i32 0, i32 2
store float 3.000000e+00, float* %4
%5 = getelementptr inbounds %struct.D, %struct.D* %0, i32 0, i32 3
store float 0.000000e+00, float* %5
%6 = getelementptr inbounds %struct.D, %struct.D* %0, i32 0, i32 4
store float 0.000000e+00, float* %6
ret void
}

LLVM IR (-O2):
%struct.D = type { i32, i32, float, float, float }
define void @i(%struct.D* noalias nocapture writeonly sret(%struct.D) align 4 %0) {
%2 = getelementptr inbounds %struct.D, %struct.D* %0, i64 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.D, %struct.D* %0, i64 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.D, %struct.D* %0, i64 0, i32 2
store float 3.000000e+00, float* %4
%5 = getelementptr inbounds %struct.D, %struct.D* %0, i64 0, i32 3
store float 0.000000e+00, float* %5
%6 = getelementptr inbounds %struct.D, %struct.D* %0, i64 0, i32 4
store float 0.000000e+00, float* %6
ret void
}
void log_end() { return; }


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

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

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

LLVM IR (-O2):
define void @log_end() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ const *);
scalar_t__ malloc(int);
int /*<<< orphan*/ wcscpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int wcslen(int /*<<< orphan*/ const *);
wchar_t *wcsdup(const wchar_t *string) {
  wchar_t *result;
  assert(string);
  result = (wchar_t *)malloc((wcslen(string) + 1) * sizeof(wchar_t));
  wcscpy(result, string);
  return result;
}


x86 assembly (clang, -O0):
<wcsdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wcslen@plt>
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <wcscpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <assert@plt>
mov    %r14,%rdi
call   1030 <wcslen@plt>
lea    0x4(,%rax,4),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <wcscpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @wcsdup(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @assert(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @wcslen(i32* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %3
%14 = load i32*, i32** %3
%15 = load i32*, i32** %2
%16 = call i32 @wcscpy(i32* %14, i32* %15)
%17 = load i32*, i32** %3
ret i32* %17
}

LLVM IR (-O2):
define i32* @wcsdup(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i32 @wcslen(i32* %0)
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i32*
%8 = tail call i32 @wcscpy(i32* %7, i32* %0)
ret i32* %7
}
/* Variables and functions */
size_t pico_strnlen(char *const, size_t);
char *get_string_terminator_position(char *const block, size_t len) {
  size_t length = pico_strnlen(block, len);
  return (len != length) ? (block + length) : 0;
}


x86 assembly (clang, -O0):
<get_string_terminator_position>:
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 <pico_strnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1150 <get_string_terminator_position+0x40>
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115b <get_string_terminator_position+0x4b>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    115b <get_string_terminator_position+0x4b>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string_terminator_position>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <pico_strnlen@plt>
add    %rax,%rbx
xor    %ecx,%ecx
cmp    %r14,%rax
cmovne %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @get_string_terminator_position(i8* %0, i64 %1) {
%3 = tail call i64 @pico_strnlen(i8* %0, i64 %1)
%4 = icmp eq i64 %3, %1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = select i1 %4, i8* null, i8* %5
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ outstr;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  char outstr[200];
  struct tm *local;
  time_t t;
  t = time(NULL);
  local = localtime(&t);
  strftime(outstr, sizeof(outstr), "%Y-%m-%d", local);
  printf("%s\n", outstr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xdc(%rbp)
lea    -0xdc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0xd8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0xd8(%rbp),%rcx
mov    $0xc8,%esi
lea    0xe72(%rip),%rdx
call   1060 <strftime@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe9c(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
lea    0xe89(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%Y-%m-%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca %struct.tm*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @time(i32* null)
store i32 %5, i32* %4
%6 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %6, %struct.tm** %3
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%8 = load %struct.tm*, %struct.tm** %3
%9 = call i32 @strftime(i8* %7, i32 200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%Y-%m-%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call %struct.tm* @localtime(i32* %2)
%7 = call i32 @strftime(i8* %3, i32 200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}