xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t _write(int fd __attribute__((unused)),
               const char *buf __attribute__((unused)),
               size_t nbyte __attribute__((unused))) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_write(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
scalar_t__ asc_int(char *);
int stol(char *val) {
  if (val[0] == 'F')
    return (0);
  if (val[0] == 'T')
    return (1);
  return ((asc_int(val) != 0));
}


x86 assembly (clang, -O0):
<stol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x46,%eax
jne    1138 <stol+0x28>
movl   $0x0,-0x4(%rbp)
jmp    116c <stol+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x54,%eax
jne    1154 <stol+0x44>
movl   $0x1,-0x4(%rbp)
jmp    116c <stol+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <asc_int@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stol>:
push   %rax
mov    (%rdi),%al
cmp    $0x46,%al
je     1122 <stol+0x12>
cmp    $0x54,%al
jne    1126 <stol+0x16>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
call   1030 <asc_int@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stol(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %4 [
i8 70, label %8
i8 84, label %3
]
3: ; preds = %1
br label %8
4: ; preds = %1
%5 = tail call i64 @asc_int(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4, %3
%9 = phi i32 [ 1, %3 ], [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ writeLine(short, short, short, short, short);
void drawFastHLine(short x, short y, short w, short color) {
  writeLine(x, y, x + w - 1, y, color);
}


x86 assembly (clang, -O0):
<drawFastHLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
movswl -0x2(%rbp),%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    %ax,%cx
mov    -0x4(%rbp),%ax
movswl %si,%edi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
movswl -0x8(%rbp),%r8d
call   1030 <writeLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawFastHLine>:
mov    %ecx,%r8d
lea    (%rdi,%rdx,1),%eax
add    $0xffffffff,%eax
movswl %ax,%edx
mov    %esi,%ecx
jmp    1030 <writeLine@plt>

LLVM IR (-O0):
define void @drawFastHLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %5
%12 = sext i16 %11 to i32
%13 = load i16, i16* %7
%14 = sext i16 %13 to i32
%15 = add nsw i32 %12, %14
%16 = sub nsw i32 %15, 1
%17 = trunc i32 %16 to i16
%18 = load i16, i16* %6
%19 = load i16, i16* %8
%20 = call i32 @writeLine(i16 signext %9, i16 signext %10, i16 signext %17, i16 signext %18, i16 signext %19)
ret void
}

LLVM IR (-O2):
define void @drawFastHLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = add i16 %0, -1
%6 = add i16 %5, %2
%7 = tail call i32 @writeLine(i16 signext %0, i16 signext %1, i16 signext %6, i16 signext %1, i16 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ frsprite(int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basFrSprite() {
  int n;
  n = popNumber();
  pushNumber(frsprite(n));
}


x86 assembly (clang, -O0):
<basFrSprite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <frsprite@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basFrSprite>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <frsprite@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basFrSprite() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @frsprite(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basFrSprite() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @frsprite(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ compare_file();
scalar_t__ do_copy_force(char *, char *);
scalar_t__ write_src_file(unsigned int);
void test_n_byte_cp_force(unsigned int n) {
  assert(write_src_file(n) == 0);
  assert(do_copy_force("/tmp/test-cp-src", "/tmp/test-cp-dst") == 0);
  compare_file();
}


x86 assembly (clang, -O0):
<test_n_byte_cp_force>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <write_src_file@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe95(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1060 <do_copy_force@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <compare_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_n_byte_cp_force>:
push   %rax
call   1030 <write_src_file@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xea5(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1060 <do_copy_force@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <compare_file@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/tmp/test-cp-src\00"
@.str.1 = [17 x i8] c"/tmp/test-cp-dst\00"
define void @test_n_byte_cp_force(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @write_src_file(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i64 @do_copy_force(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 (...) @compare_file()
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/tmp/test-cp-src\00"
@.str.1 = [17 x i8] c"/tmp/test-cp-dst\00"
define void @test_n_byte_cp_force(i32 %0) {
%2 = tail call i64 @write_src_file(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 @do_copy_force(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 (...) @compare_file()
ret void
}
void av_murmur3_init() {}


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

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

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

LLVM IR (-O2):
define void @av_murmur3_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/
Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__txInterruptHandler();
__attribute((signal)) void __vector_38(void) {
  Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__txInterruptHandler();
}


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

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

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

LLVM IR (-O2):
define void @__vector_38() {
%1 = tail call i32 (...) @Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__txInterruptHandler()
ret void
}
char *skip_space(char *ptr) {
  for (; *ptr; ptr++)
    if (*ptr != ' ' && *ptr != '\t')
      break;
  return ptr;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <skip_space+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     113a <skip_space+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     113a <skip_space+0x3a>
jmp    1150 <skip_space+0x50>
jmp    113f <skip_space+0x3f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_space+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
mov    %rdi,%rax
jmp    1114 <skip_space+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_space+0x10>
cmp    $0x9,%cl
je     1110 <skip_space+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
unsigned int hashatom(const void *member) { return (unsigned long)member >> 2; }


x86 assembly (clang, -O0):
<hashatom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashatom>:
mov    %rdi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i32 @hashatom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = lshr i64 %4, 2
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hashatom(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  char word[200];
  printf("%ld\n", hash(word));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
mov    %rsp,%rdi
call   1030 <hash@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc8,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @hash(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void log_syslog_debug(char *msg) { syslog(LOG_DEBUG, "%s", msg); }


x86 assembly (clang, -O0):
<log_syslog_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_syslog_debug>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_DEBUG = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_syslog_debug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_DEBUG
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_DEBUG = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_syslog_debug(i8* %0) {
%2 = load i32, i32* @LOG_DEBUG
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
short add_short(register short u, register short v) { return u + v; }


x86 assembly (clang, -O0):
<add_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_short>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define signext i16 @add_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = add nsw i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @add_short(i16 signext %0, i16 signext %1) {
%3 = add i16 %1, %0
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main() {
  while (1) {
    kill(5114, SIGINT);
    sleep(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0x13fa,%edi
call   1030 <kill@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    $0x13fa,%edi
call   1030 <kill@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@SIGINT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* @SIGINT
%4 = call i32 @kill(i32 5114, i32 %3)
%5 = call i32 @sleep(i32 2)
br label %2
}

LLVM IR (-O2):
@SIGINT = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @kill(i32 5114, i32 %2)
%4 = tail call i32 @sleep(i32 2)
br label %1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(scalar_t__);
void UARTRxErrorClear(uint32_t ui32Base) {
  ASSERT(_UARTBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) = 0;
}


x86 assembly (clang, -O0):
<UARTRxErrorClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRxErrorClear>:
push   %rbx
mov    %rdi,%rbx
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movq   $0x0,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @UARTRxErrorClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_UARTBaseValid(i64 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add nsw i64 %6, 4
%8 = inttoptr i64 %7 to i64*
store volatile i64 0, i64* %8
ret void
}

LLVM IR (-O2):
define void @UARTRxErrorClear(i64 %0) {
%2 = tail call i32 @_UARTBaseValid(i64 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i64 %0, 4
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_DrawFlagModel(float, int, int, int, int);
void CG_DrawStatusBarFlag(float x, int team) {
  CG_DrawFlagModel(x, 480 - 40, 40, 40, team);
}


x86 assembly (clang, -O0):
<CG_DrawStatusBarFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%ecx
mov    $0x1b8,%edi
mov    $0x28,%edx
mov    %edx,%esi
call   1030 <CG_DrawFlagModel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_DrawStatusBarFlag>:
mov    %edi,%ecx
mov    $0x1b8,%edi
mov    $0x28,%esi
mov    $0x28,%edx
jmp    1030 <CG_DrawFlagModel@plt>

LLVM IR (-O0):
define void @CG_DrawStatusBarFlag(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call i32 @CG_DrawFlagModel(float %5, i32 440, i32 40, i32 40, i32 %6)
ret void
}

LLVM IR (-O2):
define void @CG_DrawStatusBarFlag(float %0, i32 %1) {
%3 = tail call i32 @CG_DrawFlagModel(float %0, i32 440, i32 40, i32 40, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spi_write_byte(int);
void nrf_flush_rx() {
  ;
  spi_write_byte((0xE2));
  ;
}


x86 assembly (clang, -O0):
<nrf_flush_rx>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe2,%edi
call   1030 <spi_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_flush_rx>:
mov    $0xe2,%edi
jmp    1030 <spi_write_byte@plt>

LLVM IR (-O0):
define void @nrf_flush_rx() {
%1 = call i32 @spi_write_byte(i32 226)
ret void
}

LLVM IR (-O2):
define void @nrf_flush_rx() {
%1 = tail call i32 @spi_write_byte(i32 226)
ret void
}
int test() { return 3; }


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

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

LLVM IR (-O0):
define i32 @test() {
ret i32 3
}

LLVM IR (-O2):
define i32 @test() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ m37_reset();
int /*<<< orphan*/ mmc3init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void m37_init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
              uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  mmc3init(prgROMin, prgROMsizeIn, prgRAMin, prgRAMsizeIn, chrROMin,
           chrROMsizeIn);
  m37_reset();
  printf("Mapper 37 (Mapper 4 Game Select) inited\n");
}


x86 assembly (clang, -O0):
<m37_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <mmc3init@plt>
mov    $0x0,%al
call   1050 <m37_reset@plt>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m37_init>:
push   %rax
call   1030 <mmc3init@plt>
xor    %eax,%eax
call   1050 <m37_reset@plt>
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Mapper 37 (Mapper 4 Game Select) inited\0A\00"
define void @m37_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i32 @mmc3init(i32* %13, i32 %14, i32* %15, i32 %16, i32* %17, i32 %18)
%20 = call i32 (...) @m37_reset()
%21 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Mapper 37 (Mapper 4 Game Select) inited\00"
define void @m37_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = tail call i32 @mmc3init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5)
%8 = tail call i32 (...) @m37_reset()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
int trans_1_x(int x, int y) { return y; }


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

x86 assembly (clang, -O2):
<trans_1_x>:
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @trans_1_x(i32 %0, i32 returned %1) {
ret i32 %1
}
void rop3_158_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = *D & S;
  stk3 = T | stk4;
  stk2 = S ^ stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

LLVM IR (-O0):
define void @rop3_158_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = and i32 %13, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %10
%18 = load i8, i8* %6
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %8
%34 = zext i8 %33 to i32
%35 = xor i32 %32, %34
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8, i8* %6
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %5
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = load i8*, i8** %4
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = load i8, i8* %6
%58 = zext i8 %57 to i32
%59 = and i32 %56, %58
%60 = or i32 %53, %59
%61 = trunc i32 %60 to i8
%62 = load i8*, i8** %4
store i8 %61, i8* %62
ret void
}

LLVM IR (-O2):
define void @rop3_158_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void bitmapSet(char *bitmap, int idx) {
  int bit_mask[8] = {128, 64, 32, 16, 8, 4, 2, 1};
  bitmap[idx / 8] = bitmap[idx / 8] | bit_mask[idx % 8];
}


x86 assembly (clang, -O0):
<bitmapSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x40(%rbp),%eax
movslq %edx,%rcx
or     -0x30(%rbp,%rcx,4),%eax
mov    %al,-0x39(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x39(%rbp),%dl
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmapSet>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
and    $0xfffffff8,%eax
sub    %eax,%esi
movslq %esi,%rax
lea    0xee1(%rip),%rdx
mov    (%rdx,%rax,4),%al
or     %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
@__const.bitmapSet.bit_mask = [8 x i32] [i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1]
define void @bitmapSet(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [8 x i32]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [8 x i32]* %5 to i8*
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %4
%15 = srem i32 %14, 8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = or i32 %13, %18
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = sdiv i32 %22, 8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
store i8 %20, i8* %25
ret void
}

LLVM IR (-O2):
@__const.bitmapSet.bit_mask = [8 x i32] [i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1]
define void @bitmapSet(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = srem i32 %1, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [8 x i32], [8 x i32]* @__const.bitmapSet.bit_mask, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i32 %10 to i8
%12 = or i8 %6, %11
store i8 %12, i8* %5
ret void
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 116737752064UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1156 <RandomFunc+0x56>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1129 <RandomFunc+0x29>
movabs $0x1b2e1cbc00,%rcx
and    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
and    $0x36042968,%eax
shl    $0x7,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = and i64 %9, 914778474
%11 = shl i64 %10, 7
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = and i64 %21, %19
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 1
store i64 %24, i64* %6
br label %13
25: ; preds = %13
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = and i64 %27, 116737752064
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 7
%5 = and i64 %4, 115999028224
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_queens(int **);
int /*<<< orphan*/ print_board(int **);
int main() {
  int mat[8][8] = {{0}};
  fill_queens(mat);
  print_board(mat);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x100(%rbp),%rdi
call   1050 <fill_queens@plt>
lea    -0x100(%rbp),%rdi
call   1030 <print_board@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <fill_queens@plt>
mov    %rbx,%rdi
call   1030 <print_board@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = bitcast [8 x [8 x i32]]* %1 to i8*
%3 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 0
%4 = bitcast [8 x i32]* %3 to i32**
%5 = call i32 @fill_queens(i32** %4)
%6 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 0
%7 = bitcast [8 x i32]* %6 to i32**
%8 = call i32 @print_board(i32** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = bitcast [8 x [8 x i32]]* %1 to i8*
%3 = bitcast [8 x [8 x i32]]* %1 to i32**
%4 = call i32 @fill_queens(i32** %3)
%5 = call i32 @print_board(i32** %3)
ret i32 0
}
int test_imm_0Duint16_mem(unsigned short *val) {
  return ((*val) & (0x0D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Duint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 13
%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_0Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 13
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_B6uint8_mem(unsigned char *val) {
  return ((*val) & (0xB6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B6uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 182
%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_B6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -74
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo();
scalar_t__ jump();
int main(void) {
  int var;
  if (jump())
    goto mid;
  foo();
  switch (var) {
  case 1:
    foo();
  mid:
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <jump@plt>
cmp    $0x0,%rax
je     1145 <main+0x25>
jmp    1164 <main+0x44>
xor    %eax,%eax
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    1169 <main+0x49>
jmp    115d <main+0x3d>
mov    $0x0,%al
call   1030 <foo@plt>
jmp    116e <main+0x4e>
jmp    116e <main+0x4e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <jump@plt>
test   %rax,%rax
jne    1134 <main+0x14>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @jump()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %11
6: ; preds = %0
%7 = call i32 (...) @foo()
%8 = load i32, i32* %2
switch i32 %8, label %12 [
i32 1, label %9
]
9: ; preds = %6
%10 = call i32 (...) @foo()
br label %11
11: ; preds = %9, %5
br label %13
12: ; preds = %6
br label %13
13: ; preds = %12, %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @jump()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @foo()
br label %5
5: ; preds = %3, %0
ret i32 0
}
void av_hwdevice_iterate_types() {}


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

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

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

LLVM IR (-O2):
define void @av_hwdevice_iterate_types() {
ret void
}
void wifi_evt_tcpip_endpoint_status(
    const struct wifi_msg_tcpip_endpoint_status_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_tcpip_endpoint_status_evt_t = type opaque
define void @wifi_evt_tcpip_endpoint_status(%struct.wifi_msg_tcpip_endpoint_status_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int zfinder_main(int, char **);
int main(int argc, char **argv) { return zfinder_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <zfinder_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <zfinder_main@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @zfinder_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @zfinder_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yyparse();
int main() {
  printf("Type expression like 5*3\n");
  yyparse();
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"Type expression like 5*3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @yyparse()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void parameter_error(void) {
  printf("Error in parameters, switch unknown\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Error in parameters, switch unknown\0A\00"
define void @parameter_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Error in parameters, switch unknown\00"
define void @parameter_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putcharfunc(unsigned char);
void myputchar(unsigned char c) {
  if (c == '\n')
    putcharfunc('\r');
  putcharfunc(c);
}


x86 assembly (clang, -O0):
<myputchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <myputchar+0x25>
mov    $0xd,%edi
call   1030 <putcharfunc@plt>
movzbl -0x1(%rbp),%edi
call   1030 <putcharfunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myputchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <myputchar+0x12>
mov    $0xd,%edi
call   1030 <putcharfunc@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putcharfunc@plt>

LLVM IR (-O0):
define void @myputchar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @putcharfunc(i8 zeroext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @putcharfunc(i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @myputchar(i8 zeroext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putcharfunc(i8 zeroext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @putcharfunc(i8 zeroext %0)
ret void
}
/* Variables and functions */
unsigned int processorClockFrequency();
unsigned int peripheralClockFrequency(void) {
  unsigned int divider = 0;
  switch ((*((volatile unsigned char *)0xE01FC100)) & 3) {
  case 0:
    divider = 4;
    break;
  case 1:
    divider = 1;
    break;
  case 2:
    divider = 2;
    break;
  }
  return processorClockFrequency() / divider;
}


x86 assembly (clang, -O0):
<peripheralClockFrequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xe01fc100,%eax
movzbl (%rax),%eax
and    $0x3,%eax
mov    %eax,-0x8(%rbp)
je     115a <peripheralClockFrequency+0x4a>
jmp    1138 <peripheralClockFrequency+0x28>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1166 <peripheralClockFrequency+0x56>
jmp    1149 <peripheralClockFrequency+0x39>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1172 <peripheralClockFrequency+0x62>
jmp    1179 <peripheralClockFrequency+0x69>
movl   $0x4,-0x4(%rbp)
jmp    1179 <peripheralClockFrequency+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1179 <peripheralClockFrequency+0x69>
movl   $0x2,-0x4(%rbp)
mov    $0x0,%al
call   1030 <processorClockFrequency@plt>
xor    %edx,%edx
divl   -0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peripheralClockFrequency>:
push   %rbx
mov    $0xe01fc100,%eax
movzbl (%rax),%eax
and    $0x3,%eax
xor    %ebx,%ebx
cmp    $0x3,%al
je     112c <peripheralClockFrequency+0x1c>
lea    0xed7(%rip),%rcx
mov    (%rcx,%rax,4),%ebx
xor    %eax,%eax
call   1030 <processorClockFrequency@plt>
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @peripheralClockFrequency() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load volatile i8, i8* inttoptr (i64 3760177408 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %0
store i32 4, i32* %1
br label %8
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 2, i32* %1
br label %8
8: ; preds = %0, %7, %6, %5
%9 = call i32 (...) @processorClockFrequency()
%10 = load i32, i32* %1
%11 = udiv i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
@switch.table.peripheralClockFrequency = [3 x i32] [i32 4, i32 1, i32 2]
define i32 @peripheralClockFrequency() {
%1 = load volatile i8, i8* inttoptr (i64 3760177408 to i8*)
%2 = and i8 %1, 3
%3 = icmp eq i8 %2, 3
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = zext i8 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.peripheralClockFrequency, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %0
%9 = phi i32 [ 0, %0 ], [ %7, %4 ]
%10 = tail call i32 (...) @processorClockFrequency()
%11 = udiv i32 %10, %9
ret i32 %11
}
unsigned int alarm(unsigned int seconds) { return seconds; }


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

x86 assembly (clang, -O2):
<alarm>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @alarm(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ msx_readval(char *, int *);
int msx_read(char *fn) {
  int val;
  return (msx_readval(fn, &val) ? val : -1);
}


x86 assembly (clang, -O0):
<msx_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <msx_readval@plt>
cmp    $0x0,%rax
je     113e <msx_read+0x2e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114b <msx_read+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <msx_read+0x3b>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msx_read>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <msx_readval@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @msx_read(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @msx_readval(i8* %4, i32* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ -1, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @msx_read(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @msx_readval(i8* %0, i32* %2)
%5 = icmp eq i64 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
void reverse(char *src, char *dst) {
  while (src < dst) {
    char tmp;
    tmp = *src;
    *src = *dst;
    *dst = tmp;
    src++;
    dst--;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1155 <reverse+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <reverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %rsi,%rdi
jae    112c <reverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl (%rdi),%eax
movzbl 0x1(%rsi),%ecx
mov    %cl,(%rdi)
mov    %al,0x1(%rsi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
store i8 %8, i8* %5
store i8 %7, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = getelementptr inbounds i8, i8* %6, i64 -1
%11 = icmp ult i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}