xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__6__IO__makeInput();
void Msp430GpioC__13__HplGeneralIO__makeInput(void) {
  HplMsp430GeneralIOP__6__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__13__HplGeneralIO__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__6__IO__makeInput()
ret void
}
void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key,
                                   struct sta_info *sta) {}


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

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

LLVM IR (-O0):
%struct.ieee80211_key = type opaque
%struct.sta_info = type opaque
define void @ieee80211_debugfs_key_sta_del(%struct.ieee80211_key* %0, %struct.sta_info* %1) {
%3 = alloca %struct.ieee80211_key*
%4 = alloca %struct.sta_info*
store %struct.ieee80211_key* %0, %struct.ieee80211_key** %3
store %struct.sta_info* %1, %struct.sta_info** %4
ret void
}

LLVM IR (-O2):
%struct.ieee80211_key = type opaque
%struct.sta_info = type opaque
define void @ieee80211_debugfs_key_sta_del(%struct.ieee80211_key* nocapture %0, %struct.sta_info* nocapture %1) {
ret void
}
void lookupKeyReadOrReply(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               87, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<lookupKeyReadOrReply>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x57,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookupKeyReadOrReply>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x57,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.lookupKeyReadOrReply = [21 x i8] c"lookupKeyReadOrReply\00"
define void @lookupKeyReadOrReply() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 87, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.lookupKeyReadOrReply, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.lookupKeyReadOrReply = [21 x i8] c"lookupKeyReadOrReply\00"
define void @lookupKeyReadOrReply() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 87, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.lookupKeyReadOrReply, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteCommand(int);
int /*<<< orphan*/ delay_ms(int);
void LCD_init(void) {
  delay_ms(100);
  LCD_WriteCommand(0x38);
  LCD_WriteCommand(0x06);
  LCD_WriteCommand(0x0f);
  LCD_WriteCommand(0x01);
  delay_ms(10);
}


x86 assembly (clang, -O0):
<LCD_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1040 <delay_ms@plt>
mov    $0x38,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0xf,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0x1,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0xa,%edi
call   1040 <delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_init>:
push   %rax
mov    $0x64,%edi
call   1040 <delay_ms@plt>
mov    $0x38,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0x6,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0xf,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0x1,%edi
call   1030 <LCD_WriteCommand@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <delay_ms@plt>

LLVM IR (-O0):
define void @LCD_init() {
%1 = call i32 @delay_ms(i32 100)
%2 = call i32 @LCD_WriteCommand(i32 56)
%3 = call i32 @LCD_WriteCommand(i32 6)
%4 = call i32 @LCD_WriteCommand(i32 15)
%5 = call i32 @LCD_WriteCommand(i32 1)
%6 = call i32 @delay_ms(i32 10)
ret void
}

LLVM IR (-O2):
define void @LCD_init() {
%1 = tail call i32 @delay_ms(i32 100)
%2 = tail call i32 @LCD_WriteCommand(i32 56)
%3 = tail call i32 @LCD_WriteCommand(i32 6)
%4 = tail call i32 @LCD_WriteCommand(i32 15)
%5 = tail call i32 @LCD_WriteCommand(i32 1)
%6 = tail call i32 @delay_ms(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open_window(char *);
void hsplit_window(void) { open_window("h50%"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"h50%\00"
define void @hsplit_window() {
%1 = call i32 @open_window(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"h50%\00"
define void @hsplit_window() {
%1 = tail call i32 @open_window(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int child2() {
  int a = 0;
  int ii;
  for (ii = 0; ii < 4; ++ii)
    a += ii;
  return a;
}


x86 assembly (clang, -O0):
<child2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1133 <child2+0x33>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <child2+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @child2() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @child2() {
ret i32 6
}
void av_iformat_next() {}


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

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

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

LLVM IR (-O2):
define void @av_iformat_next() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  bool isFamele = false;
  printf("%s\n", isFamele ? "true" : "false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xed9(%rip),%rsi
lea    0xecd(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xebb(%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
lea    0xee5(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"false\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
unsigned min(unsigned const a, unsigned const b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void _membarrier(void) {
  __asm volatile("" : : : "memory");
  __sync_synchronize();
}


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

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

LLVM IR (-O0):
define void @_membarrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @_membarrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
fence seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M40_f(char *s) {
  debug("M40_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M40_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M40_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M40_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M40_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M40_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M40_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x98() {
  Assert_real((isbdigit(152) == 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_isbdigit.c",
              765, ("isbdigit should be 0 for 0x98"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x98>:
push   %rax
mov    $0x98,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2fd,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x98\00"
define void @t_isbdigit_0x98() {
%1 = call i64 @isbdigit(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x98\00"
define void @t_isbdigit_0x98() {
%1 = tail call i64 @isbdigit(i32 152)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 765, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int isdigit(int ch) { return (unsigned)ch - '0' < 10; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 48
%5 = icmp ult i32 %4, 10
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int nextload(int load) {
  switch (load) {
  case 3:
    return 1;
  case 1:
    return 2;
  case 2:
    return 4;
  case 4:
    return 3;
  }
  return 3;
}


x86 assembly (clang, -O0):
<nextload>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1160 <nextload+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1167 <nextload+0x67>
movl   $0x2,-0x4(%rbp)
jmp    1167 <nextload+0x67>
movl   $0x4,-0x4(%rbp)
jmp    1167 <nextload+0x67>
movl   $0x3,-0x4(%rbp)
jmp    1167 <nextload+0x67>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextload>:
add    $0xffffffff,%edi
mov    $0x3,%eax
cmp    $0x3,%edi
ja     111a <nextload+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.nextload = [4 x i32] [i32 2, i32 4, i32 1, i32 3]
define i32 @nextload(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.nextload, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 3, %1 ]
ret i32 %9
}
/* Variables and functions */
int two_sensor_read(char *, int *, int *);
int check_bumpers(int *lbump, int *rbump) {
  return two_sensor_read("BFLR", lbump, rbump);
}


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

x86 assembly (clang, -O2):
<check_bumpers>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <two_sensor_read@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"BFLR\00"
define i32 @check_bumpers(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 = call i32 @two_sensor_read(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"BFLR\00"
define i32 @check_bumpers(i32* %0, i32* %1) {
%3 = tail call i32 @two_sensor_read(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1)
ret i32 %3
}
float circumf(int a) { return 2 * a * 3.14159; }


x86 assembly (clang, -O0):
<circumf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xee7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<circumf>:
add    %edi,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @circumf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 3.141590e+00
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @circumf(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 3.141590e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void colorMag() { printf("%s", "\x1B[35m"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[35m\00"
define void @colorMag() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[35m\00"
define void @colorMag() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void glClipPlanex(void) { return; }


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

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

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

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

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


x86 assembly (clang, -O0):
<fopen_utf8>:
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 <fopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_utf8>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i32* @fopen_utf8(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* @fopen(i8* %5, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @fopen_utf8(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ lhsx();
int /*<<< orphan*/ x_backsubstitute();
int /*<<< orphan*/ x_solve_cell();
void x_solve(void) {
  lhsx();
  x_solve_cell();
  x_backsubstitute();
}


x86 assembly (clang, -O0):
<x_solve>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <lhsx@plt>
mov    $0x0,%al
call   1040 <x_solve_cell@plt>
mov    $0x0,%al
call   1030 <x_backsubstitute@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_solve>:
push   %rax
xor    %eax,%eax
call   1050 <lhsx@plt>
xor    %eax,%eax
call   1040 <x_solve_cell@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <x_backsubstitute@plt>

LLVM IR (-O0):
define void @x_solve() {
%1 = call i32 (...) @lhsx()
%2 = call i32 (...) @x_solve_cell()
%3 = call i32 (...) @x_backsubstitute()
ret void
}

LLVM IR (-O2):
define void @x_solve() {
%1 = tail call i32 (...) @lhsx()
%2 = tail call i32 (...) @x_solve_cell()
%3 = tail call i32 (...) @x_backsubstitute()
ret void
}
int ti_tr_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_tr_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char tolower(char);
char *picolToLower(char *str) {
  char *cp;
  for (cp = str; *cp; cp++)
    *cp = tolower(*cp);
  return str;
}


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

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

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

LLVM IR (-O2):
define i8* @picolToLower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ at_init();
int /*<<< orphan*/ ide_init();
int /*<<< orphan*/ neat_init();
void at_neat_init() {
  at_init();
  ide_init();
  neat_init();
}


x86 assembly (clang, -O0):
<at_neat_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <at_init@plt>
mov    $0x0,%al
call   1050 <ide_init@plt>
mov    $0x0,%al
call   1030 <neat_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_neat_init>:
push   %rax
xor    %eax,%eax
call   1040 <at_init@plt>
xor    %eax,%eax
call   1050 <ide_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <neat_init@plt>

LLVM IR (-O0):
define void @at_neat_init() {
%1 = call i32 (...) @at_init()
%2 = call i32 (...) @ide_init()
%3 = call i32 (...) @neat_init()
ret void
}

LLVM IR (-O2):
define void @at_neat_init() {
%1 = tail call i32 (...) @at_init()
%2 = tail call i32 (...) @ide_init()
%3 = tail call i32 (...) @neat_init()
ret void
}
int *f2() { return 0; }


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

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

LLVM IR (-O0):
define i32* @f2() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @f2() {
ret i32* null
}
void FreeMatrixf(float **matptr) {
  free(matptr[0]);
  free(matptr);
}


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

x86 assembly (clang, -O2):
<FreeMatrixf>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeMatrixf(float** %0) {
%2 = alloca float**
store float** %0, float*** %2
%3 = load float**, float*** %2
%4 = getelementptr inbounds float*, float** %3, i64 0
%5 = load float*, float** %4
%6 = bitcast float* %5 to i8*
%7 = load float**, float*** %2
%8 = bitcast float** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @FreeMatrixf(float** nocapture %0) {
%2 = bitcast float** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast float** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int open(char *, int);
int posix_openpt(int oflag) {
  int fdm;
  fdm = open("/dev/ptmx", oflag);
  return fdm;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ptmx\00"
define i32 @posix_openpt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ptmx\00"
define i32 @posix_openpt(i32 %0) {
%2 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Variables and functions */
double pow(double, double);
double __wrap_pow(double x, double y) { return pow(x, y); }


x86 assembly (clang, -O0):
<__wrap_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @__wrap_pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__wrap_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int const);
int /*<<< orphan*/ stderr;
int stateMessage(const char *fileName, const int lineNumber, const char *msg,
                 const int code) {
  fprintf(stderr, "%s in file %s on line %d\n", msg, fileName, lineNumber);
  return code;
}


x86 assembly (clang, -O0):
<stateMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stateMessage>:
push   %rbx
mov    %ecx,%ebx
mov    %esi,%r8d
mov    %rdi,%rcx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"%s in file %s on line %d\0A\00"
define i32 @stateMessage(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
%14 = load i32, i32* %8
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"%s in file %s on line %d\0A\00"
define i32 @stateMessage(i8* %0, i32 %1, i8* %2, i32 returned %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void IntDest(void *a) { free((int *)a); }


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

x86 assembly (clang, -O2):
<IntDest>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @IntDest(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @free(i32* %4)
ret void
}

LLVM IR (-O2):
define void @IntDest(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Type definitions */
struct TNCDATA {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PUTCHARINBUFFER(struct TNCDATA *, char);
void SENDREPLY(struct TNCDATA *TNC, char *Msg, int Len) {
  int n = 0;
  for (n = 0; n < Len; n++) {
    PUTCHARINBUFFER(TNC, Msg[n]);
  }
}


x86 assembly (clang, -O0):
<SENDREPLY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <SENDREPLY+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <PUTCHARINBUFFER@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <SENDREPLY+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SENDREPLY>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <SENDREPLY+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <PUTCHARINBUFFER@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <SENDREPLY+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.TNCDATA = type { i32 }
define void @SENDREPLY(%struct.TNCDATA* %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @PUTCHARINBUFFER(%struct.TNCDATA* %0, i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void setColorScheme(int bg, int fg) { printf("\e[38;5;%d;48;5;%dm", fg, bg); }


x86 assembly (clang, -O0):
<setColorScheme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setColorScheme>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[38;5;%d;48;5;%dm\00"
define void @setColorScheme(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 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[38;5;%d;48;5;%dm\00"
define void @setColorScheme(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void const *, int);
void *pcu_memdup(const void *buf, int len) {
  void *tmp;
  tmp = malloc(len);
  memcpy(tmp, buf, len);
  return tmp;
}


x86 assembly (clang, -O0):
<pcu_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcu_memdup>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @pcu_memdup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @pcu_memdup(i8* %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
ret i8* %3
}
int test_imm_FEint32_mem(int *val) {
  return ((*val) & (0xFE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FEint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 254
%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_FEint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 254
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ llib_str_chr(char *, int);
unsigned char *zchr(void *s, int c) {
  return (unsigned char *)llib_str_chr((char *)s, c);
}


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

x86 assembly (clang, -O2):
<zchr>:
jmp    1030 <llib_str_chr@plt>

LLVM IR (-O0):
define i8* @zchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @llib_str_chr(i8* %5, i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @zchr(i8* %0, i32 %1) {
%3 = tail call i64 @llib_str_chr(i8* %0, i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/);
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void read_rest_of_line(void) {
  int ch;
  while (ch = getc(stdin), ch != '\n' && ch != EOF)
    ;
  clearerr(stdin);
}


x86 assembly (clang, -O0):
<read_rest_of_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115a <read_rest_of_line+0x3a>
mov    -0x4(%rbp),%eax
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    116a <read_rest_of_line+0x4a>
jmp    116f <read_rest_of_line+0x4f>
jmp    1128 <read_rest_of_line+0x8>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1030 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_rest_of_line>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    0x2eae(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
call   1040 <getc@plt>
cmp    $0xa,%eax
je     1151 <read_rest_of_line+0x31>
cmp    (%rbx),%eax
jne    1140 <read_rest_of_line+0x20>
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clearerr@plt>

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define void @read_rest_of_line() {
%1 = alloca i32
br label %2
2: ; preds = %13, %0
%3 = load i32, i32* @stdin
%4 = call i32 @getc(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %1
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br label %11
11: ; preds = %7, %2
%12 = phi i1 [ false, %2 ], [ %10, %7 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %2
14: ; preds = %11
%15 = load i32, i32* @stdin
%16 = call i32 @clearerr(i32 %15)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define void @read_rest_of_line() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @getc(i32 %2)
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = load i32, i32* @stdin
%10 = tail call i32 @clearerr(i32 %9)
ret void
}
/* Variables and functions */
int kstrlen(char *);
int kindexof(char *s, char c) {
  int i = 0;
  while (++i < kstrlen(s))
    if (*s++ == c)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<kindexof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <kstrlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    1179 <kindexof+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1174 <kindexof+0x64>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <kindexof+0x70>
jmp    1129 <kindexof+0x19>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kindexof>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
xor    %ebx,%ebx
lea    (%r15,%rbx,1),%rbp
lea    0x1(%rbx),%r12d
mov    %rbp,%rdi
call   1030 <kstrlen@plt>
cmp    %eax,%r12d
jge    1141 <kindexof+0x31>
add    $0x1,%rbx
cmp    %r14b,0x0(%rbp)
jne    1120 <kindexof+0x10>
jmp    1146 <kindexof+0x36>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @kindexof(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %10, %9 ]
%5 = phi i32 [ 0, %2 ], [ %6, %9 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i32 @kstrlen(i8* %4)
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = load i8, i8* %4
%12 = icmp eq i8 %11, %1
br i1 %12, label %13, label %3
13: ; preds = %3, %9
%14 = phi i32 [ %6, %9 ], [ -1, %3 ]
ret i32 %14
}
void bwarn(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @bwarn(i8* nocapture %0, ...) {
ret void
}
OP(ed, e2) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *argv0) {
  printf("Usage: %s [--red=0/1] [--green=0/1] [--verbose] [--help]\n\n", argv0);
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Usage: %s [--red=0/1] [--green=0/1] [--verbose] [--help]\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [59 x i8] c"Usage: %s [--red=0/1] [--green=0/1] [--verbose] [--help]\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ Z_FreeTags(int);
void Game_Shutdown(void) {
  Com_Printf("==== Game Shutdown ====\n");
  Z_FreeTags(766);
  Z_FreeTags(765);
}


x86 assembly (clang, -O0):
<Game_Shutdown>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <Com_Printf@plt>
mov    $0x2fe,%edi
call   1040 <Z_FreeTags@plt>
mov    $0x2fd,%edi
call   1040 <Z_FreeTags@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Game_Shutdown>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <Com_Printf@plt>
mov    $0x2fe,%edi
call   1040 <Z_FreeTags@plt>
mov    $0x2fd,%edi
pop    %rax
jmp    1040 <Z_FreeTags@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"==== Game Shutdown ====\0A\00"
define void @Game_Shutdown() {
%1 = call i32 @Com_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Z_FreeTags(i32 766)
%3 = call i32 @Z_FreeTags(i32 765)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"==== Game Shutdown ====\0A\00"
define void @Game_Shutdown() {
%1 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Z_FreeTags(i32 766)
%3 = tail call i32 @Z_FreeTags(i32 765)
ret void
}
long *cmpfunc(const void *a, const void *b) {
  return (*(long *)a - *(long *)b);
}


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

x86 assembly (clang, -O2):
<cmpfunc>:
mov    (%rdi),%rax
sub    (%rsi),%rax
ret

LLVM IR (-O0):
define i64* @cmpfunc(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = inttoptr i64 %11 to i64*
ret i64* %12
}

LLVM IR (-O2):
define i64* @cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = inttoptr i64 %7 to i64*
ret i64* %8
}
void I010ToAB30() {}


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

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

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

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