xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ Term_addstr(int, int, char *);
int /*<<< orphan*/ ascii_to_text(char *, int, char *);
int /*<<< orphan*/ flush();
char inkey();
char keymap_get_trigger(void) {
  char tmp[80];
  char buf[2];
  flush();
  buf[0] = inkey();
  buf[1] = '\0';
  ascii_to_text(tmp, sizeof(tmp), buf);
  Term_addstr(-1, 1, tmp);
  flush();
  return buf[0];
}


x86 assembly (clang, -O0):
<keymap_get_trigger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    $0x0,%al
call   1030 <flush@plt>
mov    $0x0,%al
call   1060 <inkey@plt>
mov    %al,-0x52(%rbp)
movb   $0x0,-0x51(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x52(%rbp),%rdx
mov    $0x50,%esi
call   1040 <ascii_to_text@plt>
lea    -0x50(%rbp),%rdx
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1050 <Term_addstr@plt>
mov    $0x0,%al
call   1030 <flush@plt>
movsbl -0x52(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keymap_get_trigger>:
push   %rbx
sub    $0x60,%rsp
xor    %eax,%eax
call   1030 <flush@plt>
xor    %eax,%eax
call   1060 <inkey@plt>
mov    %al,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0x10(%rsp),%rbx
lea    0xe(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <ascii_to_text@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1050 <Term_addstr@plt>
xor    %eax,%eax
call   1030 <flush@plt>
mov    0xe(%rsp),%al
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @keymap_get_trigger() {
%1 = alloca [80 x i8]
%2 = alloca [2 x i8]
%3 = call i32 (...) @flush()
%4 = call signext i8 (...) @inkey()
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %4, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%9 = call i32 @ascii_to_text(i8* %7, i32 80, i8* %8)
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%11 = call i32 @Term_addstr(i32 -1, i32 1, i8* %10)
%12 = call i32 (...) @flush()
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%14 = load i8, i8* %13
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @keymap_get_trigger() {
%1 = alloca [80 x i8]
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (...) @flush()
%6 = tail call signext i8 (...) @inkey()
store i8 %6, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %7
%8 = call i32 @ascii_to_text(i8* %3, i32 80, i8* %4)
%9 = call i32 @Term_addstr(i32 -1, i32 1, i8* %3)
%10 = call i32 (...) @flush()
%11 = load i8, i8* %4
ret i8 %11
}
/* Variables and functions */
char *_(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *itoa(int num) {
  char buff[10];
  sprintf(buff, "%d", num);
  return _(buff);
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xe(%rbp),%rdi
call   1030 <_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <_@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @_(i8* %3)
ret i8* %5
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double remainderl(long double x, long double y) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<remainderl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @remainderl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @remainderl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
void I2CDMARxEventEnable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x94)))) |= ((0x00008000u));
  (*((volatile unsigned int *)(baseAdd + (0x38)))) = ((0x00000001u));
}


x86 assembly (clang, -O0):
<I2CDMARxEventEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x94,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x8000,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
mov    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CDMARxEventEnable>:
lea    0x94(%rdi),%eax
orl    $0x8000,(%rax)
add    $0x38,%edi
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @I2CDMARxEventEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 148
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 32768
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add i32 %9, 56
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 1, i32* %12
ret void
}

LLVM IR (-O2):
define void @I2CDMARxEventEnable(i32 %0) {
%2 = add i32 %0, 148
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 32768
store volatile i32 %6, i32* %4
%7 = add i32 %0, 56
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 1, i32* %9
ret void
}
int choosePivot(int i, int j) { return ((i + j) / 2); }


