xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_lisp_empty_string() {
  test_parser_verify_parse(test_parser_sourcefile("lisp", "\"\""), "lisp",
                           "\"\"", "", 0);
}


x86 assembly (clang, -O0):
<test_lisp_empty_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebe(%rip),%rdx
lea    0xeb9(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lisp_empty_string>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed3(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [3 x i8] c"\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_lisp_empty_string() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [3 x i8] c"\22\22\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_lisp_empty_string() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int zap();
__attribute__((no)) int bar() { return zap(); }


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @zap()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @zap()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint8_t unpack_from_8(const void *v) {
  uint8_t u;
  memcpy(&u, v, sizeof(uint8_t));
  return u;
}


x86 assembly (clang, -O0):
<unpack_from_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_from_8>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unpack_from_8(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @unpack_from_8(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int sscanf(char *, char *, int *, int *, int *);
int parse_address(char *oct, int *g, int *r, int *p) {
  return (sscanf(oct, "%1o%1o%3o", g, r, p) == 3);
}


x86 assembly (clang, -O0):
<parse_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec1(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_address>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xedf(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%1o%1o%3o\00"
define i32 @parse_address(i8* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %10, i32* %11, i32* %12)
%14 = icmp eq i32 %13, 3
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [10 x i8] c"%1o%1o%3o\00"
define i32 @parse_address(i8* nocapture %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned int __atomic_fetch_or_4(volatile void *atom, unsigned int value,
                                 int memorder) {
  unsigned int xchg;
  unsigned int cmp;
  __atomic_load((unsigned int *)atom, (unsigned int *)&cmp, 0);
  do {
    xchg = ((cmp | value));
  } while (
      !__atomic_compare_exchange((unsigned int *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_or_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    %al,-0x21(%rbp)
mov    %ecx,-0x20(%rbp)
test   $0x1,%al
jne    1147 <__atomic_fetch_or_4+0x47>
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1117 <__atomic_fetch_or_4+0x17>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_or_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %eax,%edx
or     %esi,%edx
lock cmpxchg %edx,(%rdi)
jne    1110 <__atomic_fetch_or_4+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__atomic_fetch_or_4(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load atomic i32, i32* %11 monotonic
store i32 %12, i32* %8
br label %13
13: ; preds = %26, %3
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = or i32 %14, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = cmpxchg weak i32* %19, i32 %20, i32 %21 seq_cst seq_cst
%23 = extractvalue { i32, i1 } %22, 0
%24 = extractvalue { i32, i1 } %22, 1
br i1 %24, label %26, label %25
25: ; preds = %17
store i32 %23, i32* %8
br label %26
26: ; preds = %25, %17
%27 = zext i1 %24 to i8
store i8 %27, i8* %9
%28 = load i8, i8* %9
%29 = trunc i8 %28 to i1
%30 = xor i1 %29, true
br i1 %30, label %13, label %31
31: ; preds = %26
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @__atomic_fetch_or_4(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load atomic i32, i32* %4 monotonic
br label %6
6: ; preds = %6, %3
%7 = phi i32 [ %5, %3 ], [ %11, %6 ]
%8 = or i32 %7, %1
%9 = cmpxchg weak i32* %4, i32 %7, i32 %8 seq_cst seq_cst
%10 = extractvalue { i32, i1 } %9, 1
%11 = extractvalue { i32, i1 } %9, 0
br i1 %10, label %12, label %6
12: ; preds = %6
ret i32 %7
}
void smalldelay(void) {
  int loop2;
  for (loop2 = 0; loop2 < 50; loop2++)
    ;
}


x86 assembly (clang, -O0):
<smalldelay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1128 <smalldelay+0x28>
jmp    111a <smalldelay+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <smalldelay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @smalldelay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_atod() {
  printf("NOT IMPLEMENTED:"
         "pa_atod"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"NOT IMPLEMENTED:pa_atod\0A\00"
define i32 @pa_atod() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [24 x i8] c"NOT IMPLEMENTED:pa_atod\00"
define i32 @pa_atod() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned int hash(const char *str) {
  unsigned int h = 0;
  while (*str) {
    h += *str++ * 31;
  }
  return h % 32;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <hash+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
imul   $0x1f,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <hash+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
sub    %ecx,%edx
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x1f,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = mul nsw i32 %12, 31
%14 = load i32, i32* %3
%15 = add i32 %14, %13
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = urem i32 %17, 32
ret i32 %18
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i32
%10 = mul nuw nsw i32 %9, 31
%11 = add i32 %10, %6
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 31
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void swaplong(void *a, void *b) {
  long t = *((long *)b);
  *((long *)b) = *((long *)a);
  *((long *)a) = t;
}


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

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

LLVM IR (-O0):
define void @swaplong(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i64*
store i64 %11, i64* %13
%14 = load i64, i64* %5
%15 = load i8*, i8** %3
%16 = bitcast i8* %15 to i64*
store i64 %14, i64* %16
ret void
}

LLVM IR (-O2):
define void @swaplong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %0 to i64*
%6 = load i64, i64* %5
store i64 %6, i64* %3
store i64 %4, i64* %5
ret void
}
int popcountll(unsigned long long x) { return __builtin_popcountll(x); }


x86 assembly (clang, -O0):
<popcountll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcountll>:
mov    %rdi,%rax
shr    %rax
movabs $0x5555555555555555,%rcx
55 55 55
and    %rax,%rcx
sub    %rcx,%rdi
movabs $0x3333333333333333,%rax
33 33 33
mov    %rdi,%rcx
and    %rax,%rcx
shr    $0x2,%rdi
and    %rdi,%rax
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rax,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rcx,%rdx
movabs $0x101010101010101,%rax
01 01 01
imul   %rdx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i32 @popcountll(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctpop.i64(i64 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @popcountll(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_key(void *context, char *key) { free(key); }


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

x86 assembly (clang, -O2):
<free_key>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_key(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FW_CDEV_IOC_SEND_BROADCAST_REQUEST;
int /*<<< orphan*/ do_write_request(int /*<<< orphan*/);
void do_broadcast(void) {
  do_write_request(FW_CDEV_IOC_SEND_BROADCAST_REQUEST);
}


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

x86 assembly (clang, -O2):
<do_broadcast>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <do_write_request@plt>

LLVM IR (-O0):
@FW_CDEV_IOC_SEND_BROADCAST_REQUEST = global i32 0
define void @do_broadcast() {
%1 = load i32, i32* @FW_CDEV_IOC_SEND_BROADCAST_REQUEST
%2 = call i32 @do_write_request(i32 %1)
ret void
}

LLVM IR (-O2):
@FW_CDEV_IOC_SEND_BROADCAST_REQUEST = global i32 0
define void @do_broadcast() {
%1 = load i32, i32* @FW_CDEV_IOC_SEND_BROADCAST_REQUEST
%2 = tail call i32 @do_write_request(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_carry_mul(uintptr_t, uintptr_t,
                                                 uintptr_t);
void fiat_25519_carry_mul(uint64_t out1[5], const uint64_t arg1[5],
                          const uint64_t arg2[5]) {
  internal_fiat_25519_carry_mul((uintptr_t)out1, (uintptr_t)arg1,
                                (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_25519_carry_mul>:
jmp    1030 <internal_fiat_25519_carry_mul@plt>

LLVM IR (-O0):
define void @fiat_25519_carry_mul(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_25519_carry_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_carry_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_25519_carry_mul(i64 %4, i64 %5, i64 %6)
ret void
}
void kmemset(unsigned char *dest, unsigned char value, int nbytes) {
  unsigned char *end = dest + nbytes;
  while (dest != end) {
    *dest++ = value;
  }
}


x86 assembly (clang, -O0):
<kmemset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1147 <kmemset+0x47>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1120 <kmemset+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmemset>:
test   %edx,%edx
je     1125 <kmemset+0x15>
push   %rax
movslq %edx,%rdx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @kmemset(i8* writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delete_flexdice();
void fin_flexdice(void) { delete_flexdice(); }


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

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

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

LLVM IR (-O2):
define void @fin_flexdice() {
%1 = tail call i32 (...) @delete_flexdice()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert_int_eq_add_test();
void test_assert_int_eq_add_test_constructor(void) {
  test_assert_int_eq_add_test();
}


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

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

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

LLVM IR (-O2):
define void @test_assert_int_eq_add_test_constructor() {
%1 = tail call i32 (...) @test_assert_int_eq_add_test()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t enbyte(uint32_t x) { return x & 0x000000ff; }


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

x86 assembly (clang, -O2):
<enbyte>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @enbyte(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
unsigned hash(char *s) {
  unsigned int hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return hashval % 100;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113c <hash+0x3c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x25,%rcx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = mul i32 31, %13
%15 = add i32 %12, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %4
19: ; preds = %4
%20 = load i32, i32* %3
%21 = urem i32 %20, 100
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 100
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
void erase_entire(char *buffer, int size, char val) {
  int i;
  for (i = 0; i < size; i++) {
    buffer[i] = val;
  }
}


x86 assembly (clang, -O0):
<erase_entire>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <erase_entire+0x3f>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <erase_entire+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_entire>:
test   %esi,%esi
jle    1126 <erase_entire+0x16>
push   %rax
mov    %esi,%eax
movzbl %dl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @erase_entire(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %3
ret void
}
void marker(void) {
  int a = 0;
  int b = a;
  asm("    .global "
      "set_point"
      "\n"
      "set_point"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
  asm("    .global "
      "after_set_point"
      "\n"
      "after_set_point"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
}


x86 assembly (clang, -O0):
<marker>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)

x86 assembly (clang, -O2):
<marker>:
call   1030 <x86_trace_dummy@plt>

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

LLVM IR (-O2):
define void @marker() {
tail call void asm sideeffect " .global set_point\0Aset_point:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect " .global after_set_point\0Aafter_set_point:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void foo_duang(void) {}


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

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

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

LLVM IR (-O2):
define void @foo_duang() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void SetDispInverse() { WRITETEST("\033[7m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[7m\00"
define void @SetDispInverse() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *block_create() {
  char *blk = (char *)malloc((1 << 17));
  return blk;
}


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

x86 assembly (clang, -O2):
<block_create>:
mov    $0x20000,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @block_create() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 131072)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
define i8* @block_create() {
%1 = tail call i64 @malloc(i32 131072)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
int test_bit(int nr, volatile unsigned long *addr) {
  return (((addr))[(nr) / (sizeof(unsigned long) * 8)] >>
          ((nr) % (sizeof(unsigned long) * 8))) &
         1;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = udiv i64 %7, 64
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load volatile i64, i64* %9
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 64
%14 = lshr i64 %10, %13
%15 = and i64 %14, 1
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = sext i32 %0 to i64
%4 = lshr i64 %3, 6
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load volatile i64, i64* %5
%7 = and i64 %3, 63
%8 = lshr i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xaa() {
  Assert_real((iscntrl(170) == 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_iscntrl.c",
              855, ("iscntrl should be 0 for 0xaa"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xaa>:
push   %rax
mov    $0xaa,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x357,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xaa\00"
define void @t_iscntrl_0xaa() {
%1 = call i64 @iscntrl(i32 170)
%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 855, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xaa\00"
define void @t_iscntrl_0xaa() {
%1 = tail call i64 @iscntrl(i32 170)
%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 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
f() {
  int i = '\n' ^ 0;
  return i | ~1 + 0 [""];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl 0xeeb(%rip),%ecx
add    $0xfffffffe,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @f() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = load i8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
%4 = sext i8 %3 to i32
%5 = add nsw i32 -2, %4
%6 = or i32 %2, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f() {
ret i32 -2
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef scalar_t__ Atom;

/* Variables and functions */
char *XGetAtomName(int /*<<< orphan*/ *, scalar_t__);
char *XmuGetAtomName(Display *d, Atom atom) {
  if (atom == 0)
    return (NULL);
  return XGetAtomName(d, atom);
}


x86 assembly (clang, -O0):
<XmuGetAtomName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <XmuGetAtomName+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1149 <XmuGetAtomName+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <XGetAtomName@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XmuGetAtomName>:
test   %rsi,%rsi
je     111a <XmuGetAtomName+0xa>
jmp    1030 <XGetAtomName@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @XmuGetAtomName(i32* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @XGetAtomName(i32* %0, i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}
/* Variables and functions */
int read(int, unsigned char *, int);
int read_length(int file) {
  unsigned char hdr[2];
  if (read(file, hdr, 2) < 2)
    return -1;
  return (((int)hdr[0]) << 8) + (int)hdr[1];
}


x86 assembly (clang, -O0):
<read_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x2,%edx
call   1030 <read@plt>
cmp    $0x2,%eax
jge    1141 <read_length+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <read_length+0x41>
movzbl -0xa(%rbp),%eax
shl    $0x8,%eax
movzbl -0x9(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_length>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <read@plt>
movzwl 0x6(%rsp),%ecx
shl    $0x10,%ecx
cmp    $0x2,%eax
bswap  %ecx
mov    $0xffffffff,%eax
cmovge %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 2)
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %19
10: ; preds = %1
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = add nsw i32 %14, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %10, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @read_length(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 2)
%5 = icmp slt i32 %4, 2
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %8, %11
%13 = select i1 %5, i32 -1, i32 %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int sock_nonblock(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFL);
  flags |= O_NONBLOCK;
  return fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<sock_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @sock_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @sock_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %5)
ret i32 %7
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int getppid();
int test(void) {
  pid_t pid;
  pid = getppid();
  return pid;
}


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

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = call i32 (...) @getppid()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @getppid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xce() {
  Assert_real((isupper(206) == 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_isupper.c",
              1035, ("isupper should be 0 for 0xce"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xce>:
push   %rax
mov    $0xce,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x40b,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xce\00"
define void @t_isupper_0xce() {
%1 = call i64 @isupper(i32 206)
%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 1035, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xce\00"
define void @t_isupper_0xce() {
%1 = tail call i64 @isupper(i32 206)
%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 1035, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void cdrmon(mdev, mpkg, mpages) int *mdev, *mpkg, *mpages;
{}


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

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

LLVM IR (-O0):
define void @cdrmon(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
ret void
}

LLVM IR (-O2):
define void @cdrmon(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int getenv(char *);
int /*<<< orphan*/ putenv(char *);
int /*<<< orphan*/ strcmp(int, char *);
int main() {
  assert(getenv("PATH"));
  putenv("foo=bar");
  assert(!strcmp(getenv("foo"), "bar"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xe9c(%rip),%rdi
call   1040 <putenv@plt>
lea    0xe98(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
lea    0xe86(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xeaa(%rip),%rdi
call   1040 <putenv@plt>
lea    0xea6(%rip),%rdi
call   1030 <getenv@plt>
lea    0xe96(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [8 x i8] c"foo=bar\00"
@.str.2 = [4 x i8] c"foo\00"
@.str.3 = [4 x i8] c"bar\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @assert(i32 %2)
%4 = call i32 @putenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @strcmp(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"PATH\00"
@.str.1 = [8 x i8] c"foo=bar\00"
@.str.2 = [4 x i8] c"foo\00"
@.str.3 = [4 x i8] c"bar\00"
define i32 @main() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @putenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @strcmp(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int get_byte_order() { return (*(const u_int32_t *)"a   ") & 0x00000001; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"a \00"
define i32 @get_byte_order() {
%1 = load i32, i32* bitcast ([5 x i8]* @.str to i32*)
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_byte_order() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main(int argc, char **argv) {
  unsigned long x = 0;
  while (x < 10000000) {
    printf("%lu\n", x);
    x++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x989680,-0x18(%rbp)
jae    115d <main+0x4d>
mov    -0x18(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x989680,%rbx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, 10000000
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pfatal(char *, char const *);
char *strdup(char const *);
char *xstrdup(const char *n) {
  char *p = strdup(n);
  if (!p)
    pfatal("xstrdup(%s)", n);
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <pfatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xstrdup+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <pfatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"xstrdup(%s)\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @pfatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"xstrdup(%s)\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pfatal(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}