xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int main(void) {
  signed x = -1;
  unsigned y = -1;
  unsigned char z = -1;
  printf("x"
         " = [%d]\n",
         (x));
  printf("y"
         " = [%d]\n",
         (y));
  printf("z"
         " = [%d]\n",
         (z));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movb   $0xff,-0xd(%rbp)
mov    -0x8(%rbp),%eax
lea    0xec5(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
lea    0xebd(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
movzbl -0xd(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"x = [%d]\0A\00"
@.str.1 = [10 x i8] c"y = [%d]\0A\00"
@.str.2 = [10 x i8] c"z = [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 zeroext -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8 zeroext -1)
ret i32 0
}
unsigned int inthash(unsigned int x) {
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x);
  return x;
}


x86 assembly (clang, -O0):
<inthash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthash>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,%ecx
shr    $0x10,%ecx
xor    %eax,%ecx
imul   $0x45d9f3b,%ecx,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @inthash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %4, %5
%7 = mul i32 %6, 73244475
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = lshr i32 %8, 16
%10 = load i32, i32* %2
%11 = xor i32 %9, %10
%12 = mul i32 %11, 73244475
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 16
%15 = load i32, i32* %2
%16 = xor i32 %14, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @inthash(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, 73244475
%5 = lshr i32 %4, 16
%6 = xor i32 %5, %4
%7 = mul i32 %6, 73244475
%8 = lshr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ error(char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write_err(char *);
void usage(const char *msg) {
  if (msg)
    error(msg);
  write_err("Usage: sysloguwrite [-g GID] [-u UID] [-U] [-p] HOST PORT "
            "FACILITY [PREFIX]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <usage+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <error@plt>
lea    0xea9(%rip),%rdi
call   1050 <write_err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
test   %rdi,%rdi
je     113b <usage+0xb>
call   1030 <error@plt>
lea    0xebe(%rip),%rdi
call   1050 <write_err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: sysloguwrite [-g GID] [-u UID] [-U] [-p] HOST PORT FACILITY [PREFIX]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @error(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = call i32 @write_err(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: sysloguwrite [-g GID] [-u UID] [-U] [-p] HOST PORT FACILITY [PREFIX]\0A\00"
define void @usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @error(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @write_err(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ bit(unsigned int, int);
unsigned int bitrng(unsigned int, int, int);
int sx32(unsigned int val, int hi, int lo) {
  unsigned int tmp = 0;
  if (bit(val, hi))
    tmp = (~0) << hi;
  tmp |= bitrng(val, hi, lo);
  return (int)tmp;
}


x86 assembly (clang, -O0):
<sx32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <bit@plt>
cmp    $0x0,%rax
je     115a <sx32+0x3a>
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <bitrng@plt>
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sx32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%r15d
call   1040 <bit@plt>
mov    $0xffffffff,%edx
mov    %ebp,%ecx
shl    %cl,%edx
xor    %ebx,%ebx
test   %rax,%rax
cmovne %edx,%ebx
mov    %r15d,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <bitrng@plt>
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sx32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @bit(i32 %0, i32 %1)
%5 = icmp eq i64 %4, 0
%6 = shl nsw i32 -1, %1
%7 = select i1 %5, i32 0, i32 %6
%8 = tail call i32 @bitrng(i32 %0, i32 %1, i32 %2)
%9 = or i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int STC31xx_ReadByte8(int);
int /*<<< orphan*/ STC31xx_WriteByte8(int, int);
void STC311x_ForceCC(void) {
  int value;
  value = STC31xx_ReadByte8(0x00);
  STC31xx_WriteByte8(0x00, value | 0x20);
}


x86 assembly (clang, -O0):
<STC311x_ForceCC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <STC31xx_ReadByte8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
or     $0x20,%esi
xor    %edi,%edi
call   1040 <STC31xx_WriteByte8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC311x_ForceCC>:
push   %rax
xor    %edi,%edi
call   1030 <STC31xx_ReadByte8@plt>
or     $0x20,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <STC31xx_WriteByte8@plt>

LLVM IR (-O0):
define void @STC311x_ForceCC() {
%1 = alloca i32
%2 = call i32 @STC31xx_ReadByte8(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 32
%5 = call i32 @STC31xx_WriteByte8(i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
define void @STC311x_ForceCC() {
%1 = tail call i32 @STC31xx_ReadByte8(i32 0)
%2 = or i32 %1, 32
%3 = tail call i32 @STC31xx_WriteByte8(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ motorboard_Close();
void mot_Close() { motorboard_Close(); }


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

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

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

LLVM IR (-O2):
define void @mot_Close() {
%1 = tail call i32 (...) @motorboard_Close()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (1) {
    printf("Hello world... from hello2.c\n");
    for (int i = 0; i < 100000000; i++) {
    };
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    1152 <main+0x42>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@str = [29 x i8] c"Hello world... from hello2.c\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("\n");
  printf("push/pop usage:  p)push(f)      o)pop\n");
  printf("constants     :  S)STACK_SIZE   E)STACK_IS_EMPTY   e)stack_error\n");
  printf("Test program usage: H)Help      Q)Quit\n\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xf75(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xee8(%rip),%rdi
call   1040 <puts@plt>
lea    0xf1d(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [39 x i8] c"push/pop usage: p)push(f) o)pop\0A\00"
@.str.2 = [66 x i8] c"constants : S)STACK_SIZE E)STACK_IS_EMPTY e)stack_error\0A\00"
@.str.3 = [41 x i8] c"Test program usage: H)Help Q)Quit\0A\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"push/pop usage: p)push(f) o)pop\00"
@str.4 = [65 x i8] c"constants : S)STACK_SIZE E)STACK_IS_EMPTY e)stack_error\00"
@str.5 = [40 x i8] c"Test program usage: H)Help Q)Quit\0A\00"
define void @print_usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_MODE_1;
int test_aardvark(int, int /*<<< orphan*/);
int test_aardvark_mode1(int fd) { return test_aardvark(fd, SPI_MODE_1); }


x86 assembly (clang, -O0):
<test_aardvark_mode1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <test_aardvark@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_aardvark_mode1>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <test_aardvark@plt>

LLVM IR (-O0):
@SPI_MODE_1 = global i32 0
define i32 @test_aardvark_mode1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SPI_MODE_1
%5 = call i32 @test_aardvark(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SPI_MODE_1 = global i32 0
define i32 @test_aardvark_mode1(i32 %0) {
%2 = load i32, i32* @SPI_MODE_1
%3 = tail call i32 @test_aardvark(i32 %0, i32 %2)
ret i32 %3
}
long milli_kelvin_to_millicelsius(long t) { return t + -273150; }


x86 assembly (clang, -O0):
<milli_kelvin_to_millicelsius>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffbd502,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<milli_kelvin_to_millicelsius>:
lea    -0x42afe(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @milli_kelvin_to_millicelsius(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, -273150
ret i64 %4
}

LLVM IR (-O2):
define i64 @milli_kelvin_to_millicelsius(i64 %0) {
%2 = add nsw i64 %0, -273150
ret i64 %2
}
/* Variables and functions */
int mega_mem_calls();
int bogo_ticks(void) { return mega_mem_calls(); }


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

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

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

LLVM IR (-O2):
define i32 @bogo_ticks() {
%1 = tail call i32 (...) @mega_mem_calls()
ret i32 %1
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int putc_unlocked(int, int /*<<< orphan*/);
int my_putc_unlocked(int c, struct aFILE *fp) {
  return putc_unlocked(c, _get_actual_fp(fp));
}


x86 assembly (clang, -O0):
<my_putc_unlocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <putc_unlocked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putc_unlocked>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <_get_actual_fp@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <putc_unlocked@plt>

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

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_putc_unlocked(i32 %0, %struct.aFILE* %1) {
%3 = tail call i32 @_get_actual_fp(%struct.aFILE* %1)
%4 = tail call i32 @putc_unlocked(i32 %0, i32 %3)
ret i32 %4
}
void palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) {}


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

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

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

LLVM IR (-O2):
%struct.palm27x_asoc_info = type opaque
define void @palm27x_asoc_set_pdata(%struct.palm27x_asoc_info* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in6_addr {
  scalar_t__ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, scalar_t__, int);
uint32_t in6_teredo_ipv4(const struct in6_addr *ip6) {
  uint32_t client_ip;
  memcpy(&client_ip, ip6->s6_addr + 12, 4);
  return ~client_ip;
}


x86 assembly (clang, -O0):
<in6_teredo_ipv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
add    $0xc,%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in6_teredo_ipv4>:
push   %rax
mov    (%rdi),%rsi
add    $0xc,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_ipv4(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
%3 = alloca i32
store %struct.in6_addr* %0, %struct.in6_addr** %2
%4 = load %struct.in6_addr*, %struct.in6_addr** %2
%5 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %6, 12
%8 = call i32 @memcpy(i32* %3, i64 %7, i32 4)
%9 = load i32, i32* %3
%10 = xor i32 %9, -1
ret i32 %10
}

LLVM IR (-O2):
%struct.in6_addr = type { i64 }
define i32 @in6_teredo_ipv4(%struct.in6_addr* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 12
%7 = call i32 @memcpy(i32* %2, i64 %6, i32 4)
%8 = load i32, i32* %2
%9 = xor i32 %8, -1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void destroyHolder(void **holder, int len) {
  int i;
  for (i = 0; i < len; i++) {
    holder[i] = NULL;
  }
  free(holder);
  holder = NULL;
}


x86 assembly (clang, -O0):
<destroyHolder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <destroyHolder+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <destroyHolder+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyHolder>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
jle    1138 <destroyHolder+0x18>
mov    %esi,%edx
shl    $0x3,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroyHolder(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i8** %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
%9 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
char *Can_Read_Frame(int, int);
char *receiveByteData(int ch_num, int can_id) {
  return Can_Read_Frame(ch_num, can_id);
}


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

x86 assembly (clang, -O2):
<receiveByteData>:
jmp    1030 <Can_Read_Frame@plt>

LLVM IR (-O0):
define i8* @receiveByteData(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 i8* @Can_Read_Frame(i32 %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @receiveByteData(i32 %0, i32 %1) {
%3 = tail call i8* @Can_Read_Frame(i32 %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void while_loop_exits() {
  int i = 0;
  while (i < 10) {
    ++i;
  }
  clang_analyzer_warnIfReached();
}


x86 assembly (clang, -O0):
<while_loop_exits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1137 <while_loop_exits+0x27>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <while_loop_exits+0xf>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @while_loop_exits() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %2
8: ; preds = %2
%9 = call i32 (...) @clang_analyzer_warnIfReached()
ret void
}

LLVM IR (-O2):
define void @while_loop_exits() {
%1 = tail call i32 (...) @clang_analyzer_warnIfReached()
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *cs) {
  char *t = malloc(strlen(cs) + 1);
  if (t)
    strcpy(t, cs);
  return t;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int rand();
int bot(int grid[6][7], int move) {
  int r;
  do {
    r = rand() % 7;
  } while (grid[0][r] != 0);
  return r;
}


x86 assembly (clang, -O0):
<bot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    111f <bot+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
movslq %eax,%rcx
cmpl   $0x0,(%rbx,%rcx,4)
jne    1120 <bot+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bot([7 x i32]* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 7
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %0, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 %5
}
/* Variables and functions */
int func3(int);
__attribute__((no, optimize(3))) int func2(int i) { return func3(i * 3); }


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

x86 assembly (clang, -O2):
<func2>:
lea    (%rdi,%rdi,2),%edi
jmp    1030 <func3@plt>

LLVM IR (-O0):
define i32 @func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
%5 = call i32 @func3(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func2(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = tail call i32 @func3(i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
int /*<<< orphan*/ gfx_pci_config_write(int, unsigned long);
int sc1200_enable_softvga(void) {
  unsigned long reg_val;
  reg_val = gfx_pci_config_read(0x80009444);
  gfx_pci_config_write(0x80009444, reg_val & 0xfffffffel);
  reg_val = gfx_pci_config_read(0x80009444);
  if ((reg_val & 0x1) == 0)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
movabs $0xfffffffe,%rsi
and    -0x10(%rbp),%rsi
mov    $0x80009444,%edi
call   1030 <gfx_pci_config_write@plt>
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    117a <sc1200_enable_softvga+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <sc1200_enable_softvga+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
and    $0xfffffffe,%eax
mov    $0x80009444,%edi
mov    %rax,%rsi
call   1030 <gfx_pci_config_write@plt>
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
not    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sc1200_enable_softvga() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 @gfx_pci_config_read(i32 -2147445692)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 4294967294
%6 = call i32 @gfx_pci_config_write(i32 -2147445692, i64 %5)
%7 = call i64 @gfx_pci_config_read(i32 -2147445692)
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = and i64 %8, 1
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @sc1200_enable_softvga() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147445692)
%2 = and i64 %1, 4294967294
%3 = tail call i32 @gfx_pci_config_write(i32 -2147445692, i64 %2)
%4 = tail call i64 @gfx_pci_config_read(i32 -2147445692)
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
ret i32 %7
}
void s2e_print_expression(const char *name, int expression) {
  __s2e_touch_string(name);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x07, 0x01, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       :
                       : "a"(expression), "c"(name));
}


x86 assembly (clang, -O0):
<s2e_print_expression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <__s2e_touch_string@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
(bad)
add    %al,(%rdi)
add    %eax,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_print_expression>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__s2e_touch_string@plt>
mov    %ebp,%eax
mov    %rbx,%rcx
(bad)
add    %al,(%rdi)
add    %eax,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @s2e_print_expression(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %5)
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @s2e_print_expression(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %0)
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x07, 0x01, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printn(int);
void main() {
  int x;
  int end = 11;
  for (x = 1; x != end; x++) {
    printn(x);
    if (x == 4)
      printn(400);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xb,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1161 <main+0x51>
mov    -0x4(%rbp),%edi
call   1030 <printn@plt>
cmpl   $0x4,-0x4(%rbp)
jne    114e <main+0x3e>
mov    $0x190,%edi
call   1030 <printn@plt>
jmp    1153 <main+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <printn@plt>
mov    $0x2,%edi
call   1030 <printn@plt>
mov    $0x3,%edi
call   1030 <printn@plt>
mov    $0x4,%edi
call   1030 <printn@plt>
mov    $0x190,%edi
call   1030 <printn@plt>
mov    $0x5,%edi
call   1030 <printn@plt>
mov    $0x6,%edi
call   1030 <printn@plt>
mov    $0x7,%edi
call   1030 <printn@plt>
mov    $0x8,%edi
call   1030 <printn@plt>
mov    $0x9,%edi
call   1030 <printn@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <printn@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 11, i32* %2
store i32 1, i32* %1
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %18
7: ; preds = %3
%8 = load i32, i32* %1
%9 = call i32 @printn(i32 %8)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @printn(i32 400)
br label %14
14: ; preds = %12, %7
br label %15
15: ; preds = %14
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @printn(i32 1)
%2 = tail call i32 @printn(i32 2)
%3 = tail call i32 @printn(i32 3)
%4 = tail call i32 @printn(i32 4)
%5 = tail call i32 @printn(i32 400)
%6 = tail call i32 @printn(i32 5)
%7 = tail call i32 @printn(i32 6)
%8 = tail call i32 @printn(i32 7)
%9 = tail call i32 @printn(i32 8)
%10 = tail call i32 @printn(i32 9)
%11 = tail call i32 @printn(i32 10)
ret void
}
void ble_evt_hardware_soft_timer(
    const struct ble_msg_hardware_soft_timer_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_hardware_soft_timer_evt_t = type opaque
define void @ble_evt_hardware_soft_timer(%struct.ble_msg_hardware_soft_timer_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int randint(int n) {
  int divisor = RAND_MAX / (n + 1);
  int retval;
  do {
    retval = rand() / divisor;
  } while (retval > n);
  return retval;
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1130 <randint+0x20>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
cltd
idiv   %ecx
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
cmp    %ebx,%eax
jg     1130 <randint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @randint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @RAND_MAX
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %5, %7
store i32 %8, i32* %3
br label %9
9: ; preds = %13, %1
%10 = call i32 (...) @rand()
%11 = load i32, i32* %3
%12 = sdiv i32 %10, %11
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %9, label %17
17: ; preds = %13
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @randint(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @rand()
%7 = sdiv i32 %6, %4
%8 = icmp sgt i32 %7, %0
br i1 %8, label %5, label %9
9: ; preds = %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xed() {
  Assert_real((isdigit(237) == 0),
              "/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_isdigit.c",
              1190, ("isdigit should be 0 for 0xed"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xed,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4a6,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xed>:
push   %rax
mov    $0xed,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4a6,%edx
pop    %rax
jmp    1040 <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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xed\00"
define void @t_isdigit_0xed() {
%1 = call i64 @isdigit(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xed\00"
define void @t_isdigit_0xed() {
%1 = tail call i64 @isdigit(i32 237)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void NV21ToARGBRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @NV21ToARGBRow_AVX2() {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int compute_hash(int);
uint32_t compute_long_hash(uint64_t data) {
  return compute_hash(data >> 32) ^ compute_hash(data);
}


x86 assembly (clang, -O0):
<compute_long_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <compute_hash@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <compute_hash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_long_hash>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <compute_hash@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <compute_hash@plt>
xor    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compute_long_hash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 32
%5 = call i32 @compute_hash(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @compute_hash(i32 %6)
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @compute_long_hash(i32 %0) {
%2 = tail call i32 @compute_hash(i32 poison)
%3 = tail call i32 @compute_hash(i32 %0)
%4 = xor i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Open source SW Project\n");
  printf("First Github Traninning\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Open source SW Project\0A\00"
@.str.1 = [25 x i8] c"First Github Traninning\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Open source SW Project\00"
@str.2 = [24 x i8] c"First Github Traninning\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_macro_function30() { printf("42"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"42\00"
define void @test_macro_function30() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
void trim(char *s) {
  int i = strlen(s) - 1;
  if ((i > 0) && (s[i] == '\n'))
    s[i] = '\0';
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1156 <trim+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1156 <trim+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     112b <trim+0x1b>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112b <trim+0x1b>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
int strcmp(const char *str1, const char *str2) {
  int c1;
  int c2;
  do {
    c1 = *(str1++);
    c2 = *(str2++);
  } while ((c1 != '\0') && (c1 == c2));
  return (c1 - c2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     1151 <strcmp+0x51>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    110c <strcmp+0xc>
mov    -0x14(%rbp),%eax
sub    -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
movzbl (%rsi,%rcx,1),%edx
test   %eax,%eax
je     1124 <strcmp+0x24>
add    $0x1,%rcx
cmp    %dl,%al
je     1110 <strcmp+0x10>
movsbl %dl,%ecx
sub    %ecx,%eax
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
br label %7
7: ; preds = %23, %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
store i32 %15, i32* %6
br label %16
16: ; preds = %7
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = icmp eq i32 %20, %21
br label %23
23: ; preds = %19, %16
%24 = phi i1 [ false, %16 ], [ %22, %19 ]
br i1 %24, label %7, label %25
25: ; preds = %23
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = sub nsw i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %8, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %4
%10 = icmp ne i8 %7, 0
%11 = icmp eq i8 %7, %9
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = sext i8 %9 to i32
%15 = sext i8 %7 to i32
%16 = sub nsw i32 %15, %14
ret i32 %16
}
long get_round(double d) { return (long)((d > 0.0) ? d + 0.5 : d - 0.5); }


x86 assembly (clang, -O0):
<get_round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1132 <get_round+0x32>
movsd  0xedd(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1148 <get_round+0x48>
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_round>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @get_round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
br label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = fsub double %9, 5.000000e-01
br label %11
11: ; preds = %8, %5
%12 = phi double [ %7, %5 ], [ %10, %8 ]
%13 = fptosi double %12 to i64
ret i64 %13
}

LLVM IR (-O2):
define i64 @get_round(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, double 5.000000e-01, double -5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i64
ret i64 %5
}