xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ gtk_main();
int /*<<< orphan*/ x3sync();
void x3main(void) {
  x3sync();
  gtk_main();
}


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

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

LLVM IR (-O0):
define void @x3main() {
%1 = call i32 (...) @x3sync()
%2 = call i32 (...) @gtk_main()
ret void
}

LLVM IR (-O2):
define void @x3main() {
%1 = tail call i32 (...) @x3sync()
%2 = tail call i32 (...) @gtk_main()
ret void
}
int test_imm_26uint8_mem(unsigned char *val) {
  return ((*val) & (0x26 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_26uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 38
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeSSI(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeSSI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeSSI>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeSSI(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 1, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeSSI(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 8)
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int randomize(void) {
  srand(time(NULL));
  int r = rand() % 21;
  return r;
}


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x15,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randomize() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 21
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @randomize() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 21
ret i32 %4
}
/* Type definitions */
struct uwsgi_stats {
  int dummy;
};

/* Variables and functions */
int uwsgi_stats_symbol_nl(struct uwsgi_stats *, char);
int uwsgi_stats_comma(struct uwsgi_stats *us) {
  return uwsgi_stats_symbol_nl(us, ',');
}


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

x86 assembly (clang, -O2):
<uwsgi_stats_comma>:
mov    $0x2c,%esi
jmp    1030 <uwsgi_stats_symbol_nl@plt>

LLVM IR (-O0):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %0) {
%2 = alloca %struct.uwsgi_stats*
store %struct.uwsgi_stats* %0, %struct.uwsgi_stats** %2
%3 = load %struct.uwsgi_stats*, %struct.uwsgi_stats** %2
%4 = call i32 @uwsgi_stats_symbol_nl(%struct.uwsgi_stats* %3, i8 signext 44)
ret i32 %4
}

LLVM IR (-O2):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %0) {
%2 = tail call i32 @uwsgi_stats_symbol_nl(%struct.uwsgi_stats* %0, i8 signext 44)
ret i32 %2
}
char *fossil_utf8_to_mbcs(const char *zUtf8) { return (char *)zUtf8; }


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

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

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

LLVM IR (-O2):
define i8* @fossil_utf8_to_mbcs(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tl_kill(void) { printf("\033[K"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[K\00"
define void @tl_kill() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iswhitespace(char);
char *eatword(char *str) {
  while (*str && !iswhitespace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<eatword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <eatword+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <iswhitespace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <eatword+0x48>
jmp    1169 <eatword+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <eatword+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatword>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <eatword+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <iswhitespace@plt>
test   %eax,%eax
jne    1138 <eatword+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <eatword+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @eatword(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @iswhitespace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ LCD_data(short);
void LCD_auto_write(short data) { LCD_data(data); }


x86 assembly (clang, -O0):
<LCD_auto_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <LCD_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_auto_write>:
jmp    1030 <LCD_data@plt>

LLVM IR (-O0):
define void @LCD_auto_write(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @LCD_data(i16 signext %3)
ret void
}

LLVM IR (-O2):
define void @LCD_auto_write(i16 signext %0) {
%2 = tail call i32 @LCD_data(i16 signext %0)
ret void
}
int prescope_shutdown(void) { return 0; }


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

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

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

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

/* Variables and functions */
uint32_t ivory_serialize_unpack_prim_4_le(const uint8_t *src) {
  return (((uint32_t)src[0] << 0) | ((uint32_t)src[1] << 8) |
          ((uint32_t)src[2] << 16) | ((uint32_t)src[3] << 24));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_prim_4_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_prim_4_le>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ivory_serialize_unpack_prim_4_le(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
int encodeBytesOfinat(int anInt, unsigned char *ba, int i) {
  int j;
  for (j = 0; j <= 3; j += 1) {
    ba[i + j] = ((((unsigned)anInt) >> ((3 - j) * 8)) & 255);
  }
  return i + 4;
}


x86 assembly (clang, -O0):
<encodeBytesOfinat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jg     1154 <encodeBytesOfinat+0x54>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
sub    -0x18(%rbp),%ecx
shl    $0x3,%ecx
shr    %cl,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <encodeBytesOfinat+0x15>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeBytesOfinat>:
movslq %edx,%rax
bswap  %edi
mov    %edi,(%rsi,%rax,1)
add    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @encodeBytesOfinat(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = lshr i32 %0, 24
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 %6, i8* %7
%8 = lshr i32 %0, 16
%9 = trunc i32 %8 to i8
%10 = add nsw i64 %4, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
store i8 %9, i8* %11
%12 = lshr i32 %0, 8
%13 = trunc i32 %12 to i8
%14 = add nsw i64 %4, 2
%15 = getelementptr inbounds i8, i8* %1, i64 %14
store i8 %13, i8* %15
%16 = trunc i32 %0 to i8
%17 = add nsw i64 %4, 3
%18 = getelementptr inbounds i8, i8* %1, i64 %17
store i8 %16, i8* %18
%19 = add nsw i32 %2, 4
ret i32 %19
}
int ChkDesStaticDataLen(unsigned long len) {
  return (len & 0x7) != 0 ? (0) : (1);
}


x86 assembly (clang, -O0):
<ChkDesStaticDataLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x7,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkDesStaticDataLen>:
xor    %eax,%eax
test   $0x7,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ChkDesStaticDataLen(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int DT_REG;
int get_file_type(char *);
int file_exists(char *file) {
  int r = get_file_type(file);
  if (r == DT_REG) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_file_type@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%eax
jne    1146 <file_exists+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114d <file_exists+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
call   1030 <get_file_type@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@DT_REG = global i32 0
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 @get_file_type(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* @DT_REG
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@DT_REG = global i32 0
define i32 @file_exists(i8* %0) {
%2 = tail call i32 @get_file_type(i8* %0)
%3 = load i32, i32* @DT_REG
%4 = icmp ne i32 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double expm1(double const);
double const log1p(double const);
double pow1pm1(const double x, const double y) { return expm1(y * log1p(x)); }


x86 assembly (clang, -O0):
<pow1pm1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <expm1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow1pm1>:
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <log1p@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <expm1@plt>

LLVM IR (-O0):
define double @pow1pm1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @log1p(double %6)
%8 = fmul double %5, %7
%9 = call double @expm1(double %8)
ret double %9
}

LLVM IR (-O2):
define double @pow1pm1(double %0, double %1) {
%3 = tail call double @log1p(double %0)
%4 = fmul double %3, %1
%5 = tail call double @expm1(double %4)
ret double %5
}
/* Variables and functions */
int isspace(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char c;
  c = ' ';
  printf("Return value from isspace() function when white-space character is "
         "passed: %d",
         isspace(c));
  c = '+';
  printf("\nReturn value from isspace() function when white-space character is "
         "not passed: %d",
         isspace(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x20,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movb   $0x2b,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isspace@plt>
mov    %eax,%esi
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1040 <isspace@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2b,%edi
call   1040 <isspace@plt>
lea    0xf04(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [78 x i8] c"Return value from isspace() function when white-space character is passed: %d\00"
@.str.1 = [83 x i8] c"\0AReturn value from isspace() function when white-space character is not passed: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 32, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isspace(i8 signext %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %4)
store i8 43, i8* %2
%6 = load i8, i8* %2
%7 = call i32 @isspace(i8 signext %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [78 x i8] c"Return value from isspace() function when white-space character is passed: %d\00"
@.str.1 = [83 x i8] c"\0AReturn value from isspace() function when white-space character is not passed: %d\00"
define i32 @main() {
%1 = tail call i32 @isspace(i8 signext 32)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isspace(i8 signext 43)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  long int var = 210;
  printf("It is a standard  code for gcc!\n");
  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   $0xd2,-0x18(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"It is a standard code for gcc!\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 210, i64* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"It is a standard code for gcc!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int permutation_after_quaddobl_loop(int d, int *permutation) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc(672, a, permutation, c);
  return fail;
}


x86 assembly (clang, -O0):
<permutation_after_quaddobl_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x2a0,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutation_after_quaddobl_loop>:
mov    %rsi,%rdx
mov    $0x2a0,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @permutation_after_quaddobl_loop(i32 %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc(i32 672, i32* undef, i32* %1, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mb();
extern void outl(unsigned char b, unsigned long addr) {
  *(volatile unsigned int *)((addr << 5) +
                             ((0xfffffc0000000000UL) + 0x1c0000000UL) + 0x18) =
      b;
  mb();
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
movabs $0xfffffc01c0000000,%rdx
fc ff ff
add    %rdx,%rax
mov    %ecx,0x18(%rax)
mov    $0x0,%al
call   1030 <mb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
shl    $0x5,%rsi
movabs $0xfffffc01c0000018,%rax
fc ff ff
mov    %edi,(%rsi,%rax,1)
xor    %eax,%eax
jmp    1030 <mb@plt>

LLVM IR (-O0):
define void @outl(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = shl i64 %7, 5
%9 = add i64 %8, -4390530318336
%10 = add i64 %9, 24
%11 = inttoptr i64 %10 to i32*
store volatile i32 %6, i32* %11
%12 = call i32 (...) @mb()
ret void
}

LLVM IR (-O2):
define void @outl(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = shl i64 %1, 5
%5 = add i64 %4, -4390530318312
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
%7 = tail call i32 (...) @mb()
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef scalar_t__ ssize_t;

/* Variables and functions */
int S_ISLNK(int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
scalar_t__ lstat(char const *, struct stat *);
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
void test_lookup_pass(const char *pathname) {
  struct stat st;
  ssize_t rv;
  memset(&st, 0, sizeof(struct stat));
  rv = lstat(pathname, &st);
  assert(rv == 0);
  assert(S_ISLNK(st.st_mode));
}


x86 assembly (clang, -O0):
<test_lookup_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <lstat@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x10(%rbp),%edi
call   1030 <S_ISLNK@plt>
mov    %eax,%edi
call   1060 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lookup_pass>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <lstat@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    (%rsp),%edi
call   1030 <S_ISLNK@plt>
mov    %eax,%edi
call   1060 <assert@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @test_lookup_pass(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i32 @memset(%struct.stat* %3, i32 0, i32 4)
%6 = load i8*, i8** %2
%7 = call i64 @lstat(i8* %6, %struct.stat* %3)
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @S_ISLNK(i32 %13)
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @test_lookup_pass(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @memset(%struct.stat* %2, i32 0, i32 4)
%5 = call i64 @lstat(i8* %0, %struct.stat* %2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISLNK(i32 %10)
%12 = call i32 @assert(i32 %11)
ret void
}
int btolower(int c) {
  c = (unsigned char)c;
  if ((c >= 65) && (c <= 90)) {
    c = c + 32;
  } else if (c >= 192 && (c <= 221)) {
    c = c + 32;
  }
  return c;
}


x86 assembly (clang, -O0):
<btolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1132 <btolower+0x32>
cmpl   $0x5a,-0x4(%rbp)
jg     1132 <btolower+0x32>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <btolower+0x5a>
cmpl   $0xc0,-0x4(%rbp)
jl     1155 <btolower+0x55>
cmpl   $0xdd,-0x4(%rbp)
jg     1155 <btolower+0x55>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <btolower+0x5a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btolower>:
movzbl %dil,%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%ecx
ja     1110 <btolower+0x10>
add    $0x20,%eax
ret
lea    -0xc0(%rax),%ecx
lea    0x20(%rax),%edx
cmp    $0x1e,%ecx
cmovae %eax,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @btolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 32
store i32 %13, i32* %2
br label %24
14: ; preds = %8, %1
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 192
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 221
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 32
store i32 %22, i32* %2
br label %23
23: ; preds = %20, %17, %14
br label %24
24: ; preds = %23, %11
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @btolower(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -65
%4 = icmp ult i32 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nuw nsw i32 %2, 32
br label %12
7: ; preds = %1
%8 = add nsw i32 %2, -192
%9 = icmp ult i32 %8, 30
%10 = add nuw nsw i32 %2, 32
%11 = select i1 %9, i32 %10, i32 %2
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xe6() {
  Assert_real((isprint(230) == 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_isprint.c",
              1155, ("isprint should be 0 for 0xe6"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xe6>:
push   %rax
mov    $0xe6,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x483,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe6\00"
define void @t_isprint_0xe6() {
%1 = call i64 @isprint(i32 230)
%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 1155, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe6\00"
define void @t_isprint_0xe6() {
%1 = tail call i64 @isprint(i32 230)
%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 1155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void VerifyC(void) { printf("VerifyC\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"VerifyC\00"
define void @VerifyC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void default_walker(void *ptr, size_t size, int used, void *user) {
  ptr = ptr;
  size = size;
  used = used;
  user = user;
}


x86 assembly (clang, -O0):
<default_walker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @default_walker(i8* %0, i64 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
store i8* %9, i8** %5
%10 = load i64, i64* %6
store i64 %10, i64* %6
%11 = load i32, i32* %7
store i32 %11, i32* %7
%12 = load i8*, i8** %8
store i8* %12, i8** %8
ret void
}

LLVM IR (-O2):
define void @default_walker(i8* nocapture %0, i64 %1, i32 %2, i8* nocapture %3) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int icmp_uint8_t(uint8_t a, uint8_t b) {
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<icmp_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1126 <icmp_uint8_t+0x26>
movl   $0x1,-0x4(%rbp)
jmp    1147 <icmp_uint8_t+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1140 <icmp_uint8_t+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <icmp_uint8_t+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmp_uint8_t>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setl   %cl
neg    %ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @icmp_uint8_t(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = icmp slt i64 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void henness17() { printf("henness17 likes to eat pizza a lot\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"henness17 likes to eat pizza a lot\0A\00"
define void @henness17() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"henness17 likes to eat pizza a lot\00"
define void @henness17() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int ntohl(int);
uint64_t btol_64(uint64_t num) {
  uint32_t high_part, low_part;
  high_part = ntohl((uint32_t)(num >> 32));
  low_part = ntohl((uint32_t)(num & 0xFFFFFFFFLL));
  return (((uint64_t)(low_part)) << 32) | high_part;
}


x86 assembly (clang, -O0):
<btol_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <ntohl@plt>
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <ntohl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btol_64>:
push   %rbx
mov    %edi,%ebx
call   1030 <ntohl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @btol_64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 32
%7 = call i32 @ntohl(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = and i64 %9, 4294967295
%11 = trunc i64 %10 to i32
%12 = call i32 @ntohl(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 32
%15 = load i32, i32* %3
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @btol_64(i32 %0) {
%2 = tail call i32 @ntohl(i32 poison)
%3 = tail call i32 @ntohl(i32 %0)
ret i32 poison
}
int main() {
  int students;
  students = 12;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *stringify(double a) {
  char *temp = malloc(32);
  sprintf(temp, "%.1f", a);
  return temp;
}


x86 assembly (clang, -O0):
<stringify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringify>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rsi
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.1f\00"
define i8* @stringify(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
%4 = call i8* @malloc(i32 32)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load double, double* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.1f\00"
define noalias i8* @stringify(double %0) {
%2 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ hybris_sensor_ps_quit();
void mce_hybris_ps_quit(void) { hybris_sensor_ps_quit(); }


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

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

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

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

/* Variables and functions */
uint16_t cyclic_difference(uint8_t *start, uint8_t *end) {
  if (start > end) {
    end += (1024 + 512);
  }
  return end - start;
}


x86 assembly (clang, -O0):
<cyclic_difference>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1128 <cyclic_difference+0x28>
mov    -0x10(%rbp),%rax
add    $0x1800,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cyclic_difference>:
lea    0x1800(%rsi),%rax
cmp    %rsi,%rdi
cmovbe %rsi,%rax
sub    %rdi,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i32 @cyclic_difference(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = icmp ugt i32* %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1536
store i32* %10, i32** %4
br label %11
11: ; preds = %8, %2
%12 = load i32*, i32** %4
%13 = load i32*, i32** %3
%14 = ptrtoint i32* %12 to i64
%15 = ptrtoint i32* %13 to i64
%16 = sub i64 %14, %15
%17 = sdiv exact i64 %16, 4
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @cyclic_difference(i32* %0, i32* %1) {
%3 = icmp ugt i32* %0, %1
%4 = select i1 %3, i64 1536, i64 0
%5 = getelementptr i32, i32* %1, i64 %4
%6 = ptrtoint i32* %5 to i64
%7 = ptrtoint i32* %0 to i64
%8 = sub i64 %6, %7
%9 = lshr exact i64 %8, 2
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mytest(int d) { printf("%d\n", d); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @mytest(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
long long llabs(long long);
long long _llclip(long long a, long long max_val) {
  long long abs_max_val;
  abs_max_val = llabs(max_val);
  if (llabs(a) < abs_max_val) {
    return a;
  } else {
    return (a < 0 ? -abs_max_val : abs_max_val);
  }
}


x86 assembly (clang, -O0):
<_llclip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <llabs@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <llabs@plt>
cmp    -0x20(%rbp),%rax
jge    114d <_llclip+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <_llclip+0x67>
cmpq   $0x0,-0x10(%rbp)
jge    1167 <_llclip+0x57>
xor    %eax,%eax
sub    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    116f <_llclip+0x5f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_llclip>:
mov    %rsi,%rcx
neg    %rcx
cmovs  %rsi,%rcx
mov    %rdi,%rdx
neg    %rdx
cmovs  %rdi,%rdx
mov    %rcx,%rax
neg    %rax
test   %rdi,%rdi
cmovns %rcx,%rax
cmp    %rcx,%rdx
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @_llclip(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = call i64 @llabs(i64 %7)
store i64 %8, i64* %6
%9 = load i64, i64* %4
%10 = call i64 @llabs(i64 %9)
%11 = load i64, i64* %6
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i64, i64* %4
store i64 %14, i64* %3
br label %25
15: ; preds = %2
%16 = load i64, i64* %4
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i64, i64* %6
%20 = sub nsw i64 0, %19
br label %23
21: ; preds = %15
%22 = load i64, i64* %6
br label %23
23: ; preds = %21, %18
%24 = phi i64 [ %20, %18 ], [ %22, %21 ]
store i64 %24, i64* %3
br label %25
25: ; preds = %23, %13
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @_llclip(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%4 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%5 = icmp ult i64 %4, %3
%6 = icmp slt i64 %0, 0
%7 = sub nsw i64 0, %3
%8 = select i1 %6, i64 %7, i64 %3
%9 = select i1 %5, i64 %0, i64 %8
ret i64 %9
}
/* Variables and functions */
scalar_t__ sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ v3sqlength(float const *);
float v3length(const float *v) { return (float)sqrt(v3sqlength(v)); }


x86 assembly (clang, -O0):
<v3length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <v3sqlength@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3length>:
push   %rax
call   1030 <v3sqlength@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @v3length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @v3sqlength(float* %3)
%5 = call i64 @sqrt(i32 %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @v3length(float* %0) {
%2 = tail call i32 @v3sqlength(float* %0)
%3 = tail call i64 @sqrt(i32 %2)
%4 = sitofp i64 %3 to float
ret float %4
}
char chmax(char a, char b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<chmax>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <chmax+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <chmax+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmax>:
mov    %esi,%eax
cmp    %al,%dil
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @chmax(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @chmax(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}