xunge/DecIR huggingface dataset:
struct WorldCoor *wcsninitc(hstring, lhstring, mchar) const char *hstring;
int lhstring;
char *mchar;
{
  hlength(hstring, lhstring);
  if (mchar[0] == ' ')
    mchar[0] = (char)0;
  return (wcsinitc(hstring, mchar));
}


x86 assembly (clang, -O0):
<wcsninitc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <hlength@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1158 <wcsninitc+0x38>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <wcsinitc@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsninitc>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <hlength@plt>
cmpb   $0x20,(%rbx)
jne    1139 <wcsninitc+0x19>
movb   $0x0,(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <wcsinitc@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsninitc(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @hlength to i32 (i8*, i32, ...)*)(i8* %7, i32 %8)
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 32
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 0, i8* %17
br label %18
18: ; preds = %15, %3
%19 = load i8*, i8** %4
%20 = load i8*, i8** %6
%21 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitc to i32 (i8*, i8*, ...)*)(i8* %19, i8* %20)
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to %struct.WorldCoor*
ret %struct.WorldCoor* %23
}

LLVM IR (-O2):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsninitc(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @hlength to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %3
store i8 0, i8* %2
br label %8
8: ; preds = %7, %3
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitc to i32 (i8*, i8*, ...)*)(i8* %0, i8* %2)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.WorldCoor*
ret %struct.WorldCoor* %11
}
unsigned xrop3_15_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = ~T;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_15_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = xor i32 %4, -1
%9 = and i32 %8, %5
%10 = or i32 %9, %7
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
decsc() { esc("7"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"7\00"
define i32 @decsc() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int test(int a) { return a * 0x13; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x13,-0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
lea    (%rdi,%rdi,8),%eax
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 19
ret i32 %4
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = mul nsw i32 %0, 19
ret i32 %2
}
int at_util_convert_signal_strength(int strength) {
  int result;
  if (strength == 99)
    result = -1;
  else
    result = (strength * 100) / 31;
  return result;
}


x86 assembly (clang, -O0):
<at_util_convert_signal_strength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x63,-0x4(%rbp)
jne    111d <at_util_convert_signal_strength+0x1d>
movl   $0xffffffff,-0x8(%rbp)
jmp    112c <at_util_convert_signal_strength+0x2c>
imul   $0x64,-0x4(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_util_convert_signal_strength>:
mov    $0xffffffff,%eax
cmp    $0x63,%edi
je     1126 <at_util_convert_signal_strength+0x26>
imul   $0x64,%edi,%eax
cltq
imul   $0xffffffff84210843,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x4,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @at_util_convert_signal_strength(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 99
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %3
br label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 100
%10 = sdiv i32 %9, 31
store i32 %10, i32* %3
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @at_util_convert_signal_strength(i32 %0) {
%2 = icmp eq i32 %0, 99
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = mul nsw i32 %0, 100
%5 = sdiv i32 %4, 31
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hi.\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [5 x i8] c"Hi.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"Hi.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_cleanup_all_ex_data();
int /*<<< orphan*/ ERR_remove_state(unsigned long);
void pgp_crypto_finish(void) {
  CRYPTO_cleanup_all_ex_data();
  ERR_remove_state((unsigned long)0);
}


x86 assembly (clang, -O0):
<pgp_crypto_finish>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <CRYPTO_cleanup_all_ex_data@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ERR_remove_state@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgp_crypto_finish>:
push   %rax
xor    %eax,%eax
call   1040 <CRYPTO_cleanup_all_ex_data@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <ERR_remove_state@plt>

LLVM IR (-O0):
define void @pgp_crypto_finish() {
%1 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%2 = call i32 @ERR_remove_state(i64 0)
ret void
}

LLVM IR (-O2):
define void @pgp_crypto_finish() {
%1 = tail call i32 (...) @CRYPTO_cleanup_all_ex_data()
%2 = tail call i32 @ERR_remove_state(i64 0)
ret void
}
void dummyvideo_MoveScreen(int xpos, int ypos) {}


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

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

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

LLVM IR (-O2):
define void @dummyvideo_MoveScreen(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void string_free2(char *s) { free(s); }


x86 assembly (clang, -O0):
<string_free2>:
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):
<string_free2>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @string_free2(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int execute_getuid32() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_getuid32() {
ret i32 0
}
void test_strftime() {}


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

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

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

LLVM IR (-O2):
define void @test_strftime() {
ret void
}
void mf_write_tempo(tempo) unsigned long tempo;
{
  eputc(0);
  eputc(0xFF);
  eputc(0x51);
  eputc(3);
  eputc((unsigned)(0xff & (tempo >> 16)));
  eputc((unsigned)(0xff & (tempo >> 8)));
  eputc((unsigned)(0xff & tempo));
}


x86 assembly (clang, -O0):
<mf_write_tempo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    $0xff,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    $0x51,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    $0x3,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mf_write_tempo>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
mov    $0xff,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
mov    $0x51,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
movzbl %bh,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
movzbl %bl,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <eputc@plt>

LLVM IR (-O0):
define void @mf_write_tempo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 0)
%4 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 255)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 81)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 3)
%7 = load i64, i64* %2
%8 = lshr i64 %7, 16
%9 = and i64 255, %8
%10 = trunc i64 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %10)
%12 = load i64, i64* %2
%13 = lshr i64 %12, 8
%14 = and i64 255, %13
%15 = trunc i64 %14 to i32
%16 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %15)
%17 = load i64, i64* %2
%18 = and i64 255, %17
%19 = trunc i64 %18 to i32
%20 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %19)
ret void
}

