xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bfalgo(char *, int, int, int, int, int, int, int);
void and2(int x, int y, int z) {
  bfalgo("$[-]$[$[$+$-]$-]$[-]", z, x, y, z, y, x, y);
}


x86 assembly (clang, -O0):
<and2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    -0x4(%rbp),%r10d
mov    -0x8(%rbp),%eax
lea    0xec0(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <bfalgo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and2>:
push   %rax
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee1(%rip),%rdi
mov    %r8d,%esi
mov    %ecx,%r9d
push   %rcx
push   %rdx
call   1030 <bfalgo@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"$[-]$[$[$+$-]$-]$[-]\00"
define void @and2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @bfalgo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"$[-]$[$[$+$-]$-]$[-]\00"
define void @and2(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @bfalgo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1, i32 %2, i32 %1, i32 %0, i32 %1)
ret void
}
void exit_processer() {}


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

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

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

LLVM IR (-O2):
define void @exit_processer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void aeron_idle_strategy_yielding_idle(void *state, int work_count) {
  if (work_count > 0) {
    return;
  }
  sched_yield();
}


x86 assembly (clang, -O0):
<aeron_idle_strategy_yielding_idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    112e <aeron_idle_strategy_yielding_idle+0x1e>
jmp    1135 <aeron_idle_strategy_yielding_idle+0x25>
mov    $0x0,%al
call   1030 <sched_yield@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_idle_strategy_yielding_idle>:
test   %esi,%esi
jle    1115 <aeron_idle_strategy_yielding_idle+0x5>
ret
xor    %eax,%eax
jmp    1030 <sched_yield@plt>

LLVM IR (-O0):
define void @aeron_idle_strategy_yielding_idle(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = call i32 (...) @sched_yield()
br label %10
10: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @aeron_idle_strategy_yielding_idle(i8* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @sched_yield()
br label %6
6: ; preds = %2, %4
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t ADCPhaseDelayGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000024))));
}


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

x86 assembly (clang, -O2):
<ADCPhaseDelayGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x24(%rax),%rax
ret

LLVM IR (-O0):
define i64 @ADCPhaseDelayGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 36
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @ADCPhaseDelayGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 36
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fatal(char const *, char const *);
void fatalx(const char *token, const char *emsg) {
  errno = 0;
  fatal(token, emsg);
}


