xunge/DecIR huggingface dataset:
const char *string_ignore_whitespace(const char *string) {
  while (*string != 0 && (unsigned char)*string <= 32)
    string++;
  return string;
}


x86 assembly (clang, -O0):
<string_ignore_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <string_ignore_whitespace+0x2d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <string_ignore_whitespace+0x3d>
jmp    114e <string_ignore_whitespace+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <string_ignore_whitespace+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_ignore_whitespace>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xff,%cl
cmp    $0x20,%cl
jb     1110 <string_ignore_whitespace+0x10>
ret

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

LLVM IR (-O2):
define i8* @string_ignore_whitespace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -1
%6 = icmp ult i8 %5, 32
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i8* %3
}
int test_imm_B7uint16_mem(unsigned short *val) {
  return ((*val) & (-0xB7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B7uint16_mem>:
movzwl (%rdi),%eax
test   $0xff49,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B7uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -183
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -183
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void arm_pld_reg() {}


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

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

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

LLVM IR (-O2):
define void @arm_pld_reg() {
ret void
}
int suspend_nvs_alloc(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @suspend_nvs_alloc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @suspend_nvs_alloc() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_power_of_2(uint32_t i) { return i && !((i - 1) & i); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112a <is_power_of_2+0x2a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %edi,%edi
je     110f <is_power_of_2+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = load i32, i32* %2
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_power_of_2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int _bitcount(int value) {
  if (value == 0)
    return 0;
  if (value == 1)
    return 1;
  if (value == 2)
    return 2;
  return _bitcount(value >> 1) + 1;
}


x86 assembly (clang, -O0):
<_bitcount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <_bitcount+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116e <_bitcount+0x5e>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <_bitcount+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116e <_bitcount+0x5e>
cmpl   $0x2,-0x8(%rbp)
jne    115d <_bitcount+0x4d>
movl   $0x2,-0x4(%rbp)
jmp    116e <_bitcount+0x5e>
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <_bitcount@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bitcount>:
mov    %edi,%eax
xor    %ecx,%ecx
cmp    $0x3,%eax
jb     111a <_bitcount+0x1a>
nopl   0x0(%rax)
sar    %eax
add    $0x1,%ecx
cmp    $0x3,%eax
jae    1110 <_bitcount+0x10>
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_bitcount(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %8, %6 ]
%4 = phi i32 [ %0, %1 ], [ %7, %6 ]
%5 = icmp ult i32 %4, 3
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = ashr i32 %4, 1
%8 = add nuw nsw i32 %3, 1
br label %2
9: ; preds = %2
%10 = add nuw nsw i32 %4, %3
ret i32 %10
}
void gdk_window_begin_paint_rect() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_begin_paint_rect() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int UINT16_MAX;
uint16_t rotl16(uint16_t x, int n) {
  return ((x << n) | (x >> (16 - n))) & UINT16_MAX;
}


x86 assembly (clang, -O0):
<rotl16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    0x2eb6(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl16>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
sar    %cl,%edi
or     %edi,%eax
mov    0x2ec9(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@UINT16_MAX = global i32 0
define i32 @rotl16(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 16, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
%13 = load i32, i32* @UINT16_MAX
%14 = and i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@UINT16_MAX = global i32 0
define i32 @rotl16(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 16, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
%7 = load i32, i32* @UINT16_MAX
%8 = and i32 %7, %6
ret i32 %8
}
int WITH_symlink() { return 0; }


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

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

LLVM IR (-O0):
define i32 @WITH_symlink() {
ret i32 0
}

LLVM IR (-O2):
define i32 @WITH_symlink() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *out = malloc(1);
  *out = 'a';
  printf("good! %c\n", *out);
  free(out);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%rax
lea    0xea8(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movb   $0x61,(%rax)
lea    0xeb8(%rip),%rdi
mov    $0x61,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"good! %c\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
store i8 97, i8* %3
%4 = load i8*, i8** %1
%5 = load i8, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"good! %c\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
store i8 97, i8* %1
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext 97)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ Offset();
int Bof() { return (Offset() <= 0); }


x86 assembly (clang, -O0):
<Bof>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Offset@plt>
cmp    $0x0,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bof>:
push   %rax
xor    %eax,%eax
call   1030 <Offset@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Bof() {
%1 = call i64 (...) @Offset()
%2 = icmp sle i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @Bof() {
%1 = tail call i64 (...) @Offset()
%2 = icmp slt i64 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ STRNCPY(char **, char *, int);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(char *);
void main() {
  char s1[] = "qwertyui";
  char s2[] = "werty";
  printid(s1);
  printid(s2);
  STRNCPY(&s1, "dfgh", 3);
  print(s1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xeb7(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xeb1(%rip),%ax
mov    %ax,-0xb(%rbp)
lea    -0x9(%rbp),%rdi
call   1050 <printid@plt>
lea    -0xf(%rbp),%rdi
call   1050 <printid@plt>
lea    -0x9(%rbp),%rdi
lea    0xe92(%rip),%rsi
mov    $0x3,%edx
call   1030 <STRNCPY@plt>
lea    -0x9(%rbp),%rdi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x6975797472657771,%rax
79 75 69
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
movw   $0x79,0xc(%rsp)
movl   $0x74726577,0x8(%rsp)
74
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <printid@plt>
lea    0x8(%rsp),%rdi
call   1050 <printid@plt>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <STRNCPY@plt>
mov    %rbx,%rdi
call   1040 <print@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [9 x i8] c"qwertyui\00"
@__const.main.s2 = [6 x i8] c"werty\00"
@.str = [5 x i8] c"dfgh\00"
define void @main() {
%1 = alloca [9 x i8]
%2 = alloca [6 x i8]
%3 = bitcast [9 x i8]* %1 to i8*
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%6 = call i32 @printid(i8* %5)
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%8 = call i32 @printid(i8* %7)
%9 = bitcast [9 x i8]* %1 to i8**
%10 = call i32 @STRNCPY(i8** %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%12 = call i32 @print(i8* %11)
ret void
}

LLVM IR (-O2):
@__const.main.s1 = [9 x i8] c"qwertyui\00"
@__const.main.s2 = [6 x i8] c"werty\00"
@.str = [5 x i8] c"dfgh\00"
define void @main() {
%1 = alloca [9 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @printid(i8* %3)
%6 = call i32 @printid(i8* %4)
%7 = bitcast [9 x i8]* %1 to i8**
%8 = call i32 @STRNCPY(i8** %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%9 = call i32 @print(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *binary) {
  fprintf(stderr, "Usage: %s [filename.bmp] [number_of_threads]\n", binary);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [filename.bmp] [number_of_threads]\0A\00"
define void @print_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 ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s [filename.bmp] [number_of_threads]\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int abs(int);
scalar_t__ log10(int);
int get_intlen(int n) {
  return (n == 0) ? 1 : (int)(log10((n < 0) ? abs(n) * 10 : n) + 1);
}


x86 assembly (clang, -O0):
<get_intlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1142 <get_intlen+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <get_intlen+0x54>
cmpl   $0x0,-0x4(%rbp)
jge    115f <get_intlen+0x3f>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
imul   $0xa,%eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <get_intlen+0x45>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <log10@plt>
add    $0x1,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_intlen>:
test   %edi,%edi
je     1131 <get_intlen+0x21>
push   %rax
lea    (%rdi,%rdi,1),%eax
lea    (%rax,%rax,4),%eax
neg    %eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edi
call   1030 <log10@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_intlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %20
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32 @abs(i32 %10)
%12 = mul nsw i32 %11, 10
br label %15
13: ; preds = %6
%14 = load i32, i32* %2
br label %15
15: ; preds = %13, %9
%16 = phi i32 [ %12, %9 ], [ %14, %13 ]
%17 = call i64 @log10(i32 %16)
%18 = add nsw i64 %17, 1
%19 = trunc i64 %18 to i32
br label %20
20: ; preds = %15, %5
%21 = phi i32 [ 1, %5 ], [ %19, %15 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_intlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 0
%5 = mul i32 %0, -10
%6 = select i1 %4, i32 %5, i32 %0
%7 = tail call i64 @log10(i32 %6)
%8 = trunc i64 %7 to i32
%9 = add i32 %8, 1
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ 1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ recurse();
int main() {
  recurse();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @recurse()
ret i32 0
}
/* Variables and functions */
char *dlerror();
int /*<<< orphan*/ i8086warningEx(char *, int, char *);
int i8086CheckDllError() {
  char *error = dlerror();
  if (error != NULL) {
    i8086warningEx("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/garvitdelhi/emulate/refs/"
                   "heads/master/extras/i8086emu-src-0.9.2/src/i8086devices.c",
                   185, error);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<i8086CheckDllError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115f <i8086CheckDllError+0x3f>
mov    -0x10(%rbp),%rdx
lea    0xeb7(%rip),%rdi
mov    $0xb9,%esi
call   1040 <i8086warningEx@plt>
movl   $0x0,-0x4(%rbp)
jmp    1166 <i8086CheckDllError+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8086CheckDllError>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <dlerror@plt>
test   %rax,%rax
je     1145 <i8086CheckDllError+0x25>
lea    0xeca(%rip),%rdi
mov    $0xb9,%esi
mov    %rax,%rdx
call   1040 <i8086warningEx@plt>
jmp    114a <i8086CheckDllError+0x2a>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/garvitdelhi/emulate/refs/heads/master/extras/i8086emu-src-0.9.2/src/i8086devices.c\00"
define i32 @i8086CheckDllError() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (...) @dlerror()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @i8086warningEx(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 185, i8* %7)
store i32 0, i32* %1
br label %10
9: ; preds = %0
store i32 1, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/garvitdelhi/emulate/refs/heads/master/extras/i8086emu-src-0.9.2/src/i8086devices.c\00"
define i32 @i8086CheckDllError() {
%1 = tail call i8* (...) @dlerror()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @i8086warningEx(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 185, i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x89() {
  Assert_real((isalnum(137) == 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_isalnum.c",
              690, ("isalnum should be 0 for 0x89"));
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @testC() {
ret void
}
/* Variables and functions */
int LZ4_compress_limitedOutput(char const *, char *, int, int);
int LZ4_compress(const char *source, char *dest, int isize) {
  return LZ4_compress_limitedOutput(source, dest, isize,
                                    (isize + (isize / 255) + 16));
}


x86 assembly (clang, -O0):
<LZ4_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x14(%rbp),%eax
mov    $0xff,%r8d
cltd
idiv   %r8d
mov    -0x18(%rbp),%edx
add    %eax,%ecx
add    $0x10,%ecx
call   1030 <LZ4_compress_limitedOutput@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress>:
movslq %edx,%rdx
imul   $0xffffffff80808081,%rdx,%rax
shr    $0x20,%rax
add    %edx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x7,%eax
add    %ecx,%eax
lea    (%rdx,%rax,1),%ecx
add    $0x10,%ecx
jmp    1030 <LZ4_compress_limitedOutput@plt>

LLVM IR (-O0):
define i32 @LZ4_compress(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %6
%12 = sdiv i32 %11, 255
%13 = add nsw i32 %10, %12
%14 = add nsw i32 %13, 16
%15 = call i32 @LZ4_compress_limitedOutput(i8* %7, i8* %8, i32 %9, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @LZ4_compress(i8* %0, i8* %1, i32 %2) {
%4 = sdiv i32 %2, 255
%5 = add i32 %2, 16
%6 = add i32 %5, %4
%7 = tail call i32 @LZ4_compress_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ error(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fclose_svg(FILE *fsvg) {
  fprintf(fsvg, "</svg>\n");
  if (fclose(fsvg) == EOF)
    error("fclose_svg: unable to close file while writing SVG file.");
}


x86 assembly (clang, -O0):
<fclose_svg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    1171 <fclose_svg+0x41>
lea    0xe9c(%rip),%rdi
call   1050 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclose_svg>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    116e <fclose_svg+0x3e>
lea    0xea0(%rip),%rdi
pop    %rbx
jmp    1040 <error@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"</svg>\0A\00"
@EOF = global i64 0
@.str.1 = [57 x i8] c"fclose_svg: unable to close file while writing SVG file.\00"
define void @fclose_svg(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i64 @fclose(i32* %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @error(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"</svg>\0A\00"
@EOF = global i64 0
@.str.1 = [57 x i8] c"fclose_svg: unable to close file while writing SVG file.\00"
define void @fclose_svg(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
%3 = tail call i64 @fclose(i32* %0)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @error(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clrscr() { printf("\x1B[2J\x1B[0;0f"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[0;0f\00"
define void @clrscr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ prg8setBank1(int);
void m80setParams7EFC(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank1(val << 13);
}


x86 assembly (clang, -O0):
<m80setParams7EFC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xd,%edi
call   1030 <prg8setBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m80setParams7EFC>:
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank1@plt>

LLVM IR (-O0):
define void @m80setParams7EFC(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 = shl i32 %6, 13
%8 = call i32 @prg8setBank1(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m80setParams7EFC(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @prg8setBank1(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aligned_free(void *aligned) {
  void *ptr = *((void **)aligned - 1);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<aligned_free>:
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @aligned_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DestroyV4l2Context(void *);
void DestroyCameraContext(void *v4l2ctx) { DestroyV4l2Context(v4l2ctx); }


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

x86 assembly (clang, -O2):
<DestroyCameraContext>:
jmp    1030 <DestroyV4l2Context@plt>

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

LLVM IR (-O2):
define void @DestroyCameraContext(i8* %0) {
%2 = tail call i32 @DestroyV4l2Context(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *busy_loop(void *arg) {
  while (1) {
    sleep(5);
  }
}


x86 assembly (clang, -O0):
<busy_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
call   1030 <sleep@plt>
jmp    111c <busy_loop+0xc>

x86 assembly (clang, -O2):
<busy_loop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1030 <sleep@plt>
jmp    1120 <busy_loop+0x10>

LLVM IR (-O0):
define i8* @busy_loop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 5)
br label %3
}

LLVM IR (-O2):
define noalias i8* @busy_loop(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 5)
br label %2
}
/* Variables and functions */
void *glXGetProcAddress(unsigned char const *);
void *LoadProcAddress(const char *name) {
  return glXGetProcAddress((const unsigned char *)name);
}


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

x86 assembly (clang, -O2):
<LoadProcAddress>:
jmp    1030 <glXGetProcAddress@plt>

LLVM IR (-O0):
define i8* @LoadProcAddress(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @glXGetProcAddress(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @LoadProcAddress(i8* %0) {
%2 = tail call i8* @glXGetProcAddress(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ write(int, int /*<<< orphan*/ *, int);
void print(char *str) {
  while (*str)
    write(1, &*str++, 1);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <print+0x39>
mov    -0x8(%rbp),%rsi
mov    %rsi,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
jmp    111c <print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113f <print+0x2f>
mov    %rdi,%rbx
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r14,%rbx
jne    1120 <print+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %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* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = bitcast i8* %5 to i32*
%8 = tail call i32 @write(i32 1, i32* %7, i32 1)
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ATTACH_FILTER;
int /*<<< orphan*/ sock_setfilter(int, int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((__unused__)) void pair_udp_setfilter(int fd) {
  sock_setfilter(fd, SOL_SOCKET, SO_ATTACH_FILTER);
}


x86 assembly (clang, -O0):
<pair_udp_setfilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
call   1030 <sock_setfilter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_udp_setfilter>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <sock_setfilter@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ATTACH_FILTER = global i32 0
define void @pair_udp_setfilter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_ATTACH_FILTER
%6 = call i32 @sock_setfilter(i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ATTACH_FILTER = global i32 0
define void @pair_udp_setfilter(i32 %0) {
%2 = load i32, i32* @SOL_SOCKET
%3 = load i32, i32* @SO_ATTACH_FILTER
%4 = tail call i32 @sock_setfilter(i32 %0, i32 %2, i32 %3)
ret void
}
void rt2x00leds_resume(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00leds_resume(%struct.rt2x00_dev* nocapture %0) {
ret void
}
int pdf_js_supported() { return 0; }


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

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

LLVM IR (-O0):
define i32 @pdf_js_supported() {
ret i32 0
}

LLVM IR (-O2):
define i32 @pdf_js_supported() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printUsage(int, char *);
void checkArgsLength(int args, char *bin) {
  if (args < 5) {
    printUsage(args, bin);
  }
}


x86 assembly (clang, -O0):
<checkArgsLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1135 <checkArgsLength+0x25>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <printUsage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkArgsLength>:
cmp    $0x4,%edi
jg     111a <checkArgsLength+0xa>
jmp    1030 <printUsage@plt>
ret

LLVM IR (-O0):
define void @checkArgsLength(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @printUsage(i32 %8, i8* %9)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @checkArgsLength(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 5
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printUsage(i32 %0, i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lr_error_message(char *, char const *, char const *);
void OnErrorCB0(const char *connectionID, const char *message, int length) {
  lr_error_message(
      ">> WebSocket ID=%s error occured. Error message = %s [at OnErrorCB0]",
      connectionID, message);
}


x86 assembly (clang, -O0):
<OnErrorCB0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xece(%rip),%rdi
call   1030 <lr_error_message@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [69 x i8] c">> WebSocket ID=%s error occured. Error message = %s [at OnErrorCB0]\00"
define void @OnErrorCB0(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @lr_error_message(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c">> WebSocket ID=%s error occured. Error message = %s [at OnErrorCB0]\00"
define void @OnErrorCB0(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @lr_error_message(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int *checkwinner_1_svc(void *argp, struct svc_req *rqstp) {
  static int result;
  return &result;
}


x86 assembly (clang, -O0):
<checkwinner_1_svc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0x2f11(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.svc_req = type opaque
@checkwinner_1_svc.result = internal global i32 0
define i32* @checkwinner_1_svc(i8* %0, %struct.svc_req* %1) {
%3 = alloca i8*
%4 = alloca %struct.svc_req*
store i8* %0, i8** %3
store %struct.svc_req* %1, %struct.svc_req** %4
ret i32* @checkwinner_1_svc.result
}

LLVM IR (-O2):
%struct.svc_req = type opaque
@checkwinner_1_svc.result = internal global i32 0
define i32* @checkwinner_1_svc(i8* nocapture readnone %0, %struct.svc_req* nocapture readnone %1) {
ret i32* @checkwinner_1_svc.result
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
main() {
  long nc;
  nc = 0;
  while (getchar() != EOF)
    ++nc;
  printf("%1d\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [5 x i8] c"%1d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
br label %3
3: ; preds = %7, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i64, i64* %2
%9 = add nsw i64 %8, 1
store i64 %9, i64* %2
br label %3
10: ; preds = %3
%11 = load i64, i64* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%1d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
void swap(int ar[], int i, int j) {
  int t = ar[i];
  ar[i] = ar[j];
  ar[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int fscan_decimal(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int scan_decimal() { return fscan_decimal(stdin); }


x86 assembly (clang, -O0):
<scan_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fscan_decimal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_decimal>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fscan_decimal@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @scan_decimal() {
%1 = load i32, i32* @stdin
%2 = call i32 @fscan_decimal(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @scan_decimal() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fscan_decimal(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void advanced_signal_handler(int signo, siginfo_t *si, void *data) {
  printf("* Received a SIGTRAP\n");
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"* Received a SIGTRAP\0A\00"
define void @advanced_signal_handler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"* Received a SIGTRAP\00"
define void @advanced_signal_handler(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct section_list {
  int dummy;
};
struct section {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_back(struct genlist const *);
struct section *section_list_back(const struct section_list *tthis) {
  return (struct section *)genlist_back((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<section_list_back>:
jmp    1030 <genlist_back@plt>

LLVM IR (-O0):
%struct.section = type { i32 }
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.section* @section_list_back(%struct.section_list* %0) {
%2 = alloca %struct.section_list*
store %struct.section_list* %0, %struct.section_list** %2
%3 = load %struct.section_list*, %struct.section_list** %2
%4 = bitcast %struct.section_list* %3 to %struct.genlist*
%5 = call i64 @genlist_back(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.section*
ret %struct.section* %6
}

LLVM IR (-O2):
%struct.section = type { i32 }
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.section* @section_list_back(%struct.section_list* %0) {
%2 = bitcast %struct.section_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_back(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.section*
ret %struct.section* %4
}
/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int shmdt(const void *shmaddr) {
  StubBug("STUB:"
          "shmdt");
  return -1;
}


x86 assembly (clang, -O0):
<shmdt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <StubBug@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmdt>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <StubBug@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"STUB:shmdt\00"
define i32 @shmdt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @StubBug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [11 x i8] c"STUB:shmdt\00"
define i32 @shmdt(i8* nocapture readnone %0) {
%2 = tail call i32 @StubBug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}