LLVM IR (-O2):
define void @mf_write_tempo(i64 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 255)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 81)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 3)
%6 = trunc i64 %0 to i32
%7 = lshr i32 %6, 16
%8 = and i32 %7, 255
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %8)
%10 = lshr i32 %6, 8
%11 = and i32 %10, 255
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %11)
%13 = and i32 %6, 255
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %13)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int uint16_t;
struct can_frame {
  int /*<<< orphan*/ *data;
};

/* Variables and functions */
int /*<<< orphan*/ byteorder(int *, int /*<<< orphan*/ *, int);
int sdo_get_index(const struct can_frame *frame) {
  uint16_t value;
  byteorder(&value, &frame->data[1], sizeof(value));
  return value;
}


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

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

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i32 @sdo_get_index(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
%3 = alloca i32
store %struct.can_frame* %0, %struct.can_frame** %2
%4 = load %struct.can_frame*, %struct.can_frame** %2
%5 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %4, i32 0, i32 0
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = call i32 @byteorder(i32* %3, i32* %7, i32 4)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define i32 @sdo_get_index(%struct.can_frame* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = call i32 @byteorder(i32* %2, i32* %6, i32 4)
%8 = load i32, i32* %2
ret i32 %8
}
unsigned long _farpeekl(unsigned short selector, unsigned long offset) {
  unsigned long result;
  __asm__ __volatile__("movw %w1,%%fs\n"
                       "	.byte 0x64\n"
                       "	movl (%k2),%k0"
                       : "=r"(result)
                       : "rm"(selector), "r"(offset));
  return result;
}


x86 assembly (clang, -O0):
<_farpeekl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,-0x1a(%rbp)
mov    -0x1a(%rbp),%fs
mov    %fs:(%eax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_farpeekl>:
mov    %di,-0x2(%rsp)
mov    -0x2(%rsp),%fs
mov    %fs:(%esi),%eax
ret

LLVM IR (-O0):
define i64 @_farpeekl(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
%5 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%6 = load i16, i16* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "movw ${1:w},%fs\0A\09.byte 0x64\0A\09movl (${2:k}),${0:k}", "=r,rm,r,~{dirflag},~{fpsr},~{flags}"(i16 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @_farpeekl(i16 zeroext %0, i64 %1) {
%3 = tail call i64 asm sideeffect "movw ${1:w},%fs\0A\09.byte 0x64\0A\09movl (${2:k}),${0:k}", "=r,rm,r,~{dirflag},~{fpsr},~{flags}"(i16 %0, i64 %1)
ret i64 %3
}
unsigned processorSwap32(unsigned variable) {
  volatile unsigned tmp = (variable);
  __asm__ __volatile__("bswap %0" : "=r"(tmp) : "r"(tmp));
  return (tmp);
}


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

x86 assembly (clang, -O2):
<processorSwap32>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
bswap  %eax
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @processorSwap32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store volatile i32 %4, i32* %3
%5 = load volatile i32, i32* %3
%6 = call i32 asm sideeffect "bswap $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %5)
store volatile i32 %6, i32* %3
%7 = load volatile i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @processorSwap32(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 %0, i32* %2
%4 = load volatile i32, i32* %2
%5 = tail call i32 asm sideeffect "bswap $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store volatile i32 %5, i32* %2
%6 = load volatile i32, i32* %2
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int findKthLargest(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {3, 2, 1, 5, 6, 4};
  printf("%d\n", findKthLargest(x, sizeof(x) / sizeof(x[0]), 2));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1040 <findKthLargest@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0x2,%edx
call   1040 <findKthLargest@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [6 x i32] [i32 3, i32 2, i32 1, i32 5, i32 6, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
store i32 0, i32* %1
%3 = bitcast [6 x i32]* %2 to i8*
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%5 = call i32 @findKthLargest(i32* %4, i32 6, i32 2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [6 x i32] [i32 3, i32 2, i32 1, i32 5, i32 6, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @findKthLargest(i32* %3, i32 6, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void ExitCritical(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t ectp_ntohs(uint16_t i) { return (uint16_t)bswap_16(i); }


x86 assembly (clang, -O0):
<ectp_ntohs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bswap_16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ectp_ntohs>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @ectp_ntohs(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
unsigned short int unsignedshortint_ignoring_unsignedlong(unsigned short int x,
                                                          unsigned long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_unsignedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_unsignedlong(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_unsignedlong(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x4e() {
  Assert_real((isalnum(78)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              395, ("isalnum should be 1 for N"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x4e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x18b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x4e>:
push   %rax
mov    $0x4e,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x18b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for N\00"
define void @t_isalnum_0x4e() {
%1 = call i32 @isalnum(i32 78)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for N\00"
define void @t_isalnum_0x4e() {
%1 = tail call i32 @isalnum(i32 78)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct option_tag_body {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_option_tag(struct option_tag_body **);
void hf_free_option_tag(void *parsed) {
  struct option_tag_body *otb;
  otb = (struct option_tag_body *)parsed;
  free_option_tag(&otb);
}


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

x86 assembly (clang, -O2):
<hf_free_option_tag>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <free_option_tag@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.option_tag_body = type { i32 }
define void @hf_free_option_tag(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.option_tag_body*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.option_tag_body*
store %struct.option_tag_body* %5, %struct.option_tag_body** %3
%6 = call i32 @free_option_tag(%struct.option_tag_body** %3)
ret void
}

LLVM IR (-O2):
%struct.option_tag_body = type { i32 }
define void @hf_free_option_tag(i8* %0) {
%2 = alloca %struct.option_tag_body*
%3 = bitcast %struct.option_tag_body** %2 to i8*
%4 = bitcast %struct.option_tag_body** %2 to i8**
store i8* %0, i8** %4
%5 = call i32 @free_option_tag(%struct.option_tag_body** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fopen(char *, char *);
int /*<<< orphan*/ generate_c_file(int /*<<< orphan*/);
int /*<<< orphan*/ generate_h_file(int /*<<< orphan*/);
int main() {
  generate_h_file(fopen("shaders.gen.h", "w"));
  generate_c_file(fopen("shaders.gen.c", "w"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %eax,%edi
call   1040 <generate_h_file@plt>
lea    0xebb(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %eax,%edi
call   1030 <generate_c_file@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecf(%rip),%rbx
mov    %rbx,%rsi
call   1050 <fopen@plt>
mov    %eax,%edi
call   1040 <generate_h_file@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1050 <fopen@plt>
mov    %eax,%edi
call   1030 <generate_c_file@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"shaders.gen.h\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [14 x i8] c"shaders.gen.c\00"
define i32 @main() {
%1 = call i32 @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @generate_h_file(i32 %1)
%3 = call i32 @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @generate_c_file(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"shaders.gen.h\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [14 x i8] c"shaders.gen.c\00"
define i32 @main() {
%1 = tail call i32 @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @generate_h_file(i32 %1)
%3 = tail call i32 @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @generate_c_file(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  fprintf(stderr, "x is 0x%x\n", 0x01);
  fprintf(stderr, "%s\n", "a, b, c, d");
  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    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
lea    0xeb6(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed5(%rip),%rsi
lea    0xed2(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"x is 0x%x\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [11 x i8] c"a, b, c, d\00"
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 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"x is 0x%x\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [11 x i8] c"a, b, c, d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, a, b;
  scanf("%d", &n);
  a = n * n;
  b = n * n * n;
  printf("\n%d\n%d", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"\0A%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"\0A%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
long long IRTC_RATE();
long long _glio_rtc_rate(void) { return (IRTC_RATE()); }


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

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

LLVM IR (-O0):
define i64 @_glio_rtc_rate() {
%1 = call i64 (...) @IRTC_RATE()
ret i64 %1
}

LLVM IR (-O2):
define i64 @_glio_rtc_rate() {
%1 = tail call i64 (...) @IRTC_RATE()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void nullFunctionPointerConstraint(void (*f)(void)) {
  if (f)
    return;
  f();
  clang_analyzer_warnIfReached();
}


x86 assembly (clang, -O0):
<nullFunctionPointerConstraint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112c <nullFunctionPointerConstraint+0x1c>
jmp    1136 <nullFunctionPointerConstraint+0x26>
call   *-0x8(%rbp)
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nullFunctionPointerConstraint(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = icmp ne void ()* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load void ()*, void ()** %2
%8 = call i32 (...) @clang_analyzer_warnIfReached()
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @nullFunctionPointerConstraint(void ()* readnone %0) {
%2 = icmp ne void ()* %0, null
tail call void @llvm.assume(i1 %2)
ret void
}
unsigned long add(unsigned long a, unsigned long b) { return a + b; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_version() {
  printf("qethqoat: Tool to query the OSA address table version %s\n",
         "S390_TOOLS_RELEASE");
  printf("Copyright IBM Corp. 2012\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf18(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf0b(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf10(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"qethqoat: Tool to query the OSA address table version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@.str.2 = [26 x i8] c"Copyright IBM Corp. 2012\0A\00"
define void @print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"qethqoat: Tool to query the OSA address table version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@str = [25 x i8] c"Copyright IBM Corp. 2012\00"
define void @print_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
void foo_2_2_2_1_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_2_2_2_1() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  char *ns = (void *)malloc(strlen(str) + 1);
  if (ns == NULL)
    return NULL;
  strcpy(ns, str);
  return ns;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <strdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <strdup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %13, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chess_square_right(int square) {
  assert(square >= 0 && square <= 63);
  if (square % 8 != 7)
    return square + 1;
  return -1;
}


x86 assembly (clang, -O0):
<chess_square_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1134 <chess_square_right+0x24>
cmpl   $0x3f,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x7,%edx
je     1163 <chess_square_right+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <chess_square_right+0x5a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chess_square_right>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
setb   %dil
call   1030 <assert@plt>
lea    0x7(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
and    $0xfffffff8,%eax
mov    %ebx,%ecx
sub    %eax,%ecx
add    $0x1,%ebx
cmp    $0x7,%ecx
mov    $0xffffffff,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chess_square_right(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 63
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = srem i32 %13, 8
%15 = icmp ne i32 %14, 7
br i1 %15, label %16, label %19
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %20
19: ; preds = %9
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %16
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @chess_square_right(i32 %0) {
%2 = icmp ult i32 %0, 64
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = srem i32 %0, 8
%6 = icmp eq i32 %5, 7
%7 = add nsw i32 %0, 1
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct can_frame {
  int /*<<< orphan*/ *data;
};
typedef int /*<<< orphan*/ index;

/* Variables and functions */
int /*<<< orphan*/ byteorder(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void sdo_set_index(struct can_frame *frame, uint16_t index) {
  byteorder(&frame->data[1], &index, sizeof(index));
}


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

x86 assembly (clang, -O2):
<sdo_set_index>:
push   %rax
mov    %esi,0x4(%rsp)
mov    (%rdi),%rdi
add    $0x4,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <byteorder@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define void @sdo_set_index(%struct.can_frame* %0, i32 %1) {
%3 = alloca %struct.can_frame*
%4 = alloca i32
store %struct.can_frame* %0, %struct.can_frame** %3
store i32 %1, i32* %4
%5 = load %struct.can_frame*, %struct.can_frame** %3
%6 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = call i32 @byteorder(i32* %8, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define void @sdo_set_index(%struct.can_frame* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = call i32 @byteorder(i32* %6, i32* %3, i32 4)
ret void
}
void audio_sound_play(void *s) {}


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

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

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

LLVM IR (-O2):
define void @audio_sound_play(i8* nocapture %0) {
ret void
}
void logbuf_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @logbuf_flush() {
ret void
}
int test_3(int a, int b, int c, int d) { return c + d + (a != b); }


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
add    %edx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp ne i32 %12, %13
%15 = zext i1 %14 to i32
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, %2
%6 = icmp ne i32 %0, %1
%7 = zext i1 %6 to i32
%8 = add nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_16(void *dest, void *src) {
  memcpy(dest, src, 16);
}


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

x86 assembly (clang, -O2):
<memcpy_16>:
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_16(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void freeSplit(char **p) {
  if (p != NULL) {
    free(p);
  }
}


x86 assembly (clang, -O0):
<freeSplit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <freeSplit+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeSplit>:
test   %rdi,%rdi
je     111a <freeSplit+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @freeSplit(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 %8
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = call i32 @free(i8** %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @freeSplit(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8** %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int st_g(unsigned int *);
unsigned st_h(unsigned p) { return st_g((unsigned *)p); }


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

x86 assembly (clang, -O2):
<st_h>:
mov    %edi,%edi
jmp    1030 <st_g@plt>

LLVM IR (-O0):
define i32 @st_h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = call i32 @st_g(i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @st_h(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @st_g(i32* %3)
ret i32 %4
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ exit(int);
void sigfunc(int sig) {
  int c;
  if (sig != SIGINT)
    return;
  else {
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<sigfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
je     1133 <sigfunc+0x23>
add    $0x10,%rsp
pop    %rbp
ret
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigfunc>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
je     111e <sigfunc+0xe>
pop    %rax
ret
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @sigfunc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGINT
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
ret void
8: ; preds = %1
%9 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @sigfunc(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %5, label %4
4: ; preds = %1
ret void
5: ; preds = %1
%6 = tail call i32 @exit(i32 -1)
unreachable
}