xunge/DecIR huggingface dataset:
int test_imm_A0uint16_reg(unsigned short val) {
  return ((val) & (0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xa0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A0uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 160
%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_A0uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 160
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ tun_alloc(char *);
int main() {
  char str[] = "tun%d";
  tun_alloc(str);
  int i;
  scanf("%d", &i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <tun_alloc@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x64,0x10(%rsp)
movl   $0x256e7574,0xc(%rsp)
25
lea    0xc(%rsp),%rdi
call   1030 <tun_alloc@plt>
lea    0xebf(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [6 x i8] c"tun%d\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = call i32 @tun_alloc(i8* %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"tun%d\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = call i32 @tun_alloc(i8* %3)
%5 = bitcast i32* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void quit(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @quit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int _runner_test_func_1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @_runner_test_func_1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @_runner_test_func_1() {
ret i32 1
}
void SIO1writeBaud16(unsigned short val) {}


x86 assembly (clang, -O0):
<SIO1writeBaud16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SIO1writeBaud16(i16 zeroext %0) {
ret void
}
void skipSpace(char **token) {
  char c;
  while ((c = **token) == ' ' || c == '\t')
    ++*token;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1132 <skipSpace+0x32>
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1142 <skipSpace+0x42>
jmp    1155 <skipSpace+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skipSpace+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @skipSpace(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char num;
  num = 'b';
  printf("%d", num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 98)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_backtrace(int);
int main() { test_backtrace(8); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <test_backtrace@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1030 <test_backtrace@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test_backtrace(i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_backtrace(i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void first(void) { printf("First function...\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"First function...\00"
define void @first() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void put_string(char *string) { printf("%s", string); }


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

x86 assembly (clang, -O2):
<put_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @put_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
int /*<<< orphan*/ m200SetPrgROMBank(int);
int /*<<< orphan*/ ppuSetNameTblHorizontal();
int /*<<< orphan*/ ppuSetNameTblVertical();
void m200_setParams(uint16_t addr, uint8_t val) {
  (void)val;
  m200SetPrgROMBank((addr & 7) << 14);
  chr8setBank0((addr & 7) << 13);
  if ((addr & 8) != 0)
    ppuSetNameTblHorizontal();
  else
    ppuSetNameTblVertical();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0xe,%edi
call   1030 <m200SetPrgROMBank@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0xd,%edi
call   1040 <chr8setBank0@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1185 <m200_setParams+0x45>
mov    $0x0,%al
call   1050 <ppuSetNameTblHorizontal@plt>
jmp    118c <m200_setParams+0x4c>
mov    $0x0,%al
call   1060 <ppuSetNameTblVertical@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%ebp
and    $0x7,%ebp
mov    %ebp,%edi
shl    $0xe,%edi
call   1030 <m200SetPrgROMBank@plt>
shl    $0xd,%ebp
mov    %ebp,%edi
call   1040 <chr8setBank0@plt>
xor    %eax,%eax
add    $0x8,%rsp
test   $0x8,%bl
jne    1170 <m200_setParams+0x30>
pop    %rbx
pop    %rbp
jmp    1060 <ppuSetNameTblVertical@plt>
pop    %rbx
pop    %rbp
jmp    1050 <ppuSetNameTblHorizontal@plt>

LLVM IR (-O0):
define void @m200_setParams(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
%6 = load i32, i32* %3
%7 = and i32 %6, 7
%8 = shl i32 %7, 14
%9 = call i32 @m200SetPrgROMBank(i32 %8)
%10 = load i32, i32* %3
%11 = and i32 %10, 7
%12 = shl i32 %11, 13
%13 = call i32 @chr8setBank0(i32 %12)
%14 = load i32, i32* %3
%15 = and i32 %14, 8
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @ppuSetNameTblHorizontal()
br label %21
19: ; preds = %2
%20 = call i32 (...) @ppuSetNameTblVertical()
br label %21
21: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
define void @m200_setParams(i32 %0, i32 %1) {
%3 = and i32 %0, 7
%4 = shl nuw nsw i32 %3, 14
%5 = tail call i32 @m200SetPrgROMBank(i32 %4)
%6 = shl nuw nsw i32 %3, 13
%7 = tail call i32 @chr8setBank0(i32 %6)
%8 = and i32 %0, 8
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 (...) @ppuSetNameTblHorizontal()
br label %14
12: ; preds = %2
%13 = tail call i32 (...) @ppuSetNameTblVertical()
br label %14
14: ; preds = %12, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("llamaOS apps: hello-c\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"llamaOS apps: hello-c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t RGBA(const int r, const int g, const int b, const int a) {
  return ((uint32_t)(a << 24 | r << 16 | g << 8 | b));
}


x86 assembly (clang, -O0):
<RGBA>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RGBA>:
mov    %ecx,%eax
shl    $0x18,%eax
shl    $0x10,%edi
shl    $0x8,%esi
or     %edi,%esi
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @RGBA(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = shl i32 %9, 24
%11 = load i32, i32* %5
%12 = shl i32 %11, 16
%13 = or i32 %10, %12
%14 = load i32, i32* %6
%15 = shl i32 %14, 8
%16 = or i32 %13, %15
%17 = load i32, i32* %7
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @RGBA(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %3, 24
%6 = shl i32 %0, 16
%7 = shl i32 %1, 8
%8 = or i32 %7, %6
%9 = or i32 %8, %2
%10 = or i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tp_init(void) {
  fprintf(stderr, "tp_init called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<tp_init>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"tp_init called\0A\00"
define i32 @tp_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"tp_init called\0A\00"
define i32 @tp_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *hack_realloc(void *ptr, size_t size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<hack_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @hack_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
void function_empty_real_date_ini() {}


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

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

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

LLVM IR (-O2):
define void @function_empty_real_date_ini() {
ret void
}
int normal() { return 42; }


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

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

LLVM IR (-O0):
define i32 @normal() {
ret i32 42
}

LLVM IR (-O2):
define i32 @normal() {
ret i32 42
}
/* Variables and functions */
int ustrnicmp(char const *, char const *, int);
int ustrcasecmp(const char *pcStr1, const char *pcStr2) {
  return (ustrnicmp(pcStr1, pcStr2, -1));
}


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

x86 assembly (clang, -O2):
<ustrcasecmp>:
mov    $0xffffffff,%edx
jmp    1030 <ustrnicmp@plt>

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

LLVM IR (-O2):
define i32 @ustrcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @ustrnicmp(i8* %0, i8* %1, i32 -1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ bar();
int /*<<< orphan*/ foobar();
void foo(int s) {
  unsigned loc = 0;
  if (s) {
    if (bar()) {
      foobar();
    }
  } else {
    loc = 1;
    if (bar()) {
      loc = 2;
    }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1159 <foo+0x39>
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x0,%rax
je     1154 <foo+0x34>
mov    $0x0,%al
call   1040 <foobar@plt>
jmp    117d <foo+0x5d>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
cmp    $0x0,%rax
je     1178 <foo+0x58>
movl   $0x2,-0x8(%rbp)
jmp    117d <foo+0x5d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <bar@plt>
test   %ebx,%ebx
je     113b <foo+0x1b>
test   %rax,%rax
je     113b <foo+0x1b>
xor    %eax,%eax
pop    %rbx
jmp    1040 <foobar@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = call i64 (...) @bar()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @foobar()
br label %11
11: ; preds = %9, %6
br label %17
12: ; preds = %1
store i32 1, i32* %3
%13 = call i64 (...) @bar()
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 2, i32* %3
br label %16
16: ; preds = %15, %12
br label %17
17: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = tail call i64 (...) @bar()
%4 = icmp eq i64 %3, 0
%5 = select i1 %2, i1 true, i1 %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @foobar()
br label %8
8: ; preds = %1, %6
ret void
}
/* Variables and functions */
scalar_t__ __undef();
scalar_t__ __undef2();
int /*<<< orphan*/ assert(int);
int main() {
  int x = 0;
  while (__undef()) {
    x = 1;
    while (__undef2()) {
      x = x + 3;
      if (x == 4) {
        break;
      }
    }
  }
  assert(x >= 0 && x <= 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__undef@plt>
cmp    $0x0,%rax
je     1191 <main+0x61>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__undef2@plt>
cmp    $0x0,%rax
je     118c <main+0x5c>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    1187 <main+0x57>
jmp    118c <main+0x5c>
jmp    115e <main+0x2e>
jmp    1146 <main+0x16>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     11aa <main+0x7a>
cmpl   $0x4,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <__undef@plt>
test   %rax,%rax
je     1155 <main+0x25>
xor    %eax,%eax
call   1030 <__undef2@plt>
jmp    1140 <main+0x10>
mov    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %17, %0
%4 = call i64 (...) @__undef()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %3
store i32 1, i32* %2
br label %7
7: ; preds = %16, %6
%8 = call i64 (...) @__undef2()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 3
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 4
br i1 %14, label %15, label %16
15: ; preds = %10
br label %17
16: ; preds = %10
br label %7
17: ; preds = %15, %7
br label %3
18: ; preds = %3
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %2
%23 = icmp sle i32 %22, 4
br label %24
24: ; preds = %21, %18
%25 = phi i1 [ false, %18 ], [ %23, %21 ]
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @__undef()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @__undef2()
%5 = tail call i64 (...) @__undef()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
%8 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_CRIT;
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int run(int argc, char *argv[]) {
  while (1) {
    syslog(LOG_CRIT, "sub <%s> running!", argv[0]);
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeba(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112f <run+0xf>

x86 assembly (clang, -O2):
<run>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x2eb9(%rip),%r15
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    (%rbx),%rdx
mov    %r14,%rsi
call   1030 <syslog@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1140 <run+0x20>

LLVM IR (-O0):
@LOG_CRIT = global i32 0
@.str = [18 x i8] c"sub <%s> running!\00"
define i32 @run(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %2, %5
%6 = load i32, i32* @LOG_CRIT
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @sleep(i32 1)
br label %5
}

LLVM IR (-O2):
@LOG_CRIT = global i32 0
@.str = [18 x i8] c"sub <%s> running!\00"
define i32 @run(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = load i32, i32* @LOG_CRIT
%5 = load i8*, i8** %1
%6 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @sleep(i32 1)
br label %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xreparent_type(void *_p, int _v) {
  ((XEvent *)_p)->xreparent.type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xreparent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xreparent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xreparent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xreparent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void mem_text_address_restore(void) {}


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

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

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

LLVM IR (-O2):
define void @mem_text_address_restore() {
ret void
}
void dd_pbl_ios_gc_achievements_show() {}


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

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

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

LLVM IR (-O2):
define void @dd_pbl_ios_gc_achievements_show() {
ret void
}
/* Variables and functions */
int stdc_E1E83C65(char const *, char const *, size_t);
int strncmp(const char *str1, const char *str2, size_t num) {
  return stdc_E1E83C65(str1, str2, num);
}


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

x86 assembly (clang, -O2):
<strncmp>:
jmp    1030 <stdc_E1E83C65@plt>

LLVM IR (-O0):
define i32 @strncmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @stdc_E1E83C65(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @strncmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @stdc_E1E83C65(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
double exp(double);
double pdfExponential(double m, double x) { return ((1.0 / m) * exp(-x / m)); }


x86 assembly (clang, -O0):
<pdfExponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdfExponential>:
push   %rax
movsd  0xee7(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
xorpd  0xee6(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pdfExponential(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fdiv double 1.000000e+00, %5
%7 = load double, double* %4
%8 = fneg double %7
%9 = load double, double* %3
%10 = fdiv double %8, %9
%11 = call double @exp(double %10)
%12 = fmul double %6, %11
ret double %12
}

LLVM IR (-O2):
define double @pdfExponential(double %0, double %1) {
%3 = fdiv double 1.000000e+00, %0
%4 = fneg double %1
%5 = fdiv double %4, %0
%6 = tail call double @exp(double %5)
%7 = fmul double %3, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ sayHelloTo(char *);
int main(int argc, char *argv[]) {
  sayHelloTo("world");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sayHelloTo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned HASH16(unsigned char *T) {
  return (unsigned short)(((*T) << 8) | *(T + 1));
}


x86 assembly (clang, -O0):
<HASH16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HASH16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @HASH16(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 = shl i32 %5, 8
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
%13 = zext i16 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @HASH16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
int dummy_fct(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @dummy_fct(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ irq_disable();
int /*<<< orphan*/ irq_enable();
int /*<<< orphan*/ poke32(int, int /*<<< orphan*/);
void rpi_uart_disable(void) {
  irq_disable();
  poke32((0x20201000 + 0x30), 0);
  irq_enable();
}


x86 assembly (clang, -O0):
<rpi_uart_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <irq_disable@plt>
mov    $0x20201030,%edi
xor    %esi,%esi
call   1050 <poke32@plt>
mov    $0x0,%al
call   1030 <irq_enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi_uart_disable>:
push   %rax
xor    %eax,%eax
call   1040 <irq_disable@plt>
mov    $0x20201030,%edi
xor    %esi,%esi
call   1050 <poke32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <irq_enable@plt>

LLVM IR (-O0):
define void @rpi_uart_disable() {
%1 = call i32 (...) @irq_disable()
%2 = call i32 @poke32(i32 538972208, i32 0)
%3 = call i32 (...) @irq_enable()
ret void
}

LLVM IR (-O2):
define void @rpi_uart_disable() {
%1 = tail call i32 (...) @irq_disable()
%2 = tail call i32 @poke32(i32 538972208, i32 0)
%3 = tail call i32 (...) @irq_enable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M_PI;
int pow(int, int /*<<< orphan*/);
int sqrt(int);
float calculateValue(int value) {
  float result = pow(value, M_PI) / (1 + (value * sqrt(value)));
  return result;
}


x86 assembly (clang, -O0):
<calculateValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <pow@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sqrt@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateValue>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1030 <pow@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
add    $0x1,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @calculateValue(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @M_PI
%6 = call i32 @pow(i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @sqrt(i32 %8)
%10 = mul nsw i32 %7, %9
%11 = add nsw i32 1, %10
%12 = sdiv i32 %6, %11
%13 = sitofp i32 %12 to float
store float %13, float* %3
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @calculateValue(i32 %0) {
%2 = load i32, i32* @M_PI
%3 = tail call i32 @pow(i32 %0, i32 %2)
%4 = tail call i32 @sqrt(i32 %0)
%5 = mul nsw i32 %4, %0
%6 = add nsw i32 %5, 1
%7 = sdiv i32 %3, %6
%8 = sitofp i32 %7 to float
ret float %8
}
/* Variables and functions */
float cos(float);
float sin(float);
void glmGenerateRotationMatrix2fRad(float m[4], float angle) {
  m[0] = cos(angle);
  m[2] = -sin(angle);
  m[1] = sin(angle);
  m[3] = cos(angle);
}


x86 assembly (clang, -O0):
<glmGenerateRotationMatrix2fRad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateRotationMatrix2fRad>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
call   1040 <cos@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
xorps  0xeb7(%rip),%xmm0
movss  %xmm0,0x8(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,0x4(%rbx)
movss  0xc(%rsp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,0xc(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @glmGenerateRotationMatrix2fRad(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @cos(float %5)
%7 = load float*, float** %3
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float, float* %4
%10 = call float @sin(float %9)
%11 = fneg float %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 2
store float %11, float* %13
%14 = load float, float* %4
%15 = call float @sin(float %14)
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 1
store float %15, float* %17
%18 = load float, float* %4
%19 = call float @cos(float %18)
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 3
store float %19, float* %21
ret void
}

LLVM IR (-O2):
define void @glmGenerateRotationMatrix2fRad(float* nocapture writeonly %0, float %1) {
%3 = tail call float @cos(float %1)
store float %3, float* %0
%4 = tail call float @sin(float %1)
%5 = fneg float %4
%6 = getelementptr inbounds float, float* %0, i64 2
store float %5, float* %6
%7 = tail call float @sin(float %1)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = tail call float @cos(float %1)
%10 = getelementptr inbounds float, float* %0, i64 3
store float %9, float* %10
ret void
}
int int_cmp(void *a, void *b) {
  if (!a || !b)
    return 0;
  return *(int *)a - *(int *)b;
}


x86 assembly (clang, -O0):
<int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <int_cmp+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112e <int_cmp+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    113d <int_cmp+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_cmp>:
xor    %eax,%eax
test   %rdi,%rdi
je     1110 <int_cmp+0x10>
test   %rsi,%rsi
je     1110 <int_cmp+0x10>
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @int_cmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = bitcast i8* %1 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %8, %10
br label %12
12: ; preds = %2, %6
%13 = phi i32 [ %11, %6 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ enterNumbers();
int /*<<< orphan*/ showNumbers();
int /*<<< orphan*/ sortArray();
int main() {
  enterNumbers();
  sortArray();
  showNumbers();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <enterNumbers@plt>
mov    $0x0,%al
call   1030 <sortArray@plt>
mov    $0x0,%al
call   1050 <showNumbers@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @enterNumbers()
%3 = call i32 (...) @sortArray()
%4 = call i32 (...) @showNumbers()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @enterNumbers()
%2 = tail call i32 (...) @sortArray()
%3 = tail call i32 (...) @showNumbers()
ret i32 0
}
int to_signed_int(unsigned int value) {
  int signed_value = value;
  if (value >> 15)
    signed_value |= -1 << 15;
  return signed_value;
}


x86 assembly (clang, -O0):
<to_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xf,%eax
cmp    $0x0,%eax
je     1127 <to_signed_int+0x27>
mov    -0x8(%rbp),%eax
or     $0xffff8000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_signed_int>:
mov    %edi,%eax
or     $0xffff8000,%eax
cmp    $0x8000,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @to_signed_int(i32 %0) {
%2 = icmp ult i32 %0, 32768
%3 = or i32 %0, -32768
%4 = select i1 %2, i32 %0, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ test_spr();
int main() {
  if (test_spr())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_spr@plt>
cmp    $0x0,%rax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_spr@plt>
test   %rax,%rax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_spr()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test_spr()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
scalar_t__ getmem(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *stringclone(char *s) {
  if (s) {
    char *p = (char *)getmem(strlen(s) + 1);
    strcpy(p, s);
    return p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<stringclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <stringclone+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <getmem@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <stringclone+0x52>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringclone>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <stringclone+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <getmem@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <stringclone+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @stringclone(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @getmem(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ func();
char *malloc(int);
void main() {
  func();
  char *test = malloc(20);
  __ESBMC_assume(test);
  free(test);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <func@plt>
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__ESBMC_assume@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <func@plt>
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__ESBMC_assume@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
%2 = call i32 (...) @func()
%3 = call i8* @malloc(i32 20)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @__ESBMC_assume(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @func()
%2 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%3 = tail call i32 @__ESBMC_assume(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
int xcommon_toggle_root(int fullscreen_width, int fullscreen_height) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @xcommon_toggle_root(i32 %0, i32 %1) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
void set_XGravityEvent_send_event(void *_p, int _v) {
  ((XGravityEvent *)_p)->send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGravityEvent_send_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XGravityEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGravityEvent_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGravityEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ O_NONBLOCK;
int timerfd_create(int /*<<< orphan*/, int /*<<< orphan*/);
int reactor_make_timer(void) {
  return timerfd_create(CLOCK_MONOTONIC, O_NONBLOCK);
}


x86 assembly (clang, -O0):
<reactor_make_timer>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
call   1030 <timerfd_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reactor_make_timer>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <timerfd_create@plt>

LLVM IR (-O0):
@CLOCK_MONOTONIC = global i32 0
@O_NONBLOCK = global i32 0
define i32 @reactor_make_timer() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = load i32, i32* @O_NONBLOCK
%3 = call i32 @timerfd_create(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
@CLOCK_MONOTONIC = global i32 0
@O_NONBLOCK = global i32 0
define i32 @reactor_make_timer() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = load i32, i32* @O_NONBLOCK
%3 = tail call i32 @timerfd_create(i32 %1, i32 %2)
ret i32 %3
}