xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ readTextFilesLEVELTrees();
int /*<<< orphan*/ readTextFilesSNRTrees();
void loadDecTree() {
  readTextFilesLEVELTrees();
  readTextFilesSNRTrees();
}


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

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

LLVM IR (-O0):
define void @loadDecTree() {
%1 = call i32 (...) @readTextFilesLEVELTrees()
%2 = call i32 (...) @readTextFilesSNRTrees()
ret void
}

LLVM IR (-O2):
define void @loadDecTree() {
%1 = tail call i32 (...) @readTextFilesLEVELTrees()
%2 = tail call i32 (...) @readTextFilesSNRTrees()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ source;
};

/* Variables and functions */
uint16_t tcphdr_source(struct tcphdr *h) { return h->source; }


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

x86 assembly (clang, -O2):
<tcphdr_source>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_source(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_source(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
uint8_t capture_read_master_pic(uint16_t port, void *p) {
  capture_event(p, (4 << 8), 0, port);
  return 0xff;
}


x86 assembly (clang, -O0):
<capture_read_master_pic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x400,%esi
xor    %edx,%edx
call   1030 <capture_event@plt>
mov    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_read_master_pic>:
push   %rax
mov    %edi,%ecx
mov    %rsi,%rdi
mov    $0x400,%esi
xor    %edx,%edx
call   1030 <capture_event@plt>
mov    $0xff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @capture_read_master_pic(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @capture_event(i8* %5, i32 1024, i32 0, i32 %6)
ret i32 255
}

LLVM IR (-O2):
define i32 @capture_read_master_pic(i32 %0, i8* %1) {
%3 = tail call i32 @capture_event(i8* %1, i32 1024, i32 0, i32 %0)
ret i32 255
}
/* Variables and functions */
int max(int, int);
int f(int x, int y) { return max(-x, -y); }


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

x86 assembly (clang, -O2):
<f>:
neg    %edi
neg    %esi
jmp    1030 <max@plt>

LLVM IR (-O0):
define i32 @f(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 = sub nsw i32 0, %5
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = call i32 @max(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
%4 = sub nsw i32 0, %1
%5 = tail call i32 @max(i32 %3, i32 %4)
ret i32 %5
}
void *int_to_voidp(int i) { return (void *)(long)i; }


x86 assembly (clang, -O0):
<int_to_voidp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_voidp>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @int_to_voidp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @int_to_voidp(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
scalar_t__ i2c_smbus_read_i2c_block_data(int, int /*<<< orphan*/,
                                         int /*<<< orphan*/,
                                         int /*<<< orphan*/ *);
void bmp085_i2c_Read_Block(int fd, __u8 address, __u8 length, __u8 *values) {
  if (i2c_smbus_read_i2c_block_data(fd, address, length, values) < 0) {
    close(fd);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<bmp085_i2c_Read_Block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <i2c_smbus_read_i2c_block_data@plt>
cmp    $0x0,%rax
jge    1173 <bmp085_i2c_Read_Block+0x43>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp085_i2c_Read_Block>:
push   %rbx
mov    %edi,%ebx
call   1040 <i2c_smbus_read_i2c_block_data@plt>
test   %rax,%rax
js     113f <bmp085_i2c_Read_Block+0xf>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @bmp085_i2c_Read_Block(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* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i64 @i2c_smbus_read_i2c_block_data(i32 %9, i32 %10, i32 %11, i32* %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = load i32, i32* %5
%17 = call i32 @close(i32 %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @bmp085_i2c_Read_Block(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i64 @i2c_smbus_read_i2c_block_data(i32 %0, i32 %1, i32 %2, i32* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @close(i32 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
void rop3_76_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_76_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_76_1_0>:
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_76_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StructInit();
void DotInitialize(int pass) { StructInit(); }


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

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

LLVM IR (-O0):
define void @DotInitialize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @StructInit()
ret void
}

LLVM IR (-O2):
define void @DotInitialize(i32 %0) {
%2 = tail call i32 (...) @StructInit()
ret void
}
ISR(INT7_vect) {
  DEBUG("ISR "
        "INT7"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ISR INT7 occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"ISR INT7 occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int htonl(int /*<<< orphan*/);
int /*<<< orphan*/ pciReadLong(unsigned short, int);
int IsVideoCard(unsigned short devbusfn) {
  int32_t pci_class = pciReadLong(devbusfn, 0x9);
  return (((htonl(pci_class) >> 8) & 0xf) == 0x03);
}


x86 assembly (clang, -O0):
<IsVideoCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x9,%esi
movzwl -0x2(%rbp),%edi
call   1040 <pciReadLong@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htonl@plt>
sar    $0x8,%eax
and    $0xf,%eax
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsVideoCard>:
push   %rax
mov    $0x9,%esi
call   1040 <pciReadLong@plt>
mov    %eax,%edi
call   1030 <htonl@plt>
and    $0xf00,%eax
xor    %ecx,%ecx
cmp    $0x300,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsVideoCard(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 @pciReadLong(i16 zeroext %4, i32 9)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @htonl(i32 %6)
%8 = ashr i32 %7, 8
%9 = and i32 %8, 15
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @IsVideoCard(i16 zeroext %0) {
%2 = tail call i32 @pciReadLong(i16 zeroext %0, i32 9)
%3 = tail call i32 @htonl(i32 %2)
%4 = and i32 %3, 3840
%5 = icmp eq i32 %4, 768
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int fremovexattr(int, char *);
int main(void) {
  int fd = 3;
  return fremovexattr(fd, "name");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xed0(%rip),%rsi
call   1030 <fremovexattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rsi
mov    $0x3,%edi
jmp    1030 <fremovexattr@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"name\00"
define i32 @main() {
%1 = tail call i32 @fremovexattr(i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
bool isdescending(int x, int y, int z) {
  if ((x > y) && (y > z)) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<isdescending>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1131 <isdescending+0x31>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1131 <isdescending+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <isdescending+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdescending>:
cmp    %esi,%edi
setg   %al
cmp    %edx,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isdescending(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp sgt i32 %1, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int f472(int *);
int f473(int *p) { return f472(p); }


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

x86 assembly (clang, -O2):
<f473>:
jmp    1030 <f472@plt>

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

LLVM IR (-O2):
define i32 @f473(i32* %0) {
%2 = tail call i32 @f472(i32* %0)
ret i32 %2
}
/* Variables and functions */
int strncmp(char *, char *, int);
int my_strvcmp(const void *L, const void *R) {
  return strncmp(*(char **)L, *(char **)R, 80);
}


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

x86 assembly (clang, -O2):
<my_strvcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    $0x50,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @my_strvcmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strncmp(i8* %7, i8* %10, i32 80)
ret i32 %11
}

LLVM IR (-O2):
define i32 @my_strvcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strncmp(i8* %4, i8* %6, i32 80)
ret i32 %7
}
void v2f_(vec) float vec[2];
{ vcall(vec, 2); }


x86 assembly (clang, -O0):
<v2f_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2f_>:
mov    $0x2,%esi
xor    %eax,%eax
jmp    1030 <vcall@plt>

LLVM IR (-O0):
define void @v2f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %3, i32 2)
ret void
}

LLVM IR (-O2):
define void @v2f_(float* %0) {
%2 = tail call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ acc_copyin(int *, int);
int /*<<< orphan*/ acc_present_or_copyin(int *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int i;
  acc_present_or_copyin(&i, sizeof i);
  fprintf(stderr, "CheCKpOInT\n");
  acc_copyin(&i, sizeof i);
  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)
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1050 <acc_present_or_copyin@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <acc_copyin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <acc_present_or_copyin@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <acc_copyin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @acc_present_or_copyin(i32* %6, i32 4)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @acc_copyin(i32* %6, i32 4)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @acc_present_or_copyin(i32* %3, i32 4)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @acc_copyin(i32* %3, i32 4)
ret i32 0
}
/* Variables and functions */
size_t resize_halfagain(size_t current, size_t requested,
                        void *UNUSED_data __attribute__((unused))) {
  if (current < 2)
    current = requested;
  while (current < requested)
    current += current / 2;
  return current;
}


x86 assembly (clang, -O0):
<resize_halfagain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x2,-0x8(%rbp)
jae    1123 <resize_halfagain+0x23>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <resize_halfagain+0x28>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114b <resize_halfagain+0x4b>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1128 <resize_halfagain+0x28>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize_halfagain>:
mov    %rdi,%rax
cmp    $0x2,%rdi
cmovb  %rsi,%rax
cmp    %rsi,%rax
jae    111e <resize_halfagain+0x1e>
mov    %rax,%rcx
shr    %rcx
add    %rcx,%rax
cmp    %rsi,%rax
jb     1110 <resize_halfagain+0x10>
ret

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

LLVM IR (-O2):
define i64 @resize_halfagain(i64 %0, i64 %1, i8* nocapture readnone %2) {
%4 = icmp ult i64 %0, 2
%5 = select i1 %4, i64 %1, i64 %0
%6 = icmp ult i64 %5, %1
br i1 %6, label %7, label %12
7: ; preds = %3, %7
%8 = phi i64 [ %10, %7 ], [ %5, %3 ]
%9 = lshr i64 %8, 1
%10 = add i64 %9, %8
%11 = icmp ult i64 %10, %1
br i1 %11, label %7, label %12
12: ; preds = %7, %3
%13 = phi i64 [ %5, %3 ], [ %10, %7 ]
ret i64 %13
}
long long plugin_compiled_version(void) {
  return 0 * 100000000 + 0 * 100000 + 1;
}


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

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

LLVM IR (-O0):
define i64 @plugin_compiled_version() {
ret i64 1
}

LLVM IR (-O2):
define i64 @plugin_compiled_version() {
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double a, b;
  scanf("%lf %lf", &a, &b);
  printf("MEDIA = %.5lf\n", (a * 3.5 + b * 7.5) / 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
mulsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fmul double %6, 7.500000e+00
%8 = call double @llvm.fmuladd.f64(double %5, double 3.500000e+00, double %7)
%9 = fdiv double %8, 1.100000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [15 x i8] c"MEDIA = %.5lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %7, 7.500000e+00
%9 = call double @llvm.fmuladd.f64(double %6, double 3.500000e+00, double %8)
%10 = fdiv double %9, 1.100000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
/* Type definitions */
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
int CHAR_MAX;
int _Locale_n_cs_precedes(struct _Locale_monetary *lmon
                          __attribute__((__unused__))) {
  return CHAR_MAX;
}


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

x86 assembly (clang, -O2):
<_Locale_n_cs_precedes>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
@CHAR_MAX = global i32 0
define i32 @_Locale_n_cs_precedes(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
%3 = load i32, i32* @CHAR_MAX
ret i32 %3
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
@CHAR_MAX = global i32 0
define i32 @_Locale_n_cs_precedes(%struct._Locale_monetary* nocapture readnone %0) {
%2 = load i32, i32* @CHAR_MAX
ret i32 %2
}
void scale_pulse_freq(int *pulse_state, int *counter, const int counter_max) {
  if (*counter >= counter_max) {
    *pulse_state = 1;
    *counter = 0;
  } else {
    *pulse_state = 0;
    *counter = *counter + 1;
  }
  return;
}


x86 assembly (clang, -O0):
<scale_pulse_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jl     1137 <scale_pulse_freq+0x37>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1150 <scale_pulse_freq+0x50>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_pulse_freq>:
cmp    %edx,(%rsi)
jge    1112 <scale_pulse_freq+0x12>
movl   $0x0,(%rdi)
mov    (%rsi),%eax
add    $0x1,%eax
mov    %eax,(%rsi)
ret
movl   $0x1,(%rdi)
xor    %eax,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @scale_pulse_freq(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, %2
br i1 %5, label %7, label %6
6: ; preds = %3
store i32 1, i32* %0
br label %10
7: ; preds = %3
store i32 0, i32* %0
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ %9, %7 ], [ 0, %6 ]
store i32 %11, i32* %1
ret void
}
/* Variables and functions */
int _InterlockedDecrement(int volatile *);
int test_InterlockedDecrement(int volatile *Addend) {
  return _InterlockedDecrement(Addend);
}


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

x86 assembly (clang, -O2):
<test_InterlockedDecrement>:
jmp    1030 <_InterlockedDecrement@plt>

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

LLVM IR (-O2):
define i32 @test_InterlockedDecrement(i32* %0) {
%2 = tail call i32 @_InterlockedDecrement(i32* %0)
ret i32 %2
}
unsigned bi_reverse(unsigned code, int len) {
  unsigned res = 0;
  do {
    res |= code & 1;
    code >>= 1;
    res <<= 1;
  } while (--len > 0);
  return res >> 1;
}


x86 assembly (clang, -O0):
<bi_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jg     1111 <bi_reverse+0x11>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bi_reverse>:
add    $0x1,%esi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
and    $0x1,%eax
or     %ecx,%eax
shr    %edi
lea    (%rax,%rax,1),%ecx
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <bi_reverse+0x10>
and    $0x7fffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bi_reverse(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %9, %3 ]
%5 = phi i32 [ %1, %2 ], [ %11, %3 ]
%6 = phi i32 [ 0, %2 ], [ %10, %3 ]
%7 = and i32 %4, 1
%8 = or i32 %6, %7
%9 = lshr i32 %4, 1
%10 = shl i32 %8, 1
%11 = add nsw i32 %5, -1
%12 = icmp sgt i32 %5, 1
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = and i32 %8, 2147483647
ret i32 %14
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double randf(double min, double max) {
  return ((double)rand() / (double)RAND_MAX) * (max - min) + min;
}


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm2
mov    0x2eb5(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %9, double %12, double %13)
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randf(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = fsub double %1, %0
%9 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %0)
ret double %9
}
/* Variables and functions */
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ setuid(int);
int main(int argc, char *argv[]) {
  printf("uid:%d, euid:%d\n", getuid(), geteuid());
  setuid(1000);
  printf("uid:%d, euid:%d\n", getuid(), geteuid());
  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)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3e8,%edi
call   1060 <setuid@plt>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xea5(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x3e8,%edi
call   1060 <setuid@plt>
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"uid:%d, euid:%d\0A\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 = call i32 (...) @getuid()
%7 = call i32 (...) @geteuid()
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @setuid(i32 1000)
%10 = call i32 (...) @getuid()
%11 = call i32 (...) @geteuid()
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"uid:%d, euid:%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 (...) @geteuid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = tail call i32 @setuid(i32 1000)
%7 = tail call i32 (...) @getuid()
%8 = tail call i32 (...) @geteuid()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aiger_default_free(void *state, void *ptr, size_t bytes) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @aiger_default_free(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @free(i8* %1)
ret void
}
const char *slirp_version_string(void) { return "4.2.0-git"; }


x86 assembly (clang, -O0):
<slirp_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"4.2.0-git\00"
define i8* @slirp_version_string() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"4.2.0-git\00"
define i8* @slirp_version_string() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *getFromBuffer(char *, char const *, int, int *, char *);
char *getFromSetup(char *pContentPtr, const char *pField, int *pReturnSize) {
  return getFromBuffer(pContentPtr, pField, 1, pReturnSize, ";\r\n");
}


x86 assembly (clang, -O0):
<getFromSetup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
lea    0xec4(%rip),%r8
call   1030 <getFromBuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFromSetup>:
mov    %rdx,%rcx
lea    0xee6(%rip),%r8
mov    $0x1,%edx
jmp    1030 <getFromBuffer@plt>

LLVM IR (-O0):
@.str = [4 x i8] c";\0D\0A\00"
define i8* @getFromSetup(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i8* @getFromBuffer(i8* %7, i8* %8, i32 1, i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c";\0D\0A\00"
define i8* @getFromSetup(i8* %0, i8* %1, i32* %2) {
%4 = tail call i8* @getFromBuffer(i8* %0, i8* %1, i32 1, i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quit();
void sigint() {
  printf("\r\nInterrupted\r\n");
  quit();
}


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <quit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <quit@plt>

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

LLVM IR (-O2):
@str = [15 x i8] c"\0D\0AInterrupted\0D\00"
define void @sigint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @quit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prompt_next(void) { printf("\nType **next to continue\n"); }


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"\0AType **next to continue\00"
define void @prompt_next() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct s_ring_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_ring_buffer_xin(struct s_ring_buffer *, char const *);
void s_ring_buffer_in(struct s_ring_buffer *rb, const char *from,
                      unsigned int len) {
  int i;
  for (i = 0; i < len; i++) {
    s_ring_buffer_xin(rb, &from[i]);
  }
}


x86 assembly (clang, -O0):
<s_ring_buffer_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1158 <s_ring_buffer_in+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
call   1030 <s_ring_buffer_xin@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <s_ring_buffer_in+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_ring_buffer_in>:
push   %r15
push   %r14
push   %rbx
test   %edx,%edx
je     1145 <s_ring_buffer_in+0x35>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %edx,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <s_ring_buffer_xin@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <s_ring_buffer_in+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.s_ring_buffer = type { i32 }
define void @s_ring_buffer_in(%struct.s_ring_buffer* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = tail call i32 @s_ring_buffer_xin(%struct.s_ring_buffer* %0, i8* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
void adis16080_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @adis16080_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
/* Variables and functions */
int mem_get_le16_as_int(unsigned char const *);
signed int mem_get_sle16_as_int(const void *vmem) {
  const unsigned char *mem = (const unsigned char *)vmem;
  signed int val = mem_get_le16_as_int(mem);
  return (val << ((sizeof(int) << 3) - 16)) >> ((sizeof(int) << 3) - 16);
}


x86 assembly (clang, -O0):
<mem_get_sle16_as_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mem_get_le16_as_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x10,%eax
sar    $0x10,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_get_sle16_as_int>:
push   %rax
call   1030 <mem_get_le16_as_int@plt>
cwtl
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mem_get_sle16_as_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mem_get_le16_as_int(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
ret i32 %10
}

LLVM IR (-O2):
define i32 @mem_get_sle16_as_int(i8* %0) {
%2 = tail call i32 @mem_get_le16_as_int(i8* %0)
%3 = shl i32 %2, 16
%4 = ashr exact i32 %3, 16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int n1 = 10;
  int n2 = 20;
  printf("n1=%d n2=%d\n", n1, n2);
  swap(&n1, &n2);
  printf("n1=%d n2=%d\n", n1, n2);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x14,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"n1=%d n2=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    fib(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1170 <main+0x50>
lea    0xea6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <fib@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1030 <scanf@plt>
subl   $0x1,(%rsp)
jb     116a <main+0x4a>
lea    0xec0(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fib@plt>
subl   $0x1,(%rsp)
jae    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp eq i32 %5, 0
br i1 %7, label %17, label %8
8: ; preds = %0
%9 = bitcast i32* %2 to i8*
br label %10
10: ; preds = %8, %10
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = call i32 @fib(i32 %12)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, -1
store i32 %15, i32* %1
%16 = icmp eq i32 %14, 0
br i1 %16, label %17, label %10
17: ; preds = %10, %0
ret i32 0
}