xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void testAnalyzerEvalIsPure() {
  extern int someGlobal;
  if (someGlobal == 0) {
    clang_analyzer_eval(someGlobal == 0);
    clang_analyzer_eval(someGlobal == 0);
  }
}


x86 assembly (clang, -O0):
<testAnalyzerEvalIsPure>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
cmpl   $0x0,(%rax)
jne    1152 <testAnalyzerEvalIsPure+0x42>
mov    0x2eb5(%rip),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    0x2e9e(%rip),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAnalyzerEvalIsPure>:
push   %rbx
mov    0x2ec8(%rip),%rbx
cmpl   $0x0,(%rbx)
je     111f <testAnalyzerEvalIsPure+0xf>
pop    %rbx
ret
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmpl   $0x0,(%rbx)
sete   %dil
pop    %rbx
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@someGlobal = external global i32
define void @testAnalyzerEvalIsPure() {
%1 = load i32, i32* @someGlobal
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = load i32, i32* @someGlobal
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
%8 = load i32, i32* @someGlobal
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
br label %12
12: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@someGlobal = external global i32
define void @testAnalyzerEvalIsPure() {
%1 = load i32, i32* @someGlobal
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i32 @clang_analyzer_eval(i32 1)
%5 = load i32, i32* @someGlobal
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
br label %9
9: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void echo_str2(const char **str) { printf("echo_str2: %s\n", *str); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"echo_str2: %s\0A\00"
define void @echo_str2(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
unsigned xrop3_58_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_58_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_58_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xff,%edx
or     %ecx,%edx
xor    %eax,%edx
not    %ecx
or     %eax,%ecx
and    %edx,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_58_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_58_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = xor i32 %8, %4
%10 = xor i32 %6, -1
%11 = or i32 %4, %10
%12 = and i32 %9, %11
%13 = xor i32 %4, -1
%14 = and i32 %13, %5
%15 = or i32 %12, %14
ret i32 %15
}
int cmd_quit(struct terminal *tm, int argc, char **argv) { return 0; }


x86 assembly (clang, -O0):
<cmd_quit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.terminal = type opaque
define i32 @cmd_quit(%struct.terminal* %0, i32 %1, i8** %2) {
%4 = alloca %struct.terminal*
%5 = alloca i32
%6 = alloca i8**
store %struct.terminal* %0, %struct.terminal** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
%struct.terminal = type opaque
define i32 @cmd_quit(%struct.terminal* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_output(char *);
scalar_t__ get_do_log();
int /*<<< orphan*/ set_do_log();
void gtp_hg_log(int gtp_argc, char gtp_argv[][20]) {
  set_do_log();
  if (get_do_log()) {
    add_output("log on");
  } else {
    add_output("log off");
  }
  return;
}


x86 assembly (clang, -O0):
<gtp_hg_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <set_do_log@plt>
mov    $0x0,%al
call   1030 <get_do_log@plt>
cmp    $0x0,%rax
je     1168 <gtp_hg_log+0x38>
lea    0xea2(%rip),%rdi
call   1050 <add_output@plt>
jmp    1174 <gtp_hg_log+0x44>
lea    0xe98(%rip),%rdi
call   1050 <add_output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtp_hg_log>:
push   %rax
xor    %eax,%eax
call   1040 <set_do_log@plt>
xor    %eax,%eax
call   1030 <get_do_log@plt>
test   %rax,%rax
lea    0xebe(%rip),%rax
lea    0xeb0(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1050 <add_output@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"log on\00"
@.str.1 = [8 x i8] c"log off\00"
define void @gtp_hg_log(i32 %0, [20 x i8]* %1) {
%3 = alloca i32
%4 = alloca [20 x i8]*
store i32 %0, i32* %3
store [20 x i8]* %1, [20 x i8]** %4
%5 = call i32 (...) @set_do_log()
%6 = call i64 (...) @get_do_log()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @add_output(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @add_output(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"log on\00"
@.str.1 = [8 x i8] c"log off\00"
define void @gtp_hg_log(i32 %0, [20 x i8]* nocapture readnone %1) {
%3 = tail call i32 (...) @set_do_log()
%4 = tail call i64 (...) @get_do_log()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @add_output(i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int send(int, void *, int, int /*<<< orphan*/);
int sendTCPNumber(int socket, int j) {
  int n;
  n = send(socket, (void *)&j, sizeof(int), 0);
  if (n < sizeof(int)) {
    printf("Errore durante il comando send()\n");
    exit(1);
  } else
    return n;
}


x86 assembly (clang, -O0):
<sendTCPNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x4,%rax
jae    1178 <sendTCPNumber+0x48>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendTCPNumber>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0x3,%eax
jbe    114d <sendTCPNumber+0x1d>
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Errore durante il comando send()\0A\00"
define i32 @sendTCPNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = bitcast i32* %4 to i8*
%8 = call i32 @send(i32 %6, i8* %7, i32 4, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %10, 4
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@str = [33 x i8] c"Errore durante il comando send()\00"
define i32 @sendTCPNumber(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @send(i32 %0, i8* %4, i32 4, i32 0)
%6 = icmp ult i32 %5, 4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i32 %5
}
unsigned int premul_nozero(unsigned int val, unsigned char alpha) {
  return ((((val & 0x00FF00FF) * alpha) >> 8) & 0x00FF00FF) |
         ((((val & 0xFF00FF00) >> 8) * alpha) & 0xFF00FF00);
}


x86 assembly (clang, -O0):
<premul_nozero>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
movzbl -0x5(%rbp),%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
movzbl -0x5(%rbp),%edx
imul   %edx,%ecx
and    $0xff00ff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<premul_nozero>:
mov    %edi,%eax
and    $0xff00ff,%eax
imul   %esi,%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
shr    $0x8,%edi
and    $0xff00ff,%edi
imul   %esi,%edi
and    $0xff00ff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @premul_nozero(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 16711935
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = mul i32 %6, %8
%10 = lshr i32 %9, 8
%11 = and i32 %10, 16711935
%12 = load i32, i32* %3
%13 = and i32 %12, -16711936
%14 = lshr i32 %13, 8
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = mul i32 %14, %16
%18 = and i32 %17, -16711936
%19 = or i32 %11, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @premul_nozero(i32 %0, i8 zeroext %1) {
%3 = and i32 %0, 16711935
%4 = zext i8 %1 to i32
%5 = mul nuw i32 %3, %4
%6 = lshr i32 %5, 8
%7 = and i32 %6, 16711935
%8 = lshr i32 %0, 8
%9 = and i32 %8, 16711935
%10 = mul nuw i32 %9, %4
%11 = and i32 %10, -16711936
%12 = or i32 %7, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimir_entero(int data) { printf("%d ", data); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @imprimir_entero(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
__attribute__((always_)) void flush_cache_all(void) {}


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

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

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

LLVM IR (-O2):
define void @flush_cache_all() {
ret void
}
int nxny5() {
  int x;
  int y;
  x = 0;
  y = 1;
  x = x + y;
  return 42;
}


x86 assembly (clang, -O0):
<nxny5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @nxny5() {
ret i32 42
}
/* Variables and functions */
size_t rand();
size_t generateNumber(size_t min, size_t max) {
  return (rand() % (max - min + 1)) + min;
}


x86 assembly (clang, -O0):
<generateNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateNumber>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rand@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113e <generateNumber+0x2e>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
jmp    1144 <generateNumber+0x34>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @generateNumber(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 (...) @rand()
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub i64 %6, %7
%9 = add i64 %8, 1
%10 = urem i64 %5, %9
%11 = load i64, i64* %3
%12 = add i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @generateNumber(i64 %0, i64 %1) {
%3 = tail call i64 (...) @rand()
%4 = sub i64 1, %0
%5 = add i64 %4, %1
%6 = urem i64 %3, %5
%7 = add i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_errorln(const char *msg) {
  fputs(msg, stderr);
  fputs("\n", stderr);
}


x86 assembly (clang, -O0):
<print_errorln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_errorln>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xed8(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @print_errorln(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bgBlack(char *);
int /*<<< orphan*/ printColor(int /*<<< orphan*/);
void cmBgBlack(char *str) { printColor(bgBlack(str)); }


x86 assembly (clang, -O0):
<cmBgBlack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bgBlack@plt>
mov    %eax,%edi
call   1030 <printColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmBgBlack>:
push   %rax
call   1040 <bgBlack@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <printColor@plt>

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

LLVM IR (-O2):
define void @cmBgBlack(i8* %0) {
%2 = tail call i32 @bgBlack(i8* %0)
%3 = tail call i32 @printColor(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
void window_editor_inventions_list_open() { RCT2_CALLPROC_EBPSAFE(0x00684E04); }


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

x86 assembly (clang, -O2):
<window_editor_inventions_list_open>:
mov    $0x684e04,%edi
jmp    1030 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @window_editor_inventions_list_open() {
%1 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 6835716)
ret void
}

LLVM IR (-O2):
define void @window_editor_inventions_list_open() {
%1 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 6835716)
ret void
}
__attribute__((no, noclone)) unsigned __int128 t162_5sub(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, (unsigned __int128)(0), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t162_5sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
xor    %eax,%eax
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
test   $0x1,%al
jne    114f <t162_5sub+0x3f>
jmp    1156 <t162_5sub+0x46>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t162_5sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %11, i128 0)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t162_5sub(i64 %0, i64 %1) {
%3 = insertvalue { i64, i64 } poison, i64 %0, 0
%4 = insertvalue { i64, i64 } %3, i64 %1, 1
ret { i64, i64 } %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int_least64_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_int_least64_t(int_least64_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_int_least64_t(i32* nocapture %0) {
ret void
}
void board_fix_long_desc(int num, char *headers[50]) {
  struct obj_data *ob;
  return;
}


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

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

LLVM IR (-O0):
%struct.obj_data = type opaque
define void @board_fix_long_desc(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.obj_data*
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
%struct.obj_data = type opaque
define void @board_fix_long_desc(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int socket(int, int, int);
int aeron_socket(int domain, int type, int protocol) {
  return socket(domain, type, protocol);
}


x86 assembly (clang, -O0):
<aeron_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <socket@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_socket>:
jmp    1030 <socket@plt>

LLVM IR (-O0):
define i32 @aeron_socket(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @socket(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @aeron_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int cmp_double(const void *t1, const void *t2) {
  double a = *((double *)t1);
  double b = *((double *)t2);
  return a < b ? -1 : (a > b ? 1 : 0);
}


x86 assembly (clang, -O0):
<cmp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1147 <cmp_double+0x47>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1162 <cmp_double+0x62>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_double(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load double, double* %5
%19 = load double, double* %6
%20 = fcmp ogt double %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ -1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @cmp_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void *nubus_slot_addr(int slot) { return (void *)(0xF0000000 | (slot << 24)); }


x86 assembly (clang, -O0):
<nubus_slot_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
or     $0xf0000000,%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nubus_slot_addr>:
mov    %edi,%eax
or     $0xfffffff0,%eax
shl    $0x18,%eax
ret

LLVM IR (-O0):
define i8* @nubus_slot_addr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = or i32 -268435456, %4
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @nubus_slot_addr(i32 %0) {
%2 = shl i32 %0, 24
%3 = or i32 %2, -268435456
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
__attribute__((weak)) const char *get_log_path(void) { return "lre.log"; }


x86 assembly (clang, -O0):
<get_log_path>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_log_path>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"lre.log\00"
define weak i8* @get_log_path() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"lre.log\00"
define weak i8* @get_log_path() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int utf8_to_utf16_int(char *);
int main() {
  int d = utf8_to_utf16_int("あ");
  printf("%X\n", d);
  d = utf8_to_utf16_int("a");
  printf("%X\n", d);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <utf8_to_utf16_int@plt>
lea    0xed0(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
call   1040 <utf8_to_utf16_int@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\E3\81\82\00"
@.str.1 = [4 x i8] c"%X\0A\00"
@.str.2 = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @utf8_to_utf16_int(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @utf8_to_utf16_int(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\E3\81\82\00"
@.str.1 = [4 x i8] c"%X\0A\00"
@.str.2 = [2 x i8] c"a\00"
define i32 @main() {
%1 = tail call i32 @utf8_to_utf16_int(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @utf8_to_utf16_int(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int layer;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void WriteLayer(unsigned char layer) {
  SendChar((0XEE) & 0xFF);
  SendChar((0xA1) & 0xFF);
  SendChar((layer)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<WriteLayer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xa1,%edi
call   1030 <SendChar@plt>
movzbl -0x1(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLayer>:
push   %rbx
mov    %edi,%ebx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xa1,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @WriteLayer(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @SendChar(i32 238)
%4 = call i32 @SendChar(i32 161)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = call i32 @SendChar(i32 %7)
%9 = call i32 @SendChar(i32 255)
%10 = call i32 @SendChar(i32 252)
%11 = call i32 @SendChar(i32 255)
%12 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @WriteLayer(i8 zeroext %0) {
%2 = tail call i32 @SendChar(i32 238)
%3 = tail call i32 @SendChar(i32 161)
%4 = zext i8 %0 to i32
%5 = tail call i32 @SendChar(i32 %4)
%6 = tail call i32 @SendChar(i32 255)
%7 = tail call i32 @SendChar(i32 252)
%8 = tail call i32 @SendChar(i32 255)
%9 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
#define AF_INET 128
int /*<<< orphan*/ EAFNOSUPPORT;
int PF_INET;
int /*<<< orphan*/ errno;
int kcn_sockaddr_af2pf(int af) {
  switch (af) {
  case AF_INET:
    return PF_INET;
  default:
    errno = EAFNOSUPPORT;
    return -1;
  }
}


x86 assembly (clang, -O0):
<kcn_sockaddr_af2pf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
jne    112b <kcn_sockaddr_af2pf+0x2b>
jmp    111a <kcn_sockaddr_af2pf+0x1a>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <kcn_sockaddr_af2pf+0x44>
mov    0x2e9e(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcn_sockaddr_af2pf>:
cmp    $0x80,%edi
jne    1112 <kcn_sockaddr_af2pf+0x12>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    0x2ebe(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@PF_INET = global i32 0
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @kcn_sockaddr_af2pf(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @PF_INET
br label %7
5: ; preds = %1
%6 = load i32, i32* @EAFNOSUPPORT
store i32 %6, i32* @errno
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ -1, %5 ]
ret i32 %8
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ panic(char *, int, char *, char *);
void *Marrayalloc(long size) {
  void *p;
  if (!(p = malloc(size)))
    panic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/ceyhunc/graphviz-win/refs/heads/master/"
          "cmd/lefty/mem.c",
          176, "Marrayallocate", "cannot allocate array");
  return p;
}


x86 assembly (clang, -O0):
<Marrayalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1162 <Marrayalloc+0x42>
lea    0xeb6(%rip),%rdi
mov    $0xb0,%esi
lea    0xf3b(%rip),%rdx
lea    0xf43(%rip),%rcx
call   1030 <panic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Marrayalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114d <Marrayalloc+0x2d>
lea    0xecb(%rip),%rdi
lea    0xf55(%rip),%rdx
lea    0xf5d(%rip),%rcx
mov    $0xb0,%esi
call   1030 <panic@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ceyhunc/graphviz-win/refs/heads/master/cmd/lefty/mem.c\00"
@.str.1 = [15 x i8] c"Marrayallocate\00"
@.str.2 = [22 x i8] c"cannot allocate array\00"
define i8* @Marrayalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @panic(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 176, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ceyhunc/graphviz-win/refs/heads/master/cmd/lefty/mem.c\00"
@.str.1 = [15 x i8] c"Marrayallocate\00"
@.str.2 = [22 x i8] c"cannot allocate array\00"
define noalias i8* @Marrayalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @panic(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 176, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
float fmodf(float x, float y) {
  unsigned short fpsr;
  do
    __asm__("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y));
  while (fpsr & 0x400);
  return x;
}


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
flds   -0x10(%rbp)
flds   -0x14(%rbp)
fprem
fnstsw %ax
fstp   %st(1)
fstps  -0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
jne    110e <fmodf+0xe>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
movss  %xmm1,-0x4(%rsp)
movss  %xmm0,-0x8(%rsp)
flds   -0x4(%rsp)
flds   -0x8(%rsp)
fprem
fnstsw %ax
fstp   %st(1)
fstps  -0xc(%rsp)
movss  -0xc(%rsp),%xmm0
test   $0x400,%eax
jne    1100 <fmodf>
ret

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i16
store float %0, float* %3
store float %1, float* %4
br label %6
6: ; preds = %12, %2
%7 = load float, float* %3
%8 = load float, float* %4
%9 = call { float, i16 } asm "fprem; fnstsw %ax", "={st},={ax},{st(1)},0,~{dirflag},~{fpsr},~{flags}"(float %8, float %7)
%10 = extractvalue { float, i16 } %9, 0
%11 = extractvalue { float, i16 } %9, 1
store float %10, float* %3
store i16 %11, i16* %5
br label %12
12: ; preds = %6
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = and i32 %14, 1024
%16 = icmp ne i32 %15, 0
br i1 %16, label %6, label %17
17: ; preds = %12
%18 = load float, float* %3
ret float %18
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
br label %3
3: ; preds = %3, %2
%4 = phi float [ %0, %2 ], [ %6, %3 ]
%5 = tail call { float, i16 } asm "fprem; fnstsw %ax", "={st},={ax},{st(1)},0,~{dirflag},~{fpsr},~{flags}"(float %1, float %4)
%6 = extractvalue { float, i16 } %5, 0
%7 = extractvalue { float, i16 } %5, 1
%8 = and i16 %7, 1024
%9 = icmp eq i16 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = extractvalue { float, i16 } %5, 0
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t getinput(int fd, void *buf, size_t size) { return read(fd, buf, size); }


x86 assembly (clang, -O0):
<getinput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getinput>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @getinput(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clog_init();
void CLOG_INIT__(void) { clog_init(); }


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

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

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

LLVM IR (-O2):
define void @CLOG_INIT__() {
%1 = tail call i32 (...) @clog_init()
ret void
}
void flushbits(int n, int *byte_index, int *bit_index) {
  *byte_index += n / 8;
  *bit_index -= n % 8;
  if (*bit_index < 0) {
    *bit_index += 8;
    (*byte_index)++;
  }
}


x86 assembly (clang, -O0):
<flushbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jge    115c <flushbits+0x5c>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x8,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushbits>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
add    %ecx,(%rsi)
and    $0xfffffff8,%eax
sub    %edi,%eax
add    (%rdx),%eax
mov    %eax,(%rdx)
js     111b <flushbits+0x1b>
ret
add    $0x8,%eax
mov    %eax,(%rdx)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @flushbits(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* %4
%8 = sdiv i32 %7, 8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
store i32 %11, i32* %9
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = sub nsw i32 %15, %13
store i32 %16, i32* %14
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %3
%21 = load i32*, i32** %6
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 8
store i32 %23, i32* %21
%24 = load i32*, i32** %5
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
br label %27
27: ; preds = %20, %3
ret void
}

LLVM IR (-O2):
define void @flushbits(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = sdiv i32 %0, 8
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
store i32 %6, i32* %1
%7 = srem i32 %0, 8
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %2
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = add nsw i32 %9, 8
store i32 %12, i32* %2
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %15
15: ; preds = %11, %3
ret void
}
void entity_Free(void) {}


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

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

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

LLVM IR (-O2):
define void @entity_Free() {
ret void
}
int xmlUCSIsCJKUnifiedIdeographsExtensionB(int code) {
  return (((code >= 0x20000) && (code <= 0x2A6DF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCJKUnifiedIdeographsExtensionB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCJKUnifiedIdeographsExtensionB+0x26>
cmpl   $0x2a6df,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCJKUnifiedIdeographsExtensionB>:
add    $0xfffe0000,%edi
xor    %eax,%eax
cmp    $0xa6e0,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCJKUnifiedIdeographsExtensionB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 131072
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 173791
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsCJKUnifiedIdeographsExtensionB(i32 %0) {
%2 = add i32 %0, -131072
%3 = icmp ult i32 %2, 42720
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void g(void) { exit(0); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @g() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *s) {
  fprintf(stderr, "Usage: %s [-R] [--] [filename]\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s [-R] [--] [filename]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Usage: %s [-R] [--] [filename]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int strlen(char *);
void voltea(void) {
  extern char linea[], linea_max[];
  int tam = strlen(linea);
  int i;
  for (i = tam; i >= 0; --i) {
    printf("%c", *(linea + i));
  }
}


x86 assembly (clang, -O0):
<voltea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1170 <voltea+0x50>
movslq -0x8(%rbp),%rcx
lea    0xeae(%rip),%rdi
mov    0x2e97(%rip),%rax
movsbl (%rax,%rcx,1),%esi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <voltea+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltea>:
push   %r15
push   %r14
push   %rbx
mov    0x2ec4(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
js     1163 <voltea+0x43>
mov    %eax,%ebx
lea    0xebf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1150 <voltea+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@.str = [3 x i8] c"%c\00"
define void @voltea() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @strlen(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
store i32 %4, i32* %2
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i64 %10
%12 = load i8, i8* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@.str = [3 x i8] c"%c\00"
define void @voltea() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0))
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %12
3: ; preds = %0
%4 = zext i32 %1 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %10, %5 ]
%7 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = add nsw i64 %6, -1
%11 = icmp eq i64 %6, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %0
ret void
}