x86 assembly (clang, -O0):
<fatalx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatalx>:
mov    0x2ec9(%rip),%rax
movq   $0x0,(%rax)
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@errno = global i64 0
define void @fatalx(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i64 0, i64* @errno
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @fatal(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@errno = global i64 0
define void @fatalx(i8* %0, i8* %1) {
store i64 0, i64* @errno
%3 = tail call i32 @fatal(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemCall(int);
void Diff8bitUnFilterVram(void *source, void *dest) { SystemCall(23); }


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

x86 assembly (clang, -O2):
<Diff8bitUnFilterVram>:
mov    $0x17,%edi
jmp    1030 <SystemCall@plt>

LLVM IR (-O0):
define void @Diff8bitUnFilterVram(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @SystemCall(i32 23)
ret void
}

LLVM IR (-O2):
define void @Diff8bitUnFilterVram(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @SystemCall(i32 23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pogeon_sort(int *, int, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ random_array(int *, int);
int xmain(void) {
  int a[20];
  random_array(a, 20);
  print_array(a, 20);
  pogeon_sort(a, 20, 99);
  print_array(a, 20);
  return 0;
}


x86 assembly (clang, -O0):
<xmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
mov    $0x14,%esi
call   1050 <random_array@plt>
lea    -0x50(%rbp),%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
lea    -0x50(%rbp),%rdi
mov    $0x14,%esi
mov    $0x63,%edx
call   1040 <pogeon_sort@plt>
lea    -0x50(%rbp),%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmain>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1050 <random_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
mov    $0x63,%edx
call   1040 <pogeon_sort@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xmain() {
%1 = alloca [20 x i32]
%2 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%3 = call i32 @random_array(i32* %2, i32 20)
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%5 = call i32 @print_array(i32* %4, i32 20)
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%7 = call i32 @pogeon_sort(i32* %6, i32 20, i32 99)
%8 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%9 = call i32 @print_array(i32* %8, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @xmain() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @random_array(i32* %3, i32 20)
%5 = call i32 @print_array(i32* %3, i32 20)
%6 = call i32 @pogeon_sort(i32* %3, i32 20, i32 99)
%7 = call i32 @print_array(i32* %3, i32 20)
ret i32 0
}
void rcu_cleanup_after_idle(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @rcu_cleanup_after_idle(i32 %0) {
ret void
}
int test_imm_C0uint8_mem(unsigned char *val) {
  return ((*val) & (-0xC0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C0uint8_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, -192
%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_C0uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 64
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
catch_signal(nr) int nr;
{ fatal("Arrrrgh! pmf was killed by signal %d!", nr); }


x86 assembly (clang, -O0):
<catch_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <fatal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_signal>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Arrrrgh! pmf was killed by signal %d!\00"
define i32 @catch_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [38 x i8] c"Arrrrgh! pmf was killed by signal %d!\00"
define i32 @catch_signal(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
size_t Q_strnlen(const char *s, size_t maxlen) {
  size_t i;
  for (i = 0; i < maxlen && s[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<Q_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <Q_strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <Q_strnlen+0x4c>
jmp    1162 <Q_strnlen+0x62>
jmp    1151 <Q_strnlen+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <Q_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <Q_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <Q_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <Q_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @Q_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xb0() {
  Assert_real((ispunct(176) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              885, ("ispunct should be 0 for 0xb0"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xb0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x375,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xb0>:
push   %rax
mov    $0xb0,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x375,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb0\00"
define void @t_ispunct_0xb0() {
%1 = call i64 @ispunct(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb0\00"
define void @t_ispunct_0xb0() {
%1 = tail call i64 @ispunct(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int BOTS_getRequiredTechPoints(int iLevel) {
  switch (iLevel) {
  case 0:
    return 1;
  case 1:
    return 2;
  case 2:
    return 3;
  case 3:
    return 4;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<BOTS_getRequiredTechPoints>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     115c <BOTS_getRequiredTechPoints+0x5c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1163 <BOTS_getRequiredTechPoints+0x63>
movl   $0x2,-0x4(%rbp)
jmp    1163 <BOTS_getRequiredTechPoints+0x63>
movl   $0x3,-0x4(%rbp)
jmp    1163 <BOTS_getRequiredTechPoints+0x63>
movl   $0x4,-0x4(%rbp)
jmp    1163 <BOTS_getRequiredTechPoints+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOTS_getRequiredTechPoints>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x4,%edi
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @BOTS_getRequiredTechPoints(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 1, i32* %2
br label %10
6: ; preds = %1
store i32 2, i32* %2
br label %10
7: ; preds = %1
store i32 3, i32* %2
br label %10
8: ; preds = %1
store i32 4, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @BOTS_getRequiredTechPoints(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = add i32 %0, 1
%4 = select i1 %2, i32 %3, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void system_error(const char *operation) { error(operation, strerror(errno)); }


x86 assembly (clang, -O0):
<system_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <error@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @system_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @error(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @system_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @error(i8* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i;

/* Variables and functions */
scalar_t__ alloca(int);
int /*<<< orphan*/ g(int, int /*<<< orphan*/);
f(int i) {
  int *tmp;
  tmp = (int *)alloca(sizeof(i));
  *tmp = i;
  g(*tmp, 0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %ebx,(%rax)
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <g@plt>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = call i64 @alloca(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %4
%7 = load i32, i32* %3
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = call i32 @g(i32 %10, i32 0)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 %0, i32* %3
%4 = tail call i32 @g(i32 %0, i32 0)
ret i32 undef
}
void error_state(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<error_state>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <error_state+0x9>
jmp    1109 <error_state+0x9>

x86 assembly (clang, -O2):
<error_state>:
jmp    1100 <error_state>

LLVM IR (-O0):
define void @error_state() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @error_state() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ char_array_to_uint(int, unsigned char *);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ recv_all(int, int);
uint32_t get_message_size(int connected_socket) {
  unsigned char *buff = (unsigned char *)recv_all(connected_socket, 4);
  uint32_t ret = char_array_to_uint(4, buff);
  free(buff);
  return ret;
}


x86 assembly (clang, -O0):
<get_message_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <recv_all@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x4,%edi
call   1050 <char_array_to_uint@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_message_size>:
push   %rbp
push   %rbx
push   %rax
mov    $0x4,%esi
call   1040 <recv_all@plt>
mov    %rax,%rbx
mov    $0x4,%edi
mov    %rax,%rsi
call   1050 <char_array_to_uint@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_message_size(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i64 @recv_all(i32 %5, i32 4)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @char_array_to_uint(i32 4, i8* %8)
store i32 %9, i32* %4
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_message_size(i32 %0) {
%2 = tail call i64 @recv_all(i32 %0, i32 4)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @char_array_to_uint(i32 4, i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int fexists(const char *filename) {
  struct stat buffer;
  int exist = stat(filename, &buffer);
  if (exist == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1142 <fexists+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <fexists+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fexists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fexists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cmd_reboot();
void cmdRebootSystem(int cmdType, struct cmd_arg *pCmdArg) { cmd_reboot(); }


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdRebootSystem(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @cmd_reboot()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdRebootSystem(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @cmd_reboot()
ret void
}
void g_queue_find_custom() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_find_custom() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  float hasil;
  hasil = (float)10 / 3;
  printf("Hasil = %.2f \n\n", hasil);
  system("PAUSE");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hasil = %.2f \0A\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x400AAAAAA0000000, float* %6
%7 = load float, float* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float %7)
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hasil = %.2f \0A\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 0x400AAAAAA0000000)
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int /*<<< orphan*/ error_exit(char *);
int fcntl(int, int /*<<< orphan*/, int);
void set_nonblock(int sock) {
  int flags;
  flags = fcntl(sock, F_GETFL, 0);
  if (flags == -1)
    error_exit("ERROR no valid flags on socket");
  fcntl(sock, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1157 <set_nonblock+0x37>
lea    0xeae(%rip),%rdi
call   1040 <error_exit@plt>
mov    -0x4(%rbp),%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e7b(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1148 <set_nonblock+0x28>
lea    0xebd(%rip),%rdi
call   1040 <error_exit@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
or     %ebp,%edx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@.str = [31 x i8] c"ERROR no valid flags on socket\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @error_exit(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
%13 = load i32, i32* @F_SETFL
%14 = load i32, i32* %3
%15 = load i32, i32* @O_NONBLOCK
%16 = or i32 %14, %15
%17 = call i32 @fcntl(i32 %12, i32 %13, i32 %16)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@.str = [31 x i8] c"ERROR no valid flags on socket\00"
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @error_exit(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* @O_NONBLOCK
%10 = or i32 %9, %3
%11 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %10)
ret void
}
int foo3(int a, int b) { return a != b; }


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @foo3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo3(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void SmFreeReasons(int count, char **reasonMsgs) {
  if (reasonMsgs) {
    int i;
    for (i = 0; i < count; i++)
      free(reasonMsgs[i]);
    free(reasonMsgs);
  }
}


x86 assembly (clang, -O0):
<SmFreeReasons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <SmFreeReasons+0x55>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <SmFreeReasons+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <SmFreeReasons+0x21>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SmFreeReasons(i32 %0, i8** %1) {
%3 = icmp eq i8** %1, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
%15 = bitcast i8** %1 to i8*
tail call void @free(i8* %15)
br label %16
16: ; preds = %14, %2
ret void
}
void foo_2_2_2_1_1_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_1_1_1_1() {
ret void
}
void str_term(char *s) {
  while (*s >= ' ')
    s++;
  *s = '\0';
}


x86 assembly (clang, -O0):
<str_term>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jl     1129 <str_term+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <str_term+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_term>:
cmpb   $0x1f,(%rdi)
lea    0x1(%rdi),%rdi
jg     1100 <str_term>
movb   $0x0,-0x1(%rdi)
ret

LLVM IR (-O0):
define void @str_term(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
define void @str_term(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp sgt i8 %4, 31
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
store i8 0, i8* %3
ret void
}
int test_imm_12int16_mem(short *val) {
  return ((*val) & (0x12 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_12int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 18
%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_12int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 18
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long mod(a, b)
long long a, b;
{ return a % b; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <mod+0x18>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @mod(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
ret i64 %3
}
void CameraIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  if (ulIntFlags & 0x80000000) {
    (*((volatile unsigned long *)(0x44026000 + 0x00000090))) = ((1 << 8));
  }
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<CameraIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x80000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1130 <CameraIntDisable+0x30>
mov    $0x44026090,%eax
movq   $0x100,(%rax)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraIntDisable>:
test   $0x80000000,%esi
je     1114 <CameraIntDisable+0x14>
movq   $0x100,0x44026090
not    %rsi
and    %rsi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @CameraIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 2147483648
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store volatile i64 256, i64* inttoptr (i64 1141006480 to i64*)
br label %9
9: ; preds = %8, %2
%10 = load i64, i64* %4
%11 = xor i64 %10, -1
%12 = load i64, i64* %3
%13 = add i64 %12, 28
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, %11
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @CameraIntDisable(i64 %0, i64 %1) {
%3 = and i64 %1, 2147483648
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store volatile i64 256, i64* inttoptr (i64 1141006480 to i64*)
br label %6
6: ; preds = %5, %2
%7 = xor i64 %1, -1
%8 = add i64 %0, 28
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %7
store volatile i64 %11, i64* %9
ret void
}
int test_imm_9Auint8_mem(unsigned char *val) {
  return ((*val) & (-0x9A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Auint8_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, -154
%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_9Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 102
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_separation(char *);
int /*<<< orphan*/ warnx(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    warnx("argument missing\n");
    return 1;
  }
  if (!do_separation(argv[1]))
    return 1;
  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)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <warnx@plt>
movl   $0x1,-0x4(%rbp)
jmp    1181 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <do_separation@plt>
cmp    $0x0,%eax
jne    117a <main+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <main+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    113a <main+0x1a>
mov    0x8(%rsi),%rdi
call   1040 <do_separation@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret
lea    0xebf(%rip),%rdi
call   1030 <warnx@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"argument missing\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @warnx(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @do_separation(i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %10
store i32 1, i32* %3
br label %18
17: ; preds = %10
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [18 x i8] c"argument missing\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @do_separation(i8* %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ 1, %4 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void iCopy(int n, int *s, int *d) { memcpy(d, s, n * sizeof(int)); }


x86 assembly (clang, -O0):
<iCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iCopy>:
mov    %rdx,%rax
lea    0x0(,%rdi,4),%edx
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @iCopy(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i32* %7, i32* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @iCopy(i32 %0, i32* %1, i32* %2) {
%4 = shl i32 %0, 2
%5 = tail call i32 @memcpy(i32* %2, i32* %1, i32 %4)
ret void
}
/* Variables and functions */
char *_s2_f2cstr(char *, long);
int /*<<< orphan*/ free(char *);
int s2icm(char *, int, int);
int s2icm_(char *mapname, int *idx1, int *idx2, long int textlen) {
  char *tmap = _s2_f2cstr(mapname, textlen);
  int retval = s2icm(tmap, *idx1, *idx2);
  free(tmap);
  return (retval);
}


x86 assembly (clang, -O0):
<s2icm_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <_s2_f2cstr@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1040 <s2icm@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2icm_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rcx,%rsi
call   1050 <_s2_f2cstr@plt>
mov    %rax,%rbx
mov    (%r15),%esi
mov    (%r14),%edx
mov    %rax,%rdi
call   1040 <s2icm@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @s2icm_(i8* %0, i32* %1, i32* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%11 = load i8*, i8** %5
%12 = load i64, i64* %8
%13 = call i8* @_s2_f2cstr(i8* %11, i64 %12)
store i8* %13, i8** %9
%14 = load i8*, i8** %9
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = call i32 @s2icm(i8* %14, i32 %16, i32 %18)
store i32 %19, i32* %10
%20 = load i8*, i8** %9
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %10
ret i32 %22
}

LLVM IR (-O2):
define i32 @s2icm_(i8* %0, i32* nocapture %1, i32* nocapture %2, i64 %3) {
%5 = tail call i8* @_s2_f2cstr(i8* %0, i64 %3)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = tail call i32 @s2icm(i8* %5, i32 %6, i32 %7)
%9 = tail call i32 @free(i8* %5)
ret i32 %8
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *src) {
  char *tmp = malloc(strlen(src) + 1);
  if (tmp)
    strcpy(tmp, src);
  return tmp;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void outtextxy(int i, int i1, char *string) {}


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

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

LLVM IR (-O0):
define void @outtextxy(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @outtextxy(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xvisibility_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xvisibility.send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xvisibility_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_XEvent_xvisibility_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xvisibility_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_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_xvisibility_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void i8086_nop() {}


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

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

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

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