xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ PacketFinish();
int /*<<< orphan*/ PacketStart();
int /*<<< orphan*/ PacketWriteString(char *);
void PacketOk() {
  PacketStart();
  PacketWriteString("OK");
  PacketFinish();
}


x86 assembly (clang, -O0):
<PacketOk>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PacketStart@plt>
lea    0xebe(%rip),%rdi
call   1040 <PacketWriteString@plt>
mov    $0x0,%al
call   1050 <PacketFinish@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PacketOk>:
push   %rax
xor    %eax,%eax
call   1030 <PacketStart@plt>
lea    0xec1(%rip),%rdi
call   1040 <PacketWriteString@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <PacketFinish@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
define void @PacketOk() {
%1 = call i32 (...) @PacketStart()
%2 = call i32 @PacketWriteString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @PacketFinish()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define void @PacketOk() {
%1 = tail call i32 (...) @PacketStart()
%2 = tail call i32 @PacketWriteString(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @PacketFinish()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int __syscall_chmod(char const *, int /*<<< orphan*/);
int chmod(const char *path, mode_t mode) { return __syscall_chmod(path, mode); }


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

x86 assembly (clang, -O2):
<chmod>:
jmp    1030 <__syscall_chmod@plt>

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

LLVM IR (-O2):
define i32 @chmod(i8* %0, i32 %1) {
%3 = tail call i32 @__syscall_chmod(i8* %0, i32 %1)
ret i32 %3
}
int fun212() { return 212; }


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

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

LLVM IR (-O0):
define i32 @fun212() {
ret i32 212
}

LLVM IR (-O2):
define i32 @fun212() {
ret i32 212
}
void free_matrix(int **arr, int m, int n) {
  (void)m;
  int i;
  for (i = 0; i < n; i++)
    free(arr[i]);
  free(arr);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1154 <free_matrix+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <free_matrix+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %edx,%edx
jle    1142 <free_matrix+0x32>
mov    %edx,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(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
%8 = load i32, i32* %5
store i32 0, i32* %7
br label %9
9: ; preds = %20, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32**, i32*** %4
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32*, i32** %14, i64 %16
%18 = load i32*, i32** %17
%19 = bitcast i32* %18 to i8*
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %9
23: ; preds = %9
%24 = load i32**, i32*** %4
%25 = bitcast i32** %24 to i8*
ret void
}

LLVM IR (-O2):
define void @free_matrix(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %0, i64 %8
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast i32** %0 to i8*
tail call void @free(i8* %15)
ret void
}
int test_imm_3Duint16_mem(unsigned short *val) {
  return ((*val) & (-0x3D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Duint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffc3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Duint16_mem>:
movzwl (%rdi),%eax
test   $0xffc3,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -61
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *test1(int cf) { return cf ? "abc" : 0; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
lea    0xeed(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i8* @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i8* @test1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *x_malloc(int size) {
  void *ret = malloc(size);
  if (!ret) {
    fprintf(stderr, "Out of memory for size %d!\n", size);
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<x_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <x_malloc+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_malloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <x_malloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Out of memory for size %d!\0A\00"
define i8* @x_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Out of memory for size %d!\0A\00"
define noalias i8* @x_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
char int_to_char(int num) { return num + '0'; }


x86 assembly (clang, -O0):
<int_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @int_to_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @int_to_char(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char const *, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
int stub1(char const *, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int fputs(const char *str, FILE *stream) {
  return (*fwrite)(str, 1, strlen(str), stream);
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

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

LLVM IR (-O2):
define i32 @fputs(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %3, i32* %1)
ret i32 %4
}
void INT_Excep_SCI12_ERI12(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI12_ERI12() {
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ usleep(int);
void random_sleep_maybe(void) {
  int r = rand() % 1000;
  if (r < 950) {
    return;
  }
  if (r < 999) {
    r = rand() % 10000;
  } else {
    r = rand() % 1000000;
  }
  (void)usleep(r);
}


x86 assembly (clang, -O0):
<random_sleep_maybe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x3b6,-0x4(%rbp)
jge    114c <random_sleep_maybe+0x2c>
jmp    118a <random_sleep_maybe+0x6a>
cmpl   $0x3e7,-0x4(%rbp)
jge    1170 <random_sleep_maybe+0x50>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1182 <random_sleep_maybe+0x62>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_sleep_maybe>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rbx
imul   $0x10624dd3,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ebx
cmp    $0x3b6,%ebx
jge    1151 <random_sleep_maybe+0x31>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <rand@plt>
cmp    $0x3e7,%ebx
mov    $0x2710,%ecx
mov    $0xf4240,%esi
cmovb  %ecx,%esi
cltd
idiv   %esi
mov    %edx,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @random_sleep_maybe() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 1000
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 950
br i1 %5, label %6, label %7
6: ; preds = %0
br label %19
7: ; preds = %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 999
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 10000
store i32 %12, i32* %1
br label %16
13: ; preds = %7
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 1000000
store i32 %15, i32* %1
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %1
%18 = call i32 @usleep(i32 %17)
br label %19
19: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
define void @random_sleep_maybe() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = icmp slt i32 %2, 950
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = icmp ult i32 %2, 999
%6 = tail call i32 (...) @rand()
%7 = select i1 %5, i32 10000, i32 1000000
%8 = srem i32 %6, %7
%9 = tail call i32 @usleep(i32 %8)
br label %10
10: ; preds = %0, %4
ret void
}
int get_st2_prop(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @get_st2_prop() {
ret i32 2
}

LLVM IR (-O2):
define i32 @get_st2_prop() {
ret i32 2
}
int test_imm_92uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x92 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_92uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x92,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_92uint64_midword_mem>:
testb  $0x92,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_92uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9568256
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__13__GeneralIO__set();
void Stm25pSpiP__Hold__set(void) { Msp430GpioC__13__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @Stm25pSpiP__Hold__set() {
%1 = tail call i32 (...) @Msp430GpioC__13__GeneralIO__set()
ret void
}
/* Variables and functions */
int ip_cbst_cmp(void const *, void const *);
int ip_cbst_compar(const void *node, const void *ipp) {
  return ip_cbst_cmp(node, ipp);
}


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

x86 assembly (clang, -O2):
<ip_cbst_compar>:
jmp    1030 <ip_cbst_cmp@plt>

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

LLVM IR (-O2):
define i32 @ip_cbst_compar(i8* %0, i8* %1) {
%3 = tail call i32 @ip_cbst_cmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int strcpy(const char *from, char *to) {
  while (*from) {
    *to = *from;
    to++;
    from++;
  }
  *to = 0;
  return 0;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <strcpy+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcpy+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rdi),%al
test   %al,%al
je     1121 <strcpy+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcpy+0x10>
movb   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcpy(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i32 0
}
/* Variables and functions */
scalar_t__ isLowerExtendedLetter(unsigned char);
scalar_t__ isUpperExtendedLetter(unsigned char);
short int isExtendedLetter(unsigned char chrsource) {
  if (isLowerExtendedLetter(chrsource) || isUpperExtendedLetter(chrsource))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isExtendedLetter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1030 <isLowerExtendedLetter@plt>
cmp    $0x0,%rax
jne    1154 <isExtendedLetter+0x34>
movzbl -0x3(%rbp),%edi
call   1040 <isUpperExtendedLetter@plt>
cmp    $0x0,%rax
je     115f <isExtendedLetter+0x3f>
movw   $0x1,-0x2(%rbp)
jmp    1165 <isExtendedLetter+0x45>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isExtendedLetter>:
push   %rbx
mov    %edi,%ebx
call   1030 <isLowerExtendedLetter@plt>
mov    %rax,%rcx
mov    $0x1,%ax
test   %rcx,%rcx
je     1136 <isExtendedLetter+0x16>
pop    %rbx
ret
movzbl %bl,%edi
call   1040 <isUpperExtendedLetter@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @isExtendedLetter(i8 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isLowerExtendedLetter(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @isUpperExtendedLetter(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i16 1, i16* %2
br label %13
12: ; preds = %7
store i16 0, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @isExtendedLetter(i8 zeroext %0) {
%2 = tail call i64 @isLowerExtendedLetter(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isUpperExtendedLetter(i8 zeroext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i16
br label %8
8: ; preds = %4, %1
%9 = phi i16 [ 1, %1 ], [ %7, %4 ]
ret i16 %9
}
void Process_Acceleration_Pkg(unsigned char inbuf[4096]
                              __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @Process_Acceleration_Pkg(i8* nocapture %0) {
ret void
}
int test_imm_C2int8_reg(signed char val) {
  return ((val) & (0xC2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C2int8_reg(i8 signext %0) {
%2 = and i8 %0, -62
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct blob_attr {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ blob_get_u64(struct blob_attr const *);
int64_t blob_get_int64(const struct blob_attr *attr) {
  return blob_get_u64(attr);
}


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

x86 assembly (clang, -O2):
<blob_get_int64>:
jmp    1030 <blob_get_u64@plt>

LLVM IR (-O0):
%struct.blob_attr = type { i32 }
define i32 @blob_get_int64(%struct.blob_attr* %0) {
%2 = alloca %struct.blob_attr*
store %struct.blob_attr* %0, %struct.blob_attr** %2
%3 = load %struct.blob_attr*, %struct.blob_attr** %2
%4 = call i32 @blob_get_u64(%struct.blob_attr* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
define i32 @blob_get_int64(%struct.blob_attr* %0) {
%2 = tail call i32 @blob_get_u64(%struct.blob_attr* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int __byte(int *, int /*<<< orphan*/);
uint32_t UARTParityModeGet(uint32_t ui32Base) {
  ;
  return (__byte((int *)(ui32Base + 0x0), 0) & (0x00000060));
}


x86 assembly (clang, -O0):
<UARTParityModeGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
and    $0x60,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeGet>:
push   %rax
movslq %edi,%rdi
xor    %esi,%esi
call   1030 <__byte@plt>
and    $0x60,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UARTParityModeGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = call i32 @__byte(i32* %6, i32 0)
%8 = and i32 %7, 96
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTParityModeGet(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @__byte(i32* %3, i32 0)
%5 = and i32 %4, 96
ret i32 %5
}
void glRenderbufferStorage(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glRenderbufferStorage() {
ret void
}
char *test_column_insert() { return 0; }


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

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

LLVM IR (-O0):
define i8* @test_column_insert() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test_column_insert() {
ret i8* null
}
/* Variables and functions */
double currentime();
double deltatime(double start) {
  double res = currentime() - start;
  if (res < 0)
    res = -res;
  return res;
}


x86 assembly (clang, -O0):
<deltatime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <currentime@plt>
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115d <deltatime+0x4d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deltatime>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <currentime@plt>
subsd  (%rsp),%xmm0
movapd 0xed6(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @deltatime(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @currentime()
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %3
%7 = load double, double* %3
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = fneg double %10
store double %11, double* %3
br label %12
12: ; preds = %9, %1
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
define double @deltatime(double %0) {
%2 = tail call double (...) @currentime()
%3 = fsub double %2, %0
%4 = fcmp olt double %3, 0.000000e+00
%5 = fneg double %3
%6 = select i1 %4, double %5, double %3
ret double %6
}
/* Variables and functions */
char const *tchdberrmsg(int);
const char *tcjdberrmsg(int ecode) { return tchdberrmsg(ecode); }


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

x86 assembly (clang, -O2):
<tcjdberrmsg>:
jmp    1030 <tchdberrmsg@plt>

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

LLVM IR (-O2):
define i8* @tcjdberrmsg(i32 %0) {
%2 = tail call i8* @tchdberrmsg(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printAAA();
int /*<<< orphan*/ printBBB();
int main(int argc, char **argv) {
  printAAA();
  printBBB();
  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    $0x0,%al
call   1040 <printAAA@plt>
mov    $0x0,%al
call   1030 <printBBB@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = call i32 (...) @printAAA()
%7 = call i32 (...) @printBBB()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @printAAA()
%4 = tail call i32 (...) @printBBB()
ret i32 0
}
/* Type definitions */
struct genlist {
  int dummy;
};

/* Variables and functions */
void *genlist_link_data(int /*<<< orphan*/);
int /*<<< orphan*/ genlist_tail(struct genlist const *);
void *genlist_back(const struct genlist *pgenlist) {
  return genlist_link_data(genlist_tail(pgenlist));
}


x86 assembly (clang, -O0):
<genlist_back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <genlist_tail@plt>
mov    %eax,%edi
call   1030 <genlist_link_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genlist_back>:
push   %rax
call   1040 <genlist_tail@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <genlist_link_data@plt>

LLVM IR (-O0):
%struct.genlist = type { i32 }
define i8* @genlist_back(%struct.genlist* %0) {
%2 = alloca %struct.genlist*
store %struct.genlist* %0, %struct.genlist** %2
%3 = load %struct.genlist*, %struct.genlist** %2
%4 = call i32 @genlist_tail(%struct.genlist* %3)
%5 = call i8* @genlist_link_data(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.genlist = type { i32 }
define i8* @genlist_back(%struct.genlist* %0) {
%2 = tail call i32 @genlist_tail(%struct.genlist* %0)
%3 = tail call i8* @genlist_link_data(i32 %2)
ret i8* %3
}
__attribute__((no, noclone)) void fn2(void) {
  volatile int i;
  int m = 7;
  volatile int a[m];
  asm("" : : "r"(&a) : "memory");
  i = a[-1];
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x7,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
mov    -0x4(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
lea    -0x28(%rsp),%rax
mov    -0x2c(%rsp),%eax
mov    %eax,-0x2c(%rsp)
ret

LLVM IR (-O0):
define void @fn2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 7, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = load volatile i32, i32* %9
store volatile i32 %10, i32* %1
%11 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @fn2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i8* @llvm.stacksave()
%4 = alloca [7 x i32]
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 -1
%7 = load volatile i32, i32* %6
store volatile i32 %7, i32* %1
ret void
}
int bics_si_test2(int a, int b) {
  if (a & ~(b << 2))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bics_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     112d <bics_si_test2+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <bics_si_test2+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test2>:
shl    $0x2,%esi
not    %esi
xor    %eax,%eax
test   %edi,%esi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @bics_si_test2(i32 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned rotate_left(unsigned x, int n) {
  int w = sizeof(int) << 3;
  return (x << n) | (x >> (w - n) & ((1 << n) - 1));
}


x86 assembly (clang, -O0):
<rotate_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x10(%rbp),%ecx
sub    $0x1,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_left>:
mov    %edi,%edx
mov    %esi,%ecx
shl    %cl,%edx
neg    %cl
shr    %cl,%edi
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
not    %eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = lshr i32 %9, %12
%14 = load i32, i32* %4
%15 = shl i32 1, %14
%16 = sub nsw i32 %15, 1
%17 = and i32 %13, %16
%18 = or i32 %8, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = lshr i32 %0, %4
%6 = shl nsw i32 -1, %1
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
%9 = or i32 %8, %3
ret i32 %9
}
void test45_Test9_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test45_Test9_pollen__run__E() {
ret void
}
int test_for() {
  int i, sum = 0;
  for (i = 0; i < 100; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<test_for>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1133 <test_for+0x33>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <test_for+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_for() {
ret i32 4950
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long rsystime() {
  struct timeval ts;
  gettimeofday(&ts, NULL);
  return ts.tv_sec * 1000 + ts.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<rsystime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsystime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @rsystime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @rsystime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
void rop3_113_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ *D;
  stk3 = T ^ *D;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_113_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_113_0_0>:
mov    (%rdi),%al
xor    %al,%dl
xor    %sil,%al
and    %al,%dl
xor    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_113_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %4, %2
%7 = and i8 %5, %6
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
void INT_UART1_RX(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_UART1_RX() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() {
  fprintf(stdout, "Tool for packing WebUI firmware.\n"
                  "Usage: uipack -d <dir> -o <output file>\n"
                  "\t-d <dir> directory which needs to be packed\n"
                  "\t-o <output file> output file name\n"
                  "\t-h prints this message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [178 x i8] c"Tool for packing WebUI firmware.\0AUsage: uipack -d <dir> -o <output file>\0A\09-d <dir> directory which needs to be packed\0A\09-o <output file> output file name\0A\09-h prints this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [178 x i8] c"Tool for packing WebUI firmware.\0AUsage: uipack -d <dir> -o <output file>\0A\09-d <dir> directory which needs to be packed\0A\09-o <output file> output file name\0A\09-h prints this message\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t barRead8(uint32_t bar, uint32_t offset) {
  volatile uint8_t *pReg = (volatile uint8_t *)(bar | (offset & 0xFF));
  return (*pReg);
}


x86 assembly (clang, -O0):
<barRead8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<barRead8>:
movzbl %sil,%eax
or     %edi,%eax
cltq
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @barRead8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = or i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @barRead8(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = or i32 %3, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
double modf(double, double *);
struct timeval sectotimeval(double sec) {
  struct timeval a;
  double f, i;
  f = modf(sec, &i);
  a.tv_sec = (long)i;
  a.tv_usec = (long)(f * 1000000);
  return a;
}


x86 assembly (clang, -O0):
<sectotimeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x28(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sectotimeval>:
push   %rax
mov    %rsp,%rdi
call   1030 <modf@plt>
cvttsd2si (%rsp),%rax
mulsd  0xed9(%rip),%xmm0
cvttsd2si %xmm0,%rdx
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define { i64, i64 } @sectotimeval(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = call double @modf(double %6, double* %5)
store double %7, double* %4
%8 = load double, double* %5
%9 = fptosi double %8 to i64
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i64 %9, i64* %10
%11 = load double, double* %4
%12 = fmul double %11, 1.000000e+06
%13 = fptosi double %12 to i64
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.timeval* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @sectotimeval(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call double @modf(double %0, double* %2)
%5 = load double, double* %2
%6 = fptosi double %5 to i64
%7 = fmul double %4, 1.000000e+06
%8 = fptosi double %7 to i64
%9 = insertvalue { i64, i64 } poison, i64 %6, 0
%10 = insertvalue { i64, i64 } %9, i64 %8, 1
ret { i64, i64 } %10
}
/* Variables and functions */
int /*<<< orphan*/ POLLOUT;
int zio_readable_or_writeable(int, int /*<<< orphan*/);
int zio_writeable(int fd) { return zio_readable_or_writeable(fd, POLLOUT); }


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

x86 assembly (clang, -O2):
<zio_writeable>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <zio_readable_or_writeable@plt>

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

LLVM IR (-O2):
@POLLOUT = global i32 0
define i32 @zio_writeable(i32 %0) {
%2 = load i32, i32* @POLLOUT
%3 = tail call i32 @zio_readable_or_writeable(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ proc(int);
int main(int argc, char *argv[]) {
  proc(7);
  return EXIT_SUCCESS;
}


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    $0x7,%edi
call   1030 <proc@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1030 <proc@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = call i32 @proc(i32 7)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @proc(i32 7)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void gtk_text_direction_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_direction_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIZE_MAX;
size_t utf8nsize_lazy(void const *, int /*<<< orphan*/);
size_t utf8size_lazy(const void *str) { return utf8nsize_lazy(str, SIZE_MAX); }


x86 assembly (clang, -O0):
<utf8size_lazy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <utf8nsize_lazy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8size_lazy>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <utf8nsize_lazy@plt>

LLVM IR (-O0):
@SIZE_MAX = global i32 0
define i64 @utf8size_lazy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @SIZE_MAX
%5 = call i64 @utf8nsize_lazy(i8* %3, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i64 @utf8size_lazy(i8* %0) {
%2 = load i32, i32* @SIZE_MAX
%3 = tail call i64 @utf8nsize_lazy(i8* %0, i32 %2)
ret i64 %3
}