xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test9();
int main(int argc, char **argv) {
  if (!test9())
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test9@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test9@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test9()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test9()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *skipspaces(char *p) {
  while (isspace((unsigned char)*p))
    p++;
  return p;
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skipspaces+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspaces>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipspaces(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 zeroext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
unsigned int const pt_flags_to_bin_noC(unsigned int const);
unsigned pt_flags_to_bin(const unsigned flags) {
  const unsigned mask = 0u - (flags >> 4);
  return (mask & 9u) | (~mask & pt_flags_to_bin_noC(flags));
}


x86 assembly (clang, -O0):
<pt_flags_to_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x9,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pt_flags_to_bin_noC@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
and    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_flags_to_bin>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
shr    $0x4,%ebx
mov    %ebx,%ebp
neg    %ebp
and    $0x9,%ebp
add    $0xffffffff,%ebx
call   1030 <pt_flags_to_bin_noC@plt>
and    %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pt_flags_to_bin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 4
%6 = sub i32 0, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 9
%9 = load i32, i32* %3
%10 = xor i32 %9, -1
%11 = load i32, i32* %2
%12 = call i32 @pt_flags_to_bin_noC(i32 %11)
%13 = and i32 %10, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @pt_flags_to_bin(i32 %0) {
%2 = lshr i32 %0, 4
%3 = sub nsw i32 0, %2
%4 = and i32 %3, 9
%5 = add nsw i32 %2, -1
%6 = tail call i32 @pt_flags_to_bin_noC(i32 %0)
%7 = and i32 %6, %5
%8 = or i32 %7, %4
ret i32 %8
}
int test_imm_38int32_reg(int val) { return ((val) & (0x38 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_38int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x38,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_38int32_reg>:
test   $0x38,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_38int32_reg(i32 %0) {
%2 = and i32 %0, 56
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int update_frac(void *, int);
int update(void *self) { return update_frac(self, 1.); }


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

x86 assembly (clang, -O2):
<update>:
mov    $0x1,%esi
jmp    1030 <update_frac@plt>

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

LLVM IR (-O2):
define i32 @update(i8* %0) {
%2 = tail call i32 @update_frac(i8* %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_sensor_config(int32_t port, int32_t type) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ev3_sensor_config(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tohost_exit(int);
void exit(int code) { tohost_exit(code); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tohost_exit@plt>

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

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @tohost_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @tohost_exit(i32 %0)
unreachable
}
int test_imm_1Fint64_midword_reg(long long val) {
  return ((val >> 16) & (0x1F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Fint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x1f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Fint64_midword_reg>:
test   $0x1f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2031616
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzUnaryFunc_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int, int /*<<< orphan*/);
void BrzUnaryFuncPush_ackdown(struct comp *comp, int port) {
  struct BrzUnaryFunc_ *c = (struct BrzUnaryFunc_ *)comp;
  SEND_ACKDOWN_DELAYED(1, 0);
}


x86 assembly (clang, -O0):
<BrzUnaryFuncPush_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzUnaryFuncPush_ackdown>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <SEND_ACKDOWN_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzUnaryFunc_ = type { i32 }
define void @BrzUnaryFuncPush_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzUnaryFunc_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzUnaryFunc_*
store %struct.BrzUnaryFunc_* %7, %struct.BrzUnaryFunc_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzUnaryFuncPush_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ consoleTranslUserAdd(char *, char *, int,
                                        int /*<<< orphan*/ *);
void consoleTranslUserAdd3(char *prefix, char *scriptExpr, int params) {
  consoleTranslUserAdd(prefix, scriptExpr, params, NULL);
}


x86 assembly (clang, -O0):
<consoleTranslUserAdd3>:
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),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <consoleTranslUserAdd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleTranslUserAdd3>:
xor    %ecx,%ecx
jmp    1030 <consoleTranslUserAdd@plt>

LLVM IR (-O0):
define void @consoleTranslUserAdd3(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 = call i32 @consoleTranslUserAdd(i8* %7, i8* %8, i32 %9, i32* null)
ret void
}

LLVM IR (-O2):
define void @consoleTranslUserAdd3(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @consoleTranslUserAdd(i8* %0, i8* %1, i32 %2, i32* null)
ret void
}
void exec_one(void) {}


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

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

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

LLVM IR (-O2):
define void @exec_one() {
ret void
}
int size(s)
register char *s;
{
  register int i = 0;
  while (s && *s++)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     113a <size+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <size+0x4a>
jmp    1158 <size+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <size+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <size+0x1b>
cmpb   $0x0,(%rdi)
je     111b <size+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <size+0x10>
ret

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

LLVM IR (-O2):
define i32 @size(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %0, %3 ]
%8 = phi i32 [ %10, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nuw nsw i32 %8, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
const char *addr2name(void *addr) {
  if (addr) {
  };
  return NULL;
}


x86 assembly (clang, -O0):
<addr2name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <addr2name+0x18>
jmp    1118 <addr2name+0x18>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @addr2name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @addr2name(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ send_frame(int, int);
void loop() {
  send_frame(375, 3);
  delay(5000);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x177,%edi
mov    $0x3,%esi
call   1030 <send_frame@plt>
mov    $0x1388,%edi
call   1040 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rax
mov    $0x177,%edi
mov    $0x3,%esi
call   1030 <send_frame@plt>
mov    $0x1388,%edi
pop    %rax
jmp    1040 <delay@plt>

LLVM IR (-O0):
define void @loop() {
%1 = call i32 @send_frame(i32 375, i32 3)
%2 = call i32 @delay(i32 5000)
ret void
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 @send_frame(i32 375, i32 3)
%2 = tail call i32 @delay(i32 5000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void cip_string_free(void *value) { free(*(char **)value); }


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

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

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

LLVM IR (-O2):
define void @cip_string_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
int multiplicacao(int one_parameter, int second_paramater) {
  int resultado = 0;
  resultado = one_parameter * second_paramater;
  return resultado;
}


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

x86 assembly (clang, -O2):
<multiplicacao>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @multiplicacao(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @multiplicacao(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _endnetdnsent();
int /*<<< orphan*/ _endnethtent();
void endnetent(void) {
  _endnethtent();
  _endnetdnsent();
}


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

x86 assembly (clang, -O2):
<endnetent>:
push   %rax
xor    %eax,%eax
call   1040 <_endnethtent@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <_endnetdnsent@plt>

LLVM IR (-O0):
define void @endnetent() {
%1 = call i32 (...) @_endnethtent()
%2 = call i32 (...) @_endnetdnsent()
ret void
}

LLVM IR (-O2):
define void @endnetent() {
%1 = tail call i32 (...) @_endnethtent()
%2 = tail call i32 (...) @_endnetdnsent()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xf7() {
  Assert_real((isascii(247) == 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_isascii.c",
              1240, ("isascii should be 0 for 0xf7"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf7\00"
define void @t_isascii_0xf7() {
%1 = call i64 @isascii(i32 247)
%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 1240, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf7\00"
define void @t_isascii_0xf7() {
%1 = tail call i64 @isascii(i32 247)
%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 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
IR0RX1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*p0) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1146 <IR0RX1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <IR0RX1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0RX1>:
movzwl (%r8),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,2),%dx
setbe  %al
ret

LLVM IR (-O0):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = load i16*, i16** %13
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i16, i16* %19, i64 %21
%23 = load i16, i16* %22
%24 = zext i16 %23 to i32
%25 = icmp sle i32 %18, %24
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 1, i32* %7
br label %28
27: ; preds = %6
store i32 0, i32* %7
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = load i16, i16* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* %5, i64 %8
%10 = load i16, i16* %9
%11 = icmp ule i16 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int yp_match(const char *dom, const char *map, const char *key, int keylen,
             char **val, int *vallen) {
  *val = "";
  *vallen = 0;
  return 5;
}


x86 assembly (clang, -O0):
<yp_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x28(%rbp),%rax
lea    0xeda(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yp_match>:
lea    0xef9(%rip),%rax
mov    %rax,(%r8)
movl   $0x0,(%r9)
mov    $0x5,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @yp_match(i8* %0, i8* %1, i8* %2, i32 %3, i8** %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8** %4, i8*** %11
store i32* %5, i32** %12
%13 = load i8**, i8*** %11
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %13
%14 = load i32*, i32** %12
store i32 0, i32* %14
ret i32 5
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @yp_match(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8** nocapture writeonly %4, i32* nocapture writeonly %5) {
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
store i32 0, i32* %5
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __CCAPRICE_FDOLOCK(int /*<<< orphan*/ *);
int /*<<< orphan*/ __CCAPRICE_FUNLOCK(int /*<<< orphan*/ *);
int __ccaprice_fseek(int /*<<< orphan*/ *, long, int);
int fseek(FILE *fp, long off, int whence) {
  int r;
  __CCAPRICE_FDOLOCK(fp);
  r = __ccaprice_fseek(fp, off, whence);
  __CCAPRICE_FUNLOCK(fp);
  return r;
}


x86 assembly (clang, -O0):
<fseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__CCAPRICE_FDOLOCK@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__ccaprice_fseek@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <__CCAPRICE_FUNLOCK@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fseek>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <__CCAPRICE_FDOLOCK@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <__ccaprice_fseek@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1050 <__CCAPRICE_FUNLOCK@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fseek(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = call i32 @__CCAPRICE_FDOLOCK(i32* %8)
%10 = load i32*, i32** %4
%11 = load i64, i64* %5
%12 = load i32, i32* %6
%13 = call i32 @__ccaprice_fseek(i32* %10, i64 %11, i32 %12)
store i32 %13, i32* %7
%14 = load i32*, i32** %4
%15 = call i32 @__CCAPRICE_FUNLOCK(i32* %14)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @fseek(i32* %0, i64 %1, i32 %2) {
%4 = tail call i32 @__CCAPRICE_FDOLOCK(i32* %0)
%5 = tail call i32 @__ccaprice_fseek(i32* %0, i64 %1, i32 %2)
%6 = tail call i32 @__CCAPRICE_FUNLOCK(i32* %0)
ret i32 %5
}
unsigned long gcd(unsigned long a, unsigned long b) {
  unsigned long x, y, r;
  if (a > b) {
    x = a;
    y = b;
  } else {
    x = b;
    y = a;
  }
  do {
    r = x - x / y * y;
    x = y;
    y = r;
  } while (r > 0);
  return x;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    112f <gcd+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    113f <gcd+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1144 <gcd+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x20(%rbp)
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
imul   -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x28(%rbp)
ja     1144 <gcd+0x44>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rax
cmp    %rsi,%rdi
mov    %rdi,%rdx
cmova  %rsi,%rdx
cmova  %rdi,%rax
jmp    112d <gcd+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = icmp ugt i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %3
store i64 %12, i64* %5
%13 = load i64, i64* %4
store i64 %13, i64* %6
br label %17
14: ; preds = %2
%15 = load i64, i64* %4
store i64 %15, i64* %5
%16 = load i64, i64* %3
store i64 %16, i64* %6
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %28, %17
%19 = load i64, i64* %5
%20 = load i64, i64* %5
%21 = load i64, i64* %6
%22 = udiv i64 %20, %21
%23 = load i64, i64* %6
%24 = mul i64 %22, %23
%25 = sub i64 %19, %24
store i64 %25, i64* %7
%26 = load i64, i64* %6
store i64 %26, i64* %5
%27 = load i64, i64* %7
store i64 %27, i64* %6
br label %28
28: ; preds = %18
%29 = load i64, i64* %7
%30 = icmp ugt i64 %29, 0
br i1 %30, label %18, label %31
31: ; preds = %28
%32 = load i64, i64* %5
ret i64 %32
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
%5 = select i1 %3, i64 %0, i64 %1
br label %6
6: ; preds = %6, %2
%7 = phi i64 [ %4, %2 ], [ %9, %6 ]
%8 = phi i64 [ %5, %2 ], [ %7, %6 ]
%9 = urem i64 %8, %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i64 %7
}
/* Type definitions */
struct account {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct account *);
void account_dispose(struct account *myAccount) { free(myAccount); }


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

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

LLVM IR (-O0):
%struct.account = type { i32 }
define void @account_dispose(%struct.account* %0) {
%2 = alloca %struct.account*
store %struct.account* %0, %struct.account** %2
%3 = load %struct.account*, %struct.account** %2
%4 = call i32 @free(%struct.account* %3)
ret void
}

LLVM IR (-O2):
%struct.account = type { i32 }
define void @account_dispose(%struct.account* nocapture %0) {
%2 = tail call i32 @free(%struct.account* %0)
ret void
}
void EC_POINT_cmp(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_POINT_cmp() {
ret void
}
void io_sti() { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @io_sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int nbits;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned long *, unsigned long const *, int);
void bitmap_copy(unsigned long *dst, const unsigned long *src, int nbits) {
  if (nbits <= ((int)sizeof(unsigned long) * 8))
    *dst = *src;
  else {
    int len = (((nbits) + ((int)sizeof(unsigned long) * 8) - 1) /
               ((int)sizeof(unsigned long) * 8)) *
              sizeof(unsigned long);
    memcpy(dst, src, len);
  }
}


x86 assembly (clang, -O0):
<bitmap_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jg     1140 <bitmap_copy+0x30>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    116a <bitmap_copy+0x5a>
mov    -0x14(%rbp),%eax
add    $0x40,%eax
sub    $0x1,%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
cltq
shl    $0x3,%rax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_copy>:
cmp    $0x40,%edx
jg     111c <bitmap_copy+0xc>
mov    (%rsi),%rax
mov    %rax,(%rdi)
ret
add    $0x3f,%edx
shr    $0x3,%edx
and    $0xfffffff8,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @bitmap_copy(i64* %0, i64* %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i32
store i64* %0, i64** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 64
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %4
store i64 %12, i64* %13
br label %26
14: ; preds = %3
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 64
%17 = sub nsw i32 %16, 1
%18 = sdiv i32 %17, 64
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 8
%21 = trunc i64 %20 to i32
store i32 %21, i32* %7
%22 = load i64*, i64** %4
%23 = load i64*, i64** %5
%24 = load i32, i32* %7
%25 = call i32 @memcpy(i64* %22, i64* %23, i32 %24)
br label %26
26: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
define void @bitmap_copy(i64* %0, i64* %1, i32 %2) {
%4 = icmp slt i32 %2, 65
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = load i64, i64* %1
store i64 %6, i64* %0
br label %12
7: ; preds = %3
%8 = add nuw nsw i32 %2, 63
%9 = lshr i32 %8, 3
%10 = and i32 %9, 536870904
%11 = tail call i32 @memcpy(i64* %0, i64* %1, i32 %10)
br label %12
12: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HDMITX_WriteI2C_Byte(int, int);
void ClearDDCFIFO(void) {
  HDMITX_WriteI2C_Byte(0x10, (0 << 1) | (1 << 0));
  HDMITX_WriteI2C_Byte(0x15, 9);
}


x86 assembly (clang, -O0):
<ClearDDCFIFO>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x15,%edi
mov    $0x9,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearDDCFIFO>:
push   %rax
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x15,%edi
mov    $0x9,%esi
pop    %rax
jmp    1030 <HDMITX_WriteI2C_Byte@plt>

LLVM IR (-O0):
define void @ClearDDCFIFO() {
%1 = call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 1)
%2 = call i32 @HDMITX_WriteI2C_Byte(i32 21, i32 9)
ret void
}

LLVM IR (-O2):
define void @ClearDDCFIFO() {
%1 = tail call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 1)
%2 = tail call i32 @HDMITX_WriteI2C_Byte(i32 21, i32 9)
ret void
}
int test_imm_51int64_highword_reg(long long val) {
  return ((val >> 32) & (0x51 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_51int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x51,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_51int64_highword_reg>:
movabs $0x5100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_51int64_highword_reg(i64 %0) {
%2 = and i64 %0, 347892350976
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct buffer_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dump_file_content(char *);
char *get_instance_file(struct buffer_instance *, char const *);
int /*<<< orphan*/ tracecmd_put_tracing_file(char *);
void show_instance_file(struct buffer_instance *instance, const char *name) {
  char *path;
  path = get_instance_file(instance, name);
  dump_file_content(path);
  tracecmd_put_tracing_file(path);
}


x86 assembly (clang, -O0):
<show_instance_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get_instance_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <dump_file_content@plt>
mov    -0x18(%rbp),%rdi
call   1030 <tracecmd_put_tracing_file@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_instance_file>:
push   %rbx
call   1040 <get_instance_file@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <dump_file_content@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tracecmd_put_tracing_file@plt>

LLVM IR (-O0):
%struct.buffer_instance = type { i32 }
define void @show_instance_file(%struct.buffer_instance* %0, i8* %1) {
%3 = alloca %struct.buffer_instance*
%4 = alloca i8*
%5 = alloca i8*
store %struct.buffer_instance* %0, %struct.buffer_instance** %3
store i8* %1, i8** %4
%6 = load %struct.buffer_instance*, %struct.buffer_instance** %3
%7 = load i8*, i8** %4
%8 = call i8* @get_instance_file(%struct.buffer_instance* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @dump_file_content(i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @tracecmd_put_tracing_file(i8* %11)
ret void
}

LLVM IR (-O2):
%struct.buffer_instance = type { i32 }
define void @show_instance_file(%struct.buffer_instance* %0, i8* %1) {
%3 = tail call i8* @get_instance_file(%struct.buffer_instance* %0, i8* %1)
%4 = tail call i32 @dump_file_content(i8* %3)
%5 = tail call i32 @tracecmd_put_tracing_file(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int file_exists(const char *filename) {
  FILE *file;
  if ((file = fopen(filename, "r"))) {
    fclose(file);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <file_exists+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <file_exists+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
UTTohhmm(double UT, int *h, int *m) {
  if (UT < 0.0) {
    *h = -1.0;
    *m = -1.0;
  } else {
    *h = (int)UT;
    *m = (int)((UT - (double)(*h)) * 60.0 + 0.5);
  }
}


x86 assembly (clang, -O0):
<UTTohhmm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1138 <UTTohhmm+0x38>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    1176 <UTTohhmm+0x76>
cvttsd2si -0x10(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
subsd  %xmm1,%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTTohhmm>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1118 <UTTohhmm+0x18>
movl   $0xffffffff,(%rdi)
mov    $0xffffffff,%eax
mov    %eax,(%rsi)
ret
cvttsd2si %xmm0,%eax
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
mov    %eax,(%rdi)
subsd  %xmm1,%xmm0
mulsd  0xece(%rip),%xmm0
addsd  0xece(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @UTTohhmm(double %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i32*
%7 = alloca i32*
store double %0, double* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%8 = load double, double* %5
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32*, i32** %6
store i32 -1, i32* %11
%12 = load i32*, i32** %7
store i32 -1, i32* %12
br label %25
13: ; preds = %3
%14 = load double, double* %5
%15 = fptosi double %14 to i32
%16 = load i32*, i32** %6
store i32 %15, i32* %16
%17 = load double, double* %5
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = sitofp i32 %19 to double
%21 = fsub double %17, %20
%22 = call double @llvm.fmuladd.f64(double %21, double 6.000000e+01, double 5.000000e-01)
%23 = fptosi double %22 to i32
%24 = load i32*, i32** %7
store i32 %23, i32* %24
br label %25
25: ; preds = %13, %10
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @UTTohhmm(double %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = fcmp olt double %0, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %3
store i32 -1, i32* %1
br label %12
6: ; preds = %3
%7 = fptosi double %0 to i32
store i32 %7, i32* %1
%8 = sitofp i32 %7 to double
%9 = fsub double %0, %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double 6.000000e+01, double 5.000000e-01)
%11 = fptosi double %10 to i32
br label %12
12: ; preds = %6, %5
%13 = phi i32 [ %11, %6 ], [ -1, %5 ]
store i32 %13, i32* %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int, char *);
scalar_t__ strcmp(char *, char *);
void diff_line(char *lineone, char *linetwo, int linenumber) {
  if (strcmp(lineone, linetwo) < 0 || strcmp(lineone, linetwo) > 0)
    printf("%d<%s\n%d>%s\n", linenumber, lineone, linenumber, linetwo);
}


x86 assembly (clang, -O0):
<diff_line>:
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
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jl     1161 <diff_line+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jle    117b <diff_line+0x5b>
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_line>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <strcmp@plt>
test   %rax,%rax
js     1147 <diff_line+0x27>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jle    1163 <diff_line+0x43>
lea    0xeb2(%rip),%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
mov    %r14d,%ecx
mov    %rbx,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d<%s\0A%d>%s\0A\00"
define void @diff_line(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 i64 @strcmp(i8* %7, i8* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %11, %3
%17 = load i32, i32* %6
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = load i8*, i8** %5
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %17, i8* %18, i32 %19, i8* %20)
br label %22
22: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d<%s\0A%d>%s\0A\00"
define void @diff_line(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6, %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0, i32 %2, i8* %1)
br label %11
11: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
unsigned long long int factorial(unsigned int number) {
  unsigned long long int fibonacci;
  if (number <= 1) {
    return 1;
  } else {
    fibonacci = (number * factorial(number - 1));
    printf("\t%llu\n", fibonacci);
    return fibonacci;
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
ja     1142 <factorial+0x22>
movq   $0x1,-0x8(%rbp)
jmp    117b <factorial+0x5b>
mov    -0xc(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x1,%edi
jbe    114f <factorial+0x2f>
mov    %edi,%r14d
add    $0xffffffff,%edi
call   1030 <factorial@plt>
mov    %rax,%rbx
imul   %r14,%rbx
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\09%llu\0A\00"
define i64 @factorial(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ule i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 1, i64* %2
br label %18
8: ; preds = %1
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = load i32, i32* %3
%12 = sub i32 %11, 1
%13 = call i64 @factorial(i32 %12)
%14 = mul i64 %10, %13
store i64 %14, i64* %4
%15 = load i64, i64* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = load i64, i64* %4
store i64 %17, i64* %2
br label %18
18: ; preds = %8, %7
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
@.str = [7 x i8] c"\09%llu\0A\00"
define i64 @factorial(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %9, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = zext i32 %0 to i64
%7 = add i32 %0, -1
%8 = tail call i64 @factorial(i32 %7)
%9 = mul i64 %8, %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %3
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  while (1) {
    int c = getchar();
    if (c == EOF)
      exit(0);
    if (c == '\n') {
      putchar(015);
      putchar(012);
    } else {
      putchar(c);
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
jne    1162 <main+0x32>
xor    %edi,%edi
call   1050 <exit@plt>
cmpl   $0xa,-0x8(%rbp)
jne    1185 <main+0x55>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    118d <main+0x5d>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
jmp    115e <main+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1178 <main+0x48>
cmp    $0xa,%eax
jne    1150 <main+0x20>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xa,%eax
jmp    1150 <main+0x20>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %19
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %3
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i32 @putchar(i32 13)
%15 = call i32 @putchar(i32 10)
br label %19
16: ; preds = %10
%17 = load i32, i32* %2
%18 = call i32 @putchar(i32 %17)
br label %19
19: ; preds = %16, %13
br label %3
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %4, label %6
4: ; preds = %11, %0
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0, %11
%7 = phi i32 [ %14, %11 ], [ %1, %0 ]
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @putchar(i32 13)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ 10, %9 ], [ %7, %6 ]
%13 = tail call i32 @putchar(i32 %12)
%14 = tail call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %4, label %6
}