xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ uartSendByte(char const);
void __putchar(const char c) { uartSendByte(c); }


x86 assembly (clang, -O0):
<__putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <uartSendByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__putchar>:
jmp    1030 <uartSendByte@plt>

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

LLVM IR (-O2):
define void @__putchar(i8 signext %0) {
%2 = tail call i32 @uartSendByte(i8 signext %0)
ret void
}
int test_imm_CEuint8_reg(unsigned char val) {
  return ((val) & (0xCE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CEuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 206
%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_CEuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -50
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ serial_haschar();
int serial_getchar(void) {
  if (serial_haschar())
    return (*((volatile unsigned int *)((0x12000000 + 0x000) + 0x8)));
  else
    return -1;
}


x86 assembly (clang, -O0):
<serial_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <serial_haschar@plt>
cmp    $0x0,%rax
je     1138 <serial_getchar+0x28>
mov    $0x12000008,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <serial_getchar+0x2f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_getchar>:
push   %rax
xor    %eax,%eax
call   1030 <serial_haschar@plt>
test   %rax,%rax
je     1126 <serial_getchar+0x16>
mov    0x12000008,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serial_getchar() {
%1 = alloca i32
%2 = call i64 (...) @serial_haschar()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 301989896 to i32*)
store i32 %5, i32* %1
br label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @serial_getchar() {
%1 = tail call i64 (...) @serial_haschar()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = load volatile i32, i32* inttoptr (i64 301989896 to i32*)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_1__ data;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int,
                             struct epoll_event *);
void delete_event(int epollfd, int fd, int state) {
  struct epoll_event ev;
  ev.events = state;
  ev.data.fd = fd;
  epoll_ctl(epollfd, EPOLL_CTL_DEL, fd, &ev);
}


x86 assembly (clang, -O0):
<delete_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
lea    -0x18(%rbp),%rcx
call   1030 <epoll_ctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_event>:
push   %rax
mov    %esi,%eax
mov    %edx,(%rsp)
mov    %esi,0x4(%rsp)
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%esi
mov    %rsp,%rcx
mov    %eax,%edx
call   1030 <epoll_ctl@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_DEL = global i32 0
define void @delete_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.epoll_event
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %7, i32 0, i32 1
%12 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %11, i32 0, i32 0
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = load i32, i32* @EPOLL_CTL_DEL
%15 = load i32, i32* %5
%16 = call i32 @epoll_ctl(i32 %13, i32 %14, i32 %15, %struct.epoll_event* %7)
ret void
}

LLVM IR (-O2):
%struct.epoll_event = type { i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@EPOLL_CTL_DEL = global i32 0
define void @delete_event(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.epoll_event
%5 = bitcast %struct.epoll_event* %4 to i8*
%6 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %4, i64 0, i32 1, i32 0
store i32 %1, i32* %7
%8 = load i32, i32* @EPOLL_CTL_DEL
%9 = call i32 @epoll_ctl(i32 %0, i32 %8, i32 %1, %struct.epoll_event* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int strtoul(char *, char **, int /*<<< orphan*/);
int main() {
  char *string = "0";
  char *term;
  int value;
  value = strtoul(string, &term, 0);
  if ((value != 0) || (term != (string + 1))) {
    exit(1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    116b <main+0x4b>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
je     1175 <main+0x55>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
test   %eax,%eax
jne    114a <main+0x2a>
lea    0xec4(%rip),%rax
cmp    %rax,(%rsp)
jne    114a <main+0x2a>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strtoul(i8* %5, i8** %3, i32 0)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %0
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = icmp ne i8* %10, %12
br i1 %13, label %14, label %16
14: ; preds = %9, %0
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %9
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i32 @strtoul(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %1, i32 0)
%4 = icmp eq i32 %3, 0
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 1)
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memtr_init();
int /*<<< orphan*/ memtr_print(char *, size_t, void *);
void *orig_calloc(size_t, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *p;
  memtr_init();
  memtr_print("c<", nmemb * size, 0);
  p = orig_calloc(nmemb, size);
  memtr_print("c>", nmemb * size, p);
  return p;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <memtr_init@plt>
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <memtr_print@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <orig_calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe7e(%rip),%rdi
call   1030 <memtr_print@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <memtr_init@plt>
mov    %r14,%rbx
imul   %r15,%rbx
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <memtr_print@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <orig_calloc@plt>
mov    %rax,%r14
lea    0xe94(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <memtr_print@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"c<\00"
@.str.1 = [3 x i8] c"c>\00"
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = call i32 (...) @memtr_init()
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
%10 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %9, i8* null)
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i8* @orig_calloc(i64 %11, i64 %12)
store i8* %13, i8** %5
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
%17 = load i8*, i8** %5
%18 = call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"c<\00"
@.str.1 = [3 x i8] c"c>\00"
define i8* @calloc(i64 %0, i64 %1) {
%3 = tail call i32 (...) @memtr_init()
%4 = mul i64 %1, %0
%5 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %4, i8* null)
%6 = tail call i8* @orig_calloc(i64 %0, i64 %1)
%7 = tail call i32 @memtr_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 %4, i8* %6)
ret i8* %6
}
/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ trim(char *);
void rstdin_s(char *data, int s) {
  if (fgets(data, s, stdin)) {
    trim(data);
    return;
  } else {
    printf("Datos invalidos, intente de nuevo.\n");
    return rstdin_s(data, s);
  }
}


x86 assembly (clang, -O0):
<rstdin_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     117c <rstdin_s+0x3c>
mov    -0x8(%rbp),%rdi
call   1050 <trim@plt>
jmp    1194 <rstdin_s+0x54>
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <rstdin_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rstdin_s>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea5(%rip),%r15
mov    (%r15),%edx
call   1050 <fgets@plt>
test   %rax,%rax
jne    117a <rstdin_s+0x4a>
lea    0xea9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1160 <rstdin_s+0x30>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <trim@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [36 x i8] c"Datos invalidos, intente de nuevo.\0A\00"
define void @rstdin_s(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 = load i32, i32* @stdin
%8 = call i64 @fgets(i8* %5, i32 %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @trim(i8* %11)
br label %17
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [35 x i8] c"Datos invalidos, intente de nuevo.\00"
define void @rstdin_s(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i64 @fgets(i8* %0, i32 %1, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %8, %2
%7 = tail call i32 @trim(i8* %0)
ret void
8: ; preds = %2, %8
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* @stdin
%11 = tail call i64 @fgets(i8* %0, i32 %1, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %8, label %6
}
/* Variables and functions */
int epoll_create(int);
int /*<<< orphan*/ vpn_ws_error(char *);
int vpn_ws_event_queue(int n) {
  int ret = epoll_create(n);
  if (ret < 0) {
    vpn_ws_error("vpn_ws_event_queue()/epoll_create()");
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<vpn_ws_event_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <epoll_create@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1158 <vpn_ws_event_queue+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <vpn_ws_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <vpn_ws_event_queue+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpn_ws_event_queue>:
push   %rax
call   1040 <epoll_create@plt>
test   %eax,%eax
js     112c <vpn_ws_event_queue+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1030 <vpn_ws_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"vpn_ws_event_queue()/epoll_create()\00"
define i32 @vpn_ws_event_queue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @epoll_create(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @vpn_ws_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [36 x i8] c"vpn_ws_event_queue()/epoll_create()\00"
define i32 @vpn_ws_event_queue(i32 %0) {
%2 = tail call i32 @epoll_create(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @vpn_ws_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float bits_to_float(uint32_t a) {
  union {
    float f;
    uint32_t i;
  } x;
  x.i = a;
  return x.f;
}


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

x86 assembly (clang, -O2):
<bits_to_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @bits_to_float(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @bits_to_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_usage(void) {
  printf("USAGE: spi_test -d dev -l len -m mosi -s speed\n"
         "      -d,--device dev: name of the spi device node\n"
         "      -l,--length len: length of spi transaction(bytes)\n"
         "      -m,--mosi mosi: hex value to be transmitted\n"
         "      -s,--speed speed: speed of the transaction in Hz\n\n"
         "EX: spi_test -d /dev/spidev0.0 -l 4 -m 12AB\n\n"
         "Note: mosi will be padded or truncated\n"
         "      to the length speficied.\n"
         "      %d bytes maximum length.\n",
         64);
}


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

x86 assembly (clang, -O2):
<print_usage>:
lea    0xee9(%rip),%rdi
mov    $0x40,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [407 x i8] c"USAGE: spi_test -d dev -l len -m mosi -s speed\0A -d,--device dev: name of the spi device node\0A -l,--length len: length of spi transaction(bytes)\0A -m,--mosi mosi: hex value to be transmitted\0A -s,--speed speed: speed of the transaction in Hz\0A\0AEX: spi_test -d /dev/spidev0.0 -l 4 -m 12AB\0A\0ANote: mosi will be padded or truncated\0A to the length speficied.\0A %d bytes maximum length.\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([407 x i8], [407 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}

LLVM IR (-O2):
@.str = [407 x i8] c"USAGE: spi_test -d dev -l len -m mosi -s speed\0A -d,--device dev: name of the spi device node\0A -l,--length len: length of spi transaction(bytes)\0A -m,--mosi mosi: hex value to be transmitted\0A -s,--speed speed: speed of the transaction in Hz\0A\0AEX: spi_test -d /dev/spidev0.0 -l 4 -m 12AB\0A\0ANote: mosi will be padded or truncated\0A to the length speficied.\0A %d bytes maximum length.\0A\00"
define void @print_usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([407 x i8], [407 x i8]* @.str, i64 0, i64 0), i32 64)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void *sds_alloc_cacheable(scalar_t__);
void *sds_alloc_non_cacheable(scalar_t__);
void *cma_alloc(uint32_t len, uint32_t cacheable) {
  if (cacheable) {
    return sds_alloc_cacheable(len);
  } else {
    return sds_alloc_non_cacheable(len);
  }
}


x86 assembly (clang, -O0):
<cma_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114d <cma_alloc+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <sds_alloc_cacheable@plt>
mov    %rax,-0x8(%rbp)
jmp    115a <cma_alloc+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <sds_alloc_non_cacheable@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cma_alloc>:
test   %rsi,%rsi
je     112a <cma_alloc+0xa>
jmp    1030 <sds_alloc_cacheable@plt>
jmp    1040 <sds_alloc_non_cacheable@plt>

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

LLVM IR (-O2):
define i8* @cma_alloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @sds_alloc_cacheable(i64 %0)
br label %8
6: ; preds = %2
%7 = tail call i8* @sds_alloc_non_cacheable(i64 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
void ice_remove_arfs(struct ice_pf *pf) {}


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

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

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

LLVM IR (-O2):
%struct.ice_pf = type opaque
define void @ice_remove_arfs(%struct.ice_pf* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void QEIIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT((ulBase == 0x4002C000) || (ulBase == 0x4002D000));
  (*((volatile unsigned long *)(ulBase + 0x00000028))) = ulIntFlags;
}


x86 assembly (clang, -O0):
<QEIIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x4002c000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <QEIIntClear+0x31>
cmpq   $0x4002d000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x4002c000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x28(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073922048
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073926144
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = add i64 %15, 40
%17 = inttoptr i64 %16 to i64*
store volatile i64 %14, i64* %17
ret void
}

LLVM IR (-O2):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073922048
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = add i64 %0, 40
%8 = inttoptr i64 %7 to i64*
store volatile i64 %1, i64* %8
ret void
}
void do_system_message(char byte1, char byte2) {}


x86 assembly (clang, -O0):
<do_system_message>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_system_message(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
ret void
}

LLVM IR (-O2):
define void @do_system_message(i8 signext %0, i8 signext %1) {
ret void
}
void ipcsyslog_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @ipcsyslog_cleanup() {
ret void
}
/* Variables and functions */
int cfg_processor_get_addr(char *, char *);
int cfg_timer_a_get_tactl_addr(void) {
  return cfg_processor_get_addr("timera", "tactl");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"timera\00"
@.str.1 = [6 x i8] c"tactl\00"
define i32 @cfg_timer_a_get_tactl_addr() {
%1 = call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"timera\00"
@.str.1 = [6 x i8] c"tactl\00"
define i32 @cfg_timer_a_get_tactl_addr() {
%1 = tail call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
void modif_rear2pcre_delim_modif_rear_ext() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear2pcre_delim_modif_rear_ext() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ identifier();
void variable(void) { identifier(); }


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

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

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

LLVM IR (-O2):
define void @variable() {
%1 = tail call i32 (...) @identifier()
ret void
}
/* Variables and functions */
char toupper(char);
char *strupper(char *s) {
  char *p;
  for (p = s; *p; p++)
    *p = toupper(*p);
  return s;
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupper+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupper+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strupper(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %14, %1
%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 = call signext i8 @toupper(i8 signext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
br label %14
14: ; preds = %9
%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** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @strupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
struct devbase {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_emit_instances(struct devbase *, int /*<<< orphan*/ *);
int emit_root_instance(const char *name, void *value, void *v) {
  do_emit_instances((struct devbase *)value, NULL);
  return 1;
}


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

x86 assembly (clang, -O2):
<emit_root_instance>:
push   %rax
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <do_emit_instances@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.devbase = type { i32 }
define i32 @emit_root_instance(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = bitcast i8* %7 to %struct.devbase*
%9 = call i32 @do_emit_instances(%struct.devbase* %8, i32* null)
ret i32 1
}

LLVM IR (-O2):
%struct.devbase = type { i32 }
define i32 @emit_root_instance(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %1 to %struct.devbase*
%5 = tail call i32 @do_emit_instances(%struct.devbase* %4, i32* null)
ret i32 1
}
void __DELETE_java_lang_ThreadGroup_ChildrenThreadsLock(void *me,
                                                        void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_lang_ThreadGroup_ChildrenThreadsLock(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_lang_ThreadGroup_ChildrenThreadsLock(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef unsigned int uint32_t;

/* Variables and functions */
int UINT64_C(int);
uint32_t pcg32(uint64_t s[1]) {
  uint64_t h = s[0];
  s[0] = h * UINT64_C(0x5851f42d4c957f2d) + UINT64_C(0xd737232eeccdf7ed);
  uint32_t x = ((h >> 18) ^ h) >> 27;
  unsigned r = h >> 59;
  return (x >> r) | (x << (-r & 31u));
}


x86 assembly (clang, -O0):
<pcg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x4c957f2d,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0xeccdf7ed,%edi
call   1030 <UINT64_C@plt>
mov    -0x18(%rbp),%ecx
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x12,%eax
xor    -0xc(%rbp),%eax
sar    $0x1b,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3b,%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
shr    %cl,%eax
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
and    $0x1f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg32>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%r14d
mov    $0x4c957f2d,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ebp
imul   %r14d,%ebp
mov    $0xeccdf7ed,%edi
call   1030 <UINT64_C@plt>
add    %ebp,%eax
mov    %eax,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pcg32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @UINT64_C(i32 1284865837)
%11 = mul nsw i32 %9, %10
%12 = call i32 @UINT64_C(i32 -322045971)
%13 = add nsw i32 %11, %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32, i32* %3
%17 = ashr i32 %16, 18
%18 = load i32, i32* %3
%19 = xor i32 %17, %18
%20 = ashr i32 %19, 27
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = ashr i32 %21, 59
store i32 %22, i32* %5
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = lshr i32 %23, %24
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = sub i32 0, %27
%29 = and i32 %28, 31
%30 = shl i32 %26, %29
%31 = or i32 %25, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @pcg32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @UINT64_C(i32 1284865837)
%4 = mul nsw i32 %3, %2
%5 = tail call i32 @UINT64_C(i32 -322045971)
%6 = add nsw i32 %4, %5
store i32 %6, i32* %0
ret i32 poison
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c, x;
  x = __VERIFIER_nondet_int();
  c = __VERIFIER_nondet_int();
  if (c == 0) {
    while (x >= 0) {
      x = x + c;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115f <main+0x4f>
jmp    1142 <main+0x32>
cmpl   $0x0,-0xc(%rbp)
jl     115a <main+0x4a>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <main+0x32>
jmp    115f <main+0x4f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jne    1132 <main+0x22>
test   %ebx,%ebx
js     1132 <main+0x22>
nopl   0x0(%rax)
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = icmp sgt i32 %1, -1
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %7
6: ; preds = %0, %6
br label %6
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error(int code) {
  switch (code) {
  case 1:
    fprintf(stderr, "Test Error\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    115b <error+0x3b>
jmp    113c <error+0x1c>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
cmp    $0x1,%edi
je     1126 <error+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Test Error\0A\00"
define void @error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
]
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Test Error\0A\00"
define void @error(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
void gdk_draw_rgb_32_image() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
FILE *fopen(const char *filename, const char *mode) {
  errno = ENOENT;
  return NULL;
}


x86 assembly (clang, -O0):
<fopen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32* @fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOENT
store i32 %5, i32* @errno
ret i32* null
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define noalias i32* @fopen(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32* null
}
/* Variables and functions */
double pow(int, int);
int t1_zeta(int, int, double);
double t1_b(int i, int j, double rij) {
  return pow(1 + pow(0.33675, 22.956) * pow(t1_zeta(i, j, rij), 22.956),
             -1 / (2 * 22.956));
}


x86 assembly (clang, -O0):
<t1_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
xor    %edi,%edi
mov    $0x16,%esi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
call   1040 <t1_zeta@plt>
mov    %eax,%edi
mov    $0x16,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
xor    %esi,%esi
call   1030 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_b>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
mov    $0x16,%esi
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
movsd  0x8(%rsp),%xmm0
call   1040 <t1_zeta@plt>
mov    %eax,%edi
mov    $0x16,%esi
call   1030 <pow@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0xe95(%rip),%xmm0
cvttsd2si %xmm0,%edi
xor    %esi,%esi
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @t1_b(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = call double @pow(i32 0, i32 22)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load double, double* %6
%11 = call i32 @t1_zeta(i32 %8, i32 %9, double %10)
%12 = call double @pow(i32 %11, i32 22)
%13 = call double @llvm.fmuladd.f64(double %7, double %12, double 1.000000e+00)
%14 = fptosi double %13 to i32
%15 = call double @pow(i32 %14, i32 0)
ret double %15
}

LLVM IR (-O2):
define double @t1_b(i32 %0, i32 %1, double %2) {
%4 = tail call double @pow(i32 0, i32 22)
%5 = tail call i32 @t1_zeta(i32 %0, i32 %1, double %2)
%6 = tail call double @pow(i32 %5, i32 22)
%7 = tail call double @llvm.fmuladd.f64(double %4, double %6, double 1.000000e+00)
%8 = fptosi double %7 to i32
%9 = tail call double @pow(i32 %8, i32 0)
ret double %9
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
__attribute__((weak, used)) pid_t _getpid(void) { return 1; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @_getpid to i8*)], section "llvm.metadata"
define weak i32 @_getpid() {
ret i32 1
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 ()* @_getpid to i8*)], section "llvm.metadata"
define weak i32 @_getpid() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *, int, int);
void rotate(char *v, int i, int j, int n) {
  reverse(v, 0, i - 1);
  reverse(v, i, n - j - 1);
  reverse(v, n - j, n - 1);
  reverse(v, 0, n - 1);
}


x86 assembly (clang, -O0):
<rotate>:
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    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r12
lea    -0x1(%r15),%edx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    %ebx,%ebp
sub    %r14d,%ebp
lea    -0x1(%rbp),%edx
mov    %r12,%rdi
mov    %r15d,%esi
call   1030 <reverse@plt>
add    $0xffffffff,%ebx
mov    %r12,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <reverse@plt>
mov    %r12,%rdi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <reverse@plt>

LLVM IR (-O0):
define void @rotate(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = call i32 @reverse(i8* %9, i32 0, i32 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = sub nsw i32 %15, %16
%18 = sub nsw i32 %17, 1
%19 = call i32 @reverse(i8* %13, i32 %14, i32 %18)
%20 = load i8*, i8** %5
%21 = load i32, i32* %8
%22 = load i32, i32* %7
%23 = sub nsw i32 %21, %22
%24 = load i32, i32* %8
%25 = sub nsw i32 %24, 1
%26 = call i32 @reverse(i8* %20, i32 %23, i32 %25)
%27 = load i8*, i8** %5
%28 = load i32, i32* %8
%29 = sub nsw i32 %28, 1
%30 = call i32 @reverse(i8* %27, i32 0, i32 %29)
ret void
}

LLVM IR (-O2):
define void @rotate(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, -1
%6 = tail call i32 @reverse(i8* %0, i32 0, i32 %5)
%7 = sub nsw i32 %3, %2
%8 = add nsw i32 %7, -1
%9 = tail call i32 @reverse(i8* %0, i32 %1, i32 %8)
%10 = add nsw i32 %3, -1
%11 = tail call i32 @reverse(i8* %0, i32 %7, i32 %10)
%12 = tail call i32 @reverse(i8* %0, i32 0, i32 %10)
ret void
}
int test_imm_ECint32_mem(int *val) {
  return ((*val) & (0xEC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ECint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 236
%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_ECint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 236
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
void bar(void) { foo((void *)0); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @foo(i8* null)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo(i8* null)
ret void
}
int sync_test_and_change_bit(long nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile("lock; btc %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit), "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<sync_test_and_change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock btc %rcx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_test_and_change_bit>:
lock btc %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sync_test_and_change_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm sideeffect "lock; btc $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_test_and_change_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "lock; btc $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int int32_t;

/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ llabs(int);
int64_t lcm(int32_t x, int32_t y) {
  if (x == 0 || y == 0) {
    return 0;
  }
  return llabs(x / gcd(x, y) * y);
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1142 <lcm+0x22>
cmpl   $0x0,-0xc(%rbp)
jne    114e <lcm+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1175 <lcm+0x55>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
imul   -0xc(%rbp),%edi
call   1030 <llabs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1139 <lcm+0x29>
mov    %esi,%ebx
test   %esi,%esi
je     1139 <lcm+0x29>
mov    %edi,%ebp
mov    %ebx,%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
imul   %ebx,%eax
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
jmp    113b <lcm+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lcm(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 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %21
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @gcd(i32 %14, i32 %15)
%17 = sdiv i32 %13, %16
%18 = load i32, i32* %5
%19 = mul nsw i32 %17, %18
%20 = call i32 @llabs(i32 %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %12, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @gcd(i32 %0, i32 %1)
%8 = sdiv i32 %0, %7
%9 = mul nsw i32 %8, %1
%10 = tail call i32 @llvm.abs.i32(i32 %9, i1 true)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}