x86 assembly (clang, -O0):
<choosePivot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<choosePivot>:
lea    (%rdi,%rsi,1),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @choosePivot(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 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @choosePivot(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int some_called_function();
int main(int argc, char **argv) { return some_called_function(); }


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   1030 <some_called_function@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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 (...) @some_called_function()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @some_called_function()
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void func_d2c_c(int /*<<< orphan*/ *, int, int /*<<< orphan*/,
                int /*<<< orphan*/, int /*<<< orphan*/ *);
void func_d78_c(uint8_t *key, int key_length, uint32_t a2, uint32_t count,
                uint8_t *out) {
  return func_d2c_c(key, key_length, a2, count, out);
}


x86 assembly (clang, -O0):
<func_d78_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <func_d2c_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_d78_c>:
jmp    1030 <func_d2c_c@plt>

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

LLVM IR (-O2):
define void @func_d78_c(i32* %0, i32 %1, i32 %2, i32 %3, i32* %4) {
tail call void @func_d2c_c(i32* %0, i32 %1, i32 %2, i32 %3, i32* %4)
ret void
}
/* Type definitions */
struct termios {
  void *c_ospeed;
  void *c_ispeed;
};
typedef void *speed_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int cfsetspeed(struct termios *termiosp, speed_t speed) {
  if (termiosp == NULL) {
    errno = EINVAL;
    return -1;
  }
  termiosp->c_ispeed = speed;
  termiosp->c_ospeed = speed;
  return 0;
}


x86 assembly (clang, -O0):
<cfsetspeed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <cfsetspeed+0x35>
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cfsetspeed+0x53>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfsetspeed>:
test   %rdi,%rdi
je     110f <cfsetspeed+0xf>
mov    %rsi,0x8(%rdi)
mov    %rsi,(%rdi)
xor    %eax,%eax
ret
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    0x2ec1(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.termios = type { i8*, i8* }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @cfsetspeed(%struct.termios* writeonly %0, i8* %1) {
%3 = icmp eq %struct.termios* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
br label %9
6: ; preds = %2
%7 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 1
store i8* %1, i8** %7
%8 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
store i8* %1, i8** %8
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %10
}
/* Variables and functions */
char *popString();
int /*<<< orphan*/ pushString(int /*<<< orphan*/);
int /*<<< orphan*/ ucase(char *);
void basUCase() {
  char *string;
  string = popString();
  pushString(ucase(string));
}


x86 assembly (clang, -O0):
<basUCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ucase@plt>
mov    %eax,%edi
call   1040 <pushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basUCase>:
push   %rax
xor    %eax,%eax
call   1030 <popString@plt>
mov    %rax,%rdi
call   1050 <ucase@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushString@plt>

LLVM IR (-O0):
define void @basUCase() {
%1 = alloca i8*
%2 = call i8* (...) @popString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @ucase(i8* %3)
%5 = call i32 @pushString(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basUCase() {
%1 = tail call i8* (...) @popString()
%2 = tail call i32 @ucase(i8* %1)
%3 = tail call i32 @pushString(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello\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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_0Eint8_mem(signed char *val) {
  return ((*val) & (0x0E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Eint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 14
%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_0Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 14
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main(void) {
  int a = 1;
  printf("%d", &a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dump_function();
int main(int argc, char **argv) {
  dump_function();
  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   1030 <dump_function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <dump_function@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 (...) @dump_function()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @dump_function()
ret i32 0
}
int CheckNamespacesSupportedChild(void *arg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CheckNamespacesSupportedChild(i8* nocapture readnone %0) {
ret i32 0
}
int d_gt_mr2(double *a1, double a2) { return !(((*a1) > (a2))); }


x86 assembly (clang, -O0):
<d_gt_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_gt_mr2>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_gt_mr2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_gt_mr2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ule double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int number();
int get_key_num(void) {
  int ret = number();
  return (ret);
}


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

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

LLVM IR (-O0):
define i32 @get_key_num() {
%1 = alloca i32
%2 = call i32 (...) @number()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_key_num() {
%1 = tail call i32 (...) @number()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_nondet_int_val();
int /*<<< orphan*/ nestedLoop(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
main() {
  nestedLoop(__VERIFIER_nondet_int_val(), __VERIFIER_nondet_int_val(),
             __VERIFIER_nondet_int_val());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int_val@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int_val@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int_val@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    %eax,%edx
call   1030 <nestedLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @__VERIFIER_nondet_int_val()
%2 = call i32 (...) @__VERIFIER_nondet_int_val()
%3 = call i32 (...) @__VERIFIER_nondet_int_val()
%4 = call i32 @nestedLoop(i32 %1, i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int_val()
%2 = tail call i32 (...) @__VERIFIER_nondet_int_val()
%3 = tail call i32 (...) @__VERIFIER_nondet_int_val()
%4 = tail call i32 @nestedLoop(i32 %1, i32 %2, i32 %3)
ret i32 0
}
void kasan_kfree(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @kasan_kfree(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct Xorriso_lsT {
  int dummy;
};

/* Variables and functions */
int Xorriso_lst_new_binary(struct Xorriso_lsT **, char *, scalar_t__,
                           struct Xorriso_lsT *, int);
scalar_t__ strlen(char *);
int Xorriso_lst_new(struct Xorriso_lsT **lstring, char *text,
                    struct Xorriso_lsT *link, int flag) {
  int ret;
  ret = Xorriso_lst_new_binary(lstring, text, strlen(text) + 1, link, flag);
  return (ret);
}


x86 assembly (clang, -O0):
<Xorriso_lst_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <Xorriso_lst_new_binary@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xorriso_lst_new>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rcx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <Xorriso_lst_new_binary@plt>

LLVM IR (-O0):
%struct.Xorriso_lsT = type { i32 }
define i32 @Xorriso_lst_new(%struct.Xorriso_lsT** %0, i8* %1, %struct.Xorriso_lsT* %2, i32 %3) {
%5 = alloca %struct.Xorriso_lsT**
%6 = alloca i8*
%7 = alloca %struct.Xorriso_lsT*
%8 = alloca i32
%9 = alloca i32
store %struct.Xorriso_lsT** %0, %struct.Xorriso_lsT*** %5
store i8* %1, i8** %6
store %struct.Xorriso_lsT* %2, %struct.Xorriso_lsT** %7
store i32 %3, i32* %8
%10 = load %struct.Xorriso_lsT**, %struct.Xorriso_lsT*** %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i64 @strlen(i8* %12)
%14 = add nsw i64 %13, 1
%15 = load %struct.Xorriso_lsT*, %struct.Xorriso_lsT** %7
%16 = load i32, i32* %8
%17 = call i32 @Xorriso_lst_new_binary(%struct.Xorriso_lsT** %10, i8* %11, i64 %14, %struct.Xorriso_lsT* %15, i32 %16)
store i32 %17, i32* %9
%18 = load i32, i32* %9
ret i32 %18
}

LLVM IR (-O2):
%struct.Xorriso_lsT = type { i32 }
define i32 @Xorriso_lst_new(%struct.Xorriso_lsT** %0, i8* %1, %struct.Xorriso_lsT* %2, i32 %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @Xorriso_lst_new_binary(%struct.Xorriso_lsT** %0, i8* %1, i64 %6, %struct.Xorriso_lsT* %2, i32 %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ pr_warning(char *);
void efree(void *p) {
  if (p == NULL)
    pr_warning("efree(): NULL pointer as argument");
  else
    free(p);
}


x86 assembly (clang, -O0):
<efree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <efree+0x28>
lea    0xec2(%rip),%rdi
call   1040 <pr_warning@plt>
jmp    1151 <efree+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efree>:
test   %rdi,%rdi
je     112a <efree+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <pr_warning@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"efree(): NULL pointer as argument\00"
define void @efree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @pr_warning(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"efree(): NULL pointer as argument\00"
define void @efree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @pr_warning(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int palindrome_longest(char *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  char str[] = "testtsetabbababababaababababab";
  printf("ret = %d\n", palindrome_longest(str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0x4(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x2(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <palindrome_longest@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee4(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <palindrome_longest@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [31 x i8] c"testtsetabbababababaababababab\00"
@.str = [10 x i8] c"ret = %d\0A\00"
define void @main() {
%1 = alloca [31 x i8]
%2 = bitcast [31 x i8]* %1 to i8*
%3 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%4 = call i32 @palindrome_longest(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@__const.main.str = [31 x i8] c"testtsetabbababababaababababab\00"
@.str = [10 x i8] c"ret = %d\0A\00"
define void @main() {
%1 = alloca [31 x i8]
%2 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%3 = call i32 @palindrome_longest(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int /*<<< orphan*/ pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
char *strdup(int /*<<< orphan*/);
char *pid_get_user_name(uid_t uid) {
  struct passwd *pw = getpwuid(uid);
  if (pw)
    return strdup(pw->pw_name);
  return NULL;
}


x86 assembly (clang, -O0):
<pid_get_user_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <pid_get_user_name+0x36>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    115e <pid_get_user_name+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pid_get_user_name>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1133 <pid_get_user_name+0x13>
mov    (%rax),%edi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i8* @pid_get_user_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.passwd*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp ne %struct.passwd* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load %struct.passwd*, %struct.passwd** %4
%11 = getelementptr inbounds %struct.passwd, %struct.passwd* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i8* @strdup(i32 %12)
store i8* %13, i8** %2
br label %15
14: ; preds = %1
store i8* null, i8** %2
br label %15
15: ; preds = %14, %9
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i8* @pid_get_user_name(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i8* @strdup(i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ null, %1 ]
ret i8* %9
}
int all_upper(str)
register unsigned char *str;
{
  while (*str) {
    if (!((*str) <= 0177) || !isupper((char)*str))
      return (0);
    ++str;
  }
  return (1);
}


x86 assembly (clang, -O0):
<all_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <all_upper+0x5b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x7f,%eax
jg     114e <all_upper+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
jne    115a <all_upper+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1172 <all_upper+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <all_upper+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_upper>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114b <all_upper+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %al,%al
js     1150 <all_upper+0x40>
movzbl %al,%edi
call   1030 <isupper@plt>
test   %eax,%eax
je     1150 <all_upper+0x40>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <all_upper+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @all_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %11
%5 = load i8, i8* %15
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %15, %4 ], [ %0, %1 ]
%10 = icmp sgt i8 %8, -1
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = zext i8 %8 to i32
%13 = tail call i32 @isupper(i32 %12)
%14 = icmp eq i32 %13, 0
%15 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %14, label %16, label %4
16: ; preds = %11, %7, %4, %1
%17 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ], [ 0, %11 ]
ret i32 %17
}
/* Type definitions */
struct pavl_table {
  int dummy;
};

/* Variables and functions */
void **pavl_probe(struct pavl_table *, void *);
void *pavl_replace(struct pavl_table *table, void *item) {
  void **p = pavl_probe(table, item);
  if (p == NULL || *p == item)
    return NULL;
  else {
    void *r = *p;
    *p = item;
    return r;
  }
}


x86 assembly (clang, -O0):
<pavl_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <pavl_probe@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <pavl_replace+0x3d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    115a <pavl_replace+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1178 <pavl_replace+0x68>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pavl_replace>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pavl_probe@plt>
test   %rax,%rax
je     112e <pavl_replace+0x1e>
mov    %rax,%rcx
mov    (%rax),%rax
cmp    %rbx,%rax
je     112e <pavl_replace+0x1e>
mov    %rbx,(%rcx)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pavl_table = type { i32 }
define i8* @pavl_replace(%struct.pavl_table* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.pavl_table*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
store %struct.pavl_table* %0, %struct.pavl_table** %4
store i8* %1, i8** %5
%8 = load %struct.pavl_table*, %struct.pavl_table** %4
%9 = load i8*, i8** %5
%10 = call i8** @pavl_probe(%struct.pavl_table* %8, i8* %9)
store i8** %10, i8*** %6
%11 = load i8**, i8*** %6
%12 = icmp eq i8** %11, null
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = load i8*, i8** %5
%17 = icmp eq i8* %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13, %2
store i8* null, i8** %3
br label %25
19: ; preds = %13
%20 = load i8**, i8*** %6
%21 = load i8*, i8** %20
store i8* %21, i8** %7
%22 = load i8*, i8** %5
%23 = load i8**, i8*** %6
store i8* %22, i8** %23
%24 = load i8*, i8** %7
store i8* %24, i8** %3
br label %25
25: ; preds = %19, %18
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
%struct.pavl_table = type { i32 }
define i8* @pavl_replace(%struct.pavl_table* %0, i8* %1) {
%3 = tail call i8** @pavl_probe(%struct.pavl_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
br i1 %7, label %9, label %8
8: ; preds = %5
store i8* %1, i8** %3
br label %9
9: ; preds = %2, %5, %8
%10 = phi i8* [ %6, %8 ], [ null, %5 ], [ null, %2 ]
ret i8* %10
}
unsigned get_exp(unsigned uf) { return (uf >> 23) & ((1 << 8) - 1); }


x86 assembly (clang, -O0):
<get_exp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x17,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_exp>:
shr    $0x17,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @get_exp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 23
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_exp(i32 %0) {
%2 = lshr i32 %0, 23
%3 = and i32 %2, 255
ret i32 %3
}
foo(int a, int *p) {
  int x = *p + 2;
  int y = *p - 1;
  int z = *p + 9;
  if (p)
    a = x + y + z;
  else
    a = x - y;
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x9,%eax
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <foo+0x4b>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <foo+0x54>
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rsi),%eax
lea    (%rax,%rax,2),%eax
add    $0xa,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 1
%5 = add i32 %3, 10
%6 = add i32 %5, %4
ret i32 %6
}
/* Type definitions */
struct stash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ empty_stash(struct stash *);
void destroy_defer_bfree(struct stash *defree) { empty_stash(defree); }


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

x86 assembly (clang, -O2):
<destroy_defer_bfree>:
jmp    1030 <empty_stash@plt>

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

LLVM IR (-O2):
%struct.stash = type { i32 }
define void @destroy_defer_bfree(%struct.stash* %0) {
%2 = tail call i32 @empty_stash(%struct.stash* %0)
ret void
}
void psgstrf_StackFree() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_TYPE;
scalar_t__ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *,
                      int *);
int socket_type(int fd) {
  int type = 0;
  socklen_t len = sizeof(type);
  if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &type, &len) < 0)
    return -1;
  return type;
}


x86 assembly (clang, -O0):
<socket_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0x0,%rax
jge    1161 <socket_type+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <socket_type+0x57>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_type>:
push   %rax
movl   $0x0,(%rsp)
movl   $0x4,0x4(%rsp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
lea    0x4(%rsp),%r8
call   1030 <getsockopt@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     114f <socket_type+0x3f>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_TYPE = global i32 0
define i32 @socket_type(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_TYPE
%9 = call i64 @getsockopt(i32 %6, i32 %7, i32 %8, i32* %4, i32* %5)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_TYPE = global i32 0
define i32 @socket_type(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_TYPE
%8 = call i64 @getsockopt(i32 %0, i32 %6, i32 %7, i32* %2, i32* %3)
%9 = icmp slt i64 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
int strlen(char const *);
int testFn(const char *str) {
  return (str && *str && str[strlen(str) - 1] == '}') ? 1 : 0;
}


x86 assembly (clang, -O0):
<testFn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     116b <testFn+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     116b <testFn+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7d,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFn>:
push   %rbx
xor    %eax,%eax
test   %rdi,%rdi
je     1135 <testFn+0x25>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1135 <testFn+0x25>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x7d,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @testFn(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 %20
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 125
br label %20
20: ; preds = %10, %5, %1
%21 = phi i1 [ false, %5 ], [ false, %1 ], [ %19, %10 ]
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
ret i32 %23
}

LLVM IR (-O2):
define i32 @testFn(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 125
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %6, %3, %1
%15 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %13, %6 ]
ret i32 %15
}
viewpo_(xlow, xhigh, ylow, yhigh) int *xlow, *ylow, *xhigh, *yhigh;
{ viewport(*xlow, *xhigh, *ylow, *yhigh); }


x86 assembly (clang, -O0):
<viewpo_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    $0x0,%al
call   1030 <viewport@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewpo_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
xor    %eax,%eax
jmp    1030 <viewport@plt>

LLVM IR (-O0):
define i32 @viewpo_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @viewport to i32 (i32, i32, i32, i32, ...)*)(i32 %11, i32 %13, i32 %15, i32 %17)
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @viewpo_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @viewport to i32 (i32, i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 %7, i32 %8)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ DMA14_DMA30_DriverIRQHandler();
__attribute__((weak)) void DMA14_DMA30_IRQHandler(void) {
  DMA14_DMA30_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA14_DMA30_IRQHandler() {
%1 = call i32 (...) @DMA14_DMA30_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA14_DMA30_IRQHandler() {
%1 = tail call i32 (...) @DMA14_DMA30_DriverIRQHandler()
ret void
}