xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl(const uint64_t s, int k) { return (s << k) | (s >> (64 - k)); }


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse();
int main() {
  reverse();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <reverse@plt>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <reverse@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @reverse()
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
int nestedIterNext(struct NestedIterator *iter) {}


x86 assembly (clang, -O0):
<nestedIterNext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.NestedIterator = type opaque
define i32 @nestedIterNext(%struct.NestedIterator* %0) {
%2 = alloca i32
%3 = alloca %struct.NestedIterator*
store %struct.NestedIterator* %0, %struct.NestedIterator** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.NestedIterator = type opaque
define i32 @nestedIterNext(%struct.NestedIterator* nocapture readnone %0) {
ret i32 undef
}
unsigned int distorm_version() { return 0x01071e; }


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

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

LLVM IR (-O0):
define i32 @distorm_version() {
ret i32 67358
}

LLVM IR (-O2):
define i32 @distorm_version() {
ret i32 67358
}
void XInstallColormap() {}


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

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

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

LLVM IR (-O2):
define void @XInstallColormap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void pragma(char *msg) { printf("Pragma: %s\n", msg); }


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

x86 assembly (clang, -O2):
<pragma>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Pragma: %s\0A\00"
define void @pragma(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void File_Close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<File_Close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @File_Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t raw_write_bytes(void *id, void *data, int32_t bcount) { return 0; }


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

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

LLVM IR (-O0):
define i32 @raw_write_bytes(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
ret i32 0
}

LLVM IR (-O2):
define i32 @raw_write_bytes(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int sodium_init(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @sodium_init() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @sodium_init() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write_ble8(void *, int /*<<< orphan*/);
void write_be8(void *dest, uint8_t val) { write_ble8(dest, val); }


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

x86 assembly (clang, -O2):
<write_be8>:
jmp    1030 <write_ble8@plt>

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

LLVM IR (-O2):
define void @write_be8(i8* %0, i32 %1) {
%3 = tail call i32 @write_ble8(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int medusaDataReadyWritingTimed(int, int, int /*<<< orphan*/);
int medusaDataReadyWriting(int socket) {
  return (medusaDataReadyWritingTimed(socket, 30, 0));
}


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

x86 assembly (clang, -O2):
<medusaDataReadyWriting>:
mov    $0x1e,%esi
xor    %edx,%edx
jmp    1030 <medusaDataReadyWritingTimed@plt>

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

LLVM IR (-O2):
define i32 @medusaDataReadyWriting(i32 %0) {
%2 = tail call i32 @medusaDataReadyWritingTimed(i32 %0, i32 30, i32 0)
ret i32 %2
}
/* Variables and functions */
float __ocml_cos_f32(float);
float cosf(float x) { return __ocml_cos_f32(x); }


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

x86 assembly (clang, -O2):
<cosf>:
jmp    1030 <__ocml_cos_f32@plt>

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

LLVM IR (-O2):
define float @cosf(float %0) {
%2 = tail call float @__ocml_cos_f32(float %0)
ret float %2
}
int valid_year(int y) { return (y >= 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<valid_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_year>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @valid_year(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Type definitions */
struct task_struct {
  int dummy;
};
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
__u64 delayacct_blkio_ticks(struct task_struct *tsk) { return 0; }


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

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

LLVM IR (-O0):
%struct.task_struct = type { i32 }
define i32 @delayacct_blkio_ticks(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret i32 0
}

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define i32 @delayacct_blkio_ticks(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
scalar_t__ isEmptyDynArr(struct DynArr *);
double log(double);
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void naturalln(struct DynArr *stack) {
  double a, c;
  if (isEmptyDynArr(stack))
    return;
  a = topDynArr(stack);
  popDynArr(stack);
  c = log(a);
  pushDynArr(stack, c);
}


x86 assembly (clang, -O0):
<naturalln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isEmptyDynArr@plt>
cmp    $0x0,%rax
je     1174 <naturalln+0x24>
jmp    11a8 <naturalln+0x58>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1070 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalln>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <isEmptyDynArr@plt>
test   %rax,%rax
je     1168 <naturalln+0x18>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <log@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1070 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @naturalln(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call i64 @isEmptyDynArr(%struct.DynArr* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %19
9: ; preds = %1
%10 = load %struct.DynArr*, %struct.DynArr** %2
%11 = call double @topDynArr(%struct.DynArr* %10)
store double %11, double* %3
%12 = load %struct.DynArr*, %struct.DynArr** %2
%13 = call i32 @popDynArr(%struct.DynArr* %12)
%14 = load double, double* %3
%15 = call double @log(double %14)
store double %15, double* %4
%16 = load %struct.DynArr*, %struct.DynArr** %2
%17 = load double, double* %4
%18 = call i32 @pushDynArr(%struct.DynArr* %16, double %17)
br label %19
19: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @naturalln(%struct.DynArr* %0) {
%2 = tail call i64 @isEmptyDynArr(%struct.DynArr* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call double @topDynArr(%struct.DynArr* %0)
%6 = tail call i32 @popDynArr(%struct.DynArr* %0)
%7 = tail call double @log(double %5)
%8 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %7)
br label %9
9: ; preds = %1, %4
ret void
}
void remove_temp(home_directory) {
  char command_string[256 + 20];
  strcpy(command_string, home_directory);
  strcat(command_string, "/panama.temp");
  unlink(command_string);
}


x86 assembly (clang, -O0):
<remove_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x120(%rbp),%rdi
movslq -0x4(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x120(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x120(%rbp),%rdi
mov    $0x0,%al
call   1030 <unlink@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_temp>:
push   %rbx
sub    $0x120,%rsp
movslq %edi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
movabs $0x2e616d616e61702f,%rcx
6d 61 2e
mov    %rcx,(%rsp,%rax,1)
movabs $0x706d65742e616d,%rcx
mov    %rcx,0x5(%rsp,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <unlink@plt>
add    $0x120,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/panama.temp\00"
define void @remove_temp(i32 %0) {
%2 = alloca i32
%3 = alloca [276 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [276 x i8], [276 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = call i8* @strcpy(i8* %4, i8* %7)
%9 = getelementptr inbounds [276 x i8], [276 x i8]* %3, i64 0, i64 0
%10 = call i8* @strcat(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [276 x i8], [276 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/panama.temp\00"
define void @remove_temp(i32 %0) {
%2 = alloca [276 x i8]
%3 = getelementptr inbounds [276 x i8], [276 x i8]* %2, i64 0, i64 0
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i8* @strcpy(i8* %3, i8* dereferenceable(1) %5)
%7 = call i64 @strlen(i8* %3)
%8 = getelementptr [276 x i8], [276 x i8]* %2, i64 0, i64 %7
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %3)
ret void
}
OP(fd, f0) {
  illegal_1();
  op_f0();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_f0()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f0()
ret i32 undef
}
int GLimp_Init(void *hinstance, void *hWnd) {}


x86 assembly (clang, -O0):
<GLimp_Init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @GLimp_Init(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ irqDisable();
int DisableInterrupts() {
  irqDisable();
  return 0;
}


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

x86 assembly (clang, -O2):
<DisableInterrupts>:
push   %rax
xor    %eax,%eax
call   1030 <irqDisable@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DisableInterrupts() {
%1 = call i32 (...) @irqDisable()
ret i32 0
}

LLVM IR (-O2):
define i32 @DisableInterrupts() {
%1 = tail call i32 (...) @irqDisable()
ret i32 0
}
int fun675() { return 675; }


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

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

LLVM IR (-O0):
define i32 @fun675() {
ret i32 675
}

LLVM IR (-O2):
define i32 @fun675() {
ret i32 675
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error() {
  fprintf(stderr, "Error with param !\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Error with param !\0A\00"
@EXIT_FAILURE = global i32 0
define void @error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Error with param !\0A\00"
@EXIT_FAILURE = global i32 0
define void @error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEif_icmpgt(int, int /*<<< orphan*/ *);
void code_if_icmpgt(int label) { appendCODE(makeCODEif_icmpgt(label, NULL)); }


x86 assembly (clang, -O0):
<code_if_icmpgt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <makeCODEif_icmpgt@plt>
mov    %eax,%edi
call   1030 <appendCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_if_icmpgt>:
push   %rax
xor    %esi,%esi
call   1040 <makeCODEif_icmpgt@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <appendCODE@plt>

LLVM IR (-O0):
define void @code_if_icmpgt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @makeCODEif_icmpgt(i32 %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_if_icmpgt(i32 %0) {
%2 = tail call i32 @makeCODEif_icmpgt(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
/* Type definitions */
typedef char *uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t rdtsc(void) {
  union {
    uint64_t tsc_64;
    struct {
      uint32_t lo_32;
      uint32_t hi_32;
    } t32;
  } tsc;
  asm volatile("rdtsc" : "=a"(tsc.t32.lo_32), "=d"(tsc.t32.hi_32));
  return tsc.tsc_64;
}


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

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
%union.anon = type { i8* }
%struct.anon = type { i32, i32 }
define i8* @rdtsc() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to %struct.anon*
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%4 = bitcast %union.anon* %1 to %struct.anon*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %4, i32 0, i32 1
%6 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %5
%9 = bitcast %union.anon* %1 to i8**
%10 = load i8*, i8** %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]... SOURCE DEST\n    or: %s [OPTION]... SOURCE... "
         "DIRECTORY\n\n    Rename SOURCE to DEST, or move SOURCE(s) to "
         "DIRECTORY.\n\nOptions:\n    -f, --force\t\tdo not prompt before "
         "overwriting\n    -i, --interactive\tprompt before overwrite\n    -h, "
         "--help\t\tdisplay this help\n    -V, --version\tdisplay version "
         "information\n\nReport bugs to <bulliver@gmail.com>\n",
         "mv", "mv");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x104b(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [361 x i8] c"Usage: %s [OPTION]... SOURCE DEST\0A or: %s [OPTION]... SOURCE... DIRECTORY\0A\0A Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\0A\0AOptions:\0A -f, --force\09\09do not prompt before overwriting\0A -i, --interactive\09prompt before overwrite\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"mv\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [361 x i8] c"Usage: %s [OPTION]... SOURCE DEST\0A or: %s [OPTION]... SOURCE... DIRECTORY\0A\0A Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\0A\0AOptions:\0A -f, --force\09\09do not prompt before overwriting\0A -i, --interactive\09prompt before overwrite\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"mv\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int __attribute((annotate("foo"))) foo(void) { return 0; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp_voet_zj/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (i32 ()* @foo to i8*), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define i32 @foo() {
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp_voet_zj/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (i32 ()* @foo to i8*), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define i32 @foo() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t gcd(uint64_t a, uint64_t b) {
  while (b) {
    uint64_t t = b;
    b = a % b;
    a = t;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
const char *addrToStr(int addr) {
  static char buffer[3 + 1 + 3 + 1 + 3 + 1 + 3];
  sprintf(buffer, "%d.%d.%d.%d", 0xFF & (addr >> 3 * 8), 0xFF & (addr >> 2 * 8),
          0xFF & (addr >> 8), 0xFF & (addr));
  return buffer;
}


x86 assembly (clang, -O0):
<addrToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
sar    $0x18,%edx
and    $0xff,%edx
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%r8d
sar    $0x8,%r8d
and    $0xff,%r8d
mov    -0x4(%rbp),%r9d
and    $0xff,%r9d
lea    0x2ed5(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ec2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addrToStr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%edx
mov    %edi,%eax
movzbl %dh,%ebp
movzbl %dl,%r9d
shr    $0x18,%edx
shr    $0x10,%eax
movzbl %al,%ecx
lea    0x2efb(%rip),%rbx
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@addrToStr.buffer = internal global [15 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @addrToStr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 255, %4
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = and i32 255, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 255, %10
%12 = load i32, i32* %2
%13 = and i32 255, %12
%14 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @addrToStr.buffer, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i32 %11, i32 %13)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @addrToStr.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@addrToStr.buffer = internal global [15 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @addrToStr(i32 %0) {
%2 = lshr i32 %0, 24
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = and i32 %0, 255
%8 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @addrToStr.buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %7)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @addrToStr.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printname_html(void *udata, const char *name) {
  printf(" <tr>\n");
  printf("  <td><b>%s</b></td>\n", name);
  printf("  <td><b>:</b> ");
}


x86 assembly (clang, -O0):
<printname_html>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printname_html>:
push   %rbx
mov    %rsi,%rbx
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" <tr>\0A\00"
@.str.1 = [22 x i8] c" <td><b>%s</b></td>\0A\00"
@.str.2 = [16 x i8] c" <td><b>:</b> \00"
define void @printname_html(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c" <td><b>%s</b></td>\0A\00"
@.str.2 = [16 x i8] c" <td><b>:</b> \00"
@str = [6 x i8] c" <tr>\00"
define void @printname_html(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int EMACPHYRead(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ EMACPHYWrite(int, int /*<<< orphan*/, int, int);
uint16_t EMACPHYExtendedRead(uint32_t ui32Base, uint8_t ui8PhyAddr,
                             uint16_t ui16RegAddr) {
  ;
  ;
  EMACPHYWrite(0x400EC000, ui8PhyAddr, 0x0000000D, 0x001F);
  EMACPHYWrite(0x400EC000, ui8PhyAddr, 0x0000000E, ui16RegAddr);
  EMACPHYWrite(0x400EC000, ui8PhyAddr, 0x0000000D, 0x401F);
  return (EMACPHYRead(0x400EC000, ui8PhyAddr, 0x0000000E));
}


x86 assembly (clang, -O0):
<EMACPHYExtendedRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x400ec000,%edi
mov    $0xd,%edx
mov    $0x1f,%ecx
call   1040 <EMACPHYWrite@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    $0x400ec000,%edi
mov    $0xe,%edx
call   1040 <EMACPHYWrite@plt>
mov    -0x8(%rbp),%esi
mov    $0x400ec000,%edi
mov    $0xd,%edx
mov    $0x401f,%ecx
call   1040 <EMACPHYWrite@plt>
mov    -0x8(%rbp),%esi
mov    $0x400ec000,%edi
mov    $0xe,%edx
call   1030 <EMACPHYRead@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACPHYExtendedRead>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    $0x400ec000,%edi
mov    $0xd,%edx
mov    $0x1f,%ecx
call   1040 <EMACPHYWrite@plt>
mov    $0x400ec000,%edi
mov    %ebp,%esi
mov    $0xe,%edx
mov    %ebx,%ecx
call   1040 <EMACPHYWrite@plt>
mov    $0x400ec000,%edi
mov    %ebp,%esi
mov    $0xd,%edx
mov    $0x401f,%ecx
call   1040 <EMACPHYWrite@plt>
mov    $0x400ec000,%edi
mov    %ebp,%esi
mov    $0xe,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <EMACPHYRead@plt>

LLVM IR (-O0):
define i32 @EMACPHYExtendedRead(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 = call i32 @EMACPHYWrite(i32 1074708480, i32 %7, i32 13, i32 31)
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @EMACPHYWrite(i32 1074708480, i32 %9, i32 14, i32 %10)
%12 = load i32, i32* %5
%13 = call i32 @EMACPHYWrite(i32 1074708480, i32 %12, i32 13, i32 16415)
%14 = load i32, i32* %5
%15 = call i32 @EMACPHYRead(i32 1074708480, i32 %14, i32 14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @EMACPHYExtendedRead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @EMACPHYWrite(i32 1074708480, i32 %1, i32 13, i32 31)
%5 = tail call i32 @EMACPHYWrite(i32 1074708480, i32 %1, i32 14, i32 %2)
%6 = tail call i32 @EMACPHYWrite(i32 1074708480, i32 %1, i32 13, i32 16415)
%7 = tail call i32 @EMACPHYRead(i32 1074708480, i32 %1, i32 14)
ret i32 %7
}
/* Variables and functions */
unsigned int getrandom(int /*<<< orphan*/, int);
unsigned int get_dport(void) {
  unsigned int k, dport[8] = {21, 22, 25, 80, 135, 443, 8000, 22345};
  k = getrandom(0, 7);
  return (dport[k]);
}


x86 assembly (clang, -O0):
<get_dport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
mov    $0x7,%esi
call   1030 <getrandom@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x30(%rbp,%rax,4),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dport>:
push   %rax
xor    %edi,%edi
mov    $0x7,%esi
call   1030 <getrandom@plt>
mov    %eax,%eax
lea    0xeda(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.get_dport.dport = [8 x i32] [i32 21, i32 22, i32 25, i32 80, i32 135, i32 443, i32 8000, i32 22345]
define i32 @get_dport() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = call i32 @getrandom(i32 0, i32 7)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
@__const.get_dport.dport = [8 x i32] [i32 21, i32 22, i32 25, i32 80, i32 135, i32 443, i32 8000, i32 22345]
define i32 @get_dport() {
%1 = tail call i32 @getrandom(i32 0, i32 7)
%2 = zext i32 %1 to i64
%3 = getelementptr inbounds [8 x i32], [8 x i32]* @__const.get_dport.dport, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
unsigned int GET32(const unsigned int addr) {
  return *(volatile unsigned int *)addr;
}


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

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

LLVM IR (-O0):
define i32 @GET32(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 = load volatile i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @GET32(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
int32_t get_32bitBE(uint8_t *p) {
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]);
}


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

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

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

LLVM IR (-O2):
define i32 @get_32bitBE(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
unsigned f4(unsigned x, unsigned char y) {
  y &= 8 * 4 - 1;
  return (x << y) | (x >> (-y & (8 * 4 - 1)));
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
and    $0x1f,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
movzbl -0x5(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
movzbl -0x5(%rbp),%esi
xor    %ecx,%ecx
sub    %esi,%ecx
and    $0x1f,%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f4(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 31
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i32, i32* %3
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = shl i32 %9, %11
%13 = load i32, i32* %3
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = sub nsw i32 0, %15
%17 = and i32 %16, 31
%18 = lshr i32 %13, %17
%19 = or i32 %12, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %3)
ret i32 %4
}
void fds_init(void) {}


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

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

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

LLVM IR (-O2):
define void @fds_init() {
ret void
}
char modulo(char x, char y, int p) {
  y = -10;
  if (p)
    x = 0;
  else
    x = 100;
  while (x >= y) {
    x = x - y;
  }
  return x;
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
movb   $0xf6,-0x2(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <modulo+0x2a>
movb   $0x0,-0x1(%rbp)
jmp    112e <modulo+0x2e>
movb   $0x64,-0x1(%rbp)
jmp    1133 <modulo+0x33>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jl     1155 <modulo+0x55>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    1133 <modulo+0x33>
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
test   %edx,%edx
mov    $0x5a,%ecx
mov    $0xf6,%eax
cmove  %ecx,%eax
nop
add    $0xa,%al
cmp    $0xf5,%al
jg     1110 <modulo+0x10>
ret

LLVM IR (-O0):
define signext i8 @modulo(i8 signext %0, i8 signext %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
store i8 -10, i8* %5
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
store i8 0, i8* %4
br label %11
10: ; preds = %3
store i8 100, i8* %4
br label %11
11: ; preds = %10, %9
br label %12
12: ; preds = %18, %11
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %14, %16
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %20, %22
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
br label %12
25: ; preds = %12
%26 = load i8, i8* %4
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @modulo(i8 signext %0, i8 signext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i8 100, i8 0
br label %6
6: ; preds = %6, %3
%7 = phi i8 [ %5, %3 ], [ %9, %6 ]
%8 = icmp sgt i8 %7, -11
%9 = add nuw i8 %7, 10
br i1 %8, label %6, label %10
10: ; preds = %6
ret i8 %7
}
void ColLibDefaultSignalHandler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @ColLibDefaultSignalHandler(i32 %0) {
ret void
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ strncmp(int /*<<< orphan*/, char *, int);
int dir_filter_tty(const struct dirent *d) {
  return strncmp(d->d_name, "tty", 3) == 0;
}


x86 assembly (clang, -O0):
<dir_filter_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_filter_tty>:
push   %rax
mov    (%rdi),%edi
lea    0xee6(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [4 x i8] c"tty\00"
define i32 @dir_filter_tty(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @strncmp(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [4 x i8] c"tty\00"
define i32 @dir_filter_tty(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @strncmp(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void wait_for_a_short_time(int cycles) {
  do {
    cycles--;
  } while (cycles >= 0);
}


x86 assembly (clang, -O0):
<wait_for_a_short_time>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1107 <wait_for_a_short_time+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @wait_for_a_short_time(i32 %0) {
ret void
}
void XShmPutImage() {}


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

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

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

LLVM IR (-O2):
define void @XShmPutImage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matNd_mult_vecNd_new(double *, double const *,
                                        double const *, int);
void mat4d_mult_vec4d_new(double result[4], const double m[16],
                          const double v[4]) {
  matNd_mult_vecNd_new(result, m, v, 4);
}


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

x86 assembly (clang, -O2):
<mat4d_mult_vec4d_new>:
mov    $0x4,%ecx
jmp    1030 <matNd_mult_vecNd_new@plt>

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

LLVM IR (-O2):
define void @mat4d_mult_vec4d_new(double* %0, double* %1, double* %2) {
%4 = tail call i32 @matNd_mult_vecNd_new(double* %0, double* %1, double* %2, i32 4)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t compress(uint32_t a) {
  a = (a | (a >> 1)) & 0x33333333;
  a = (a | (a >> 2)) & 0x0f0f0f0f;
  a = (a | (a >> 4)) & 0x00ff00ff;
  a = (a | (a >> 8)) & 0x0000ffff;
  return a >> 3;
}


x86 assembly (clang, -O0):
<compress>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
or     %ecx,%eax
and    $0x33333333,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
or     %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
and    $0xff00ff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compress>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
and    $0x33333333,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
and    $0xf0f0f0f,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
and    $0xf8,%eax
or     %ecx,%eax
shr    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @compress(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 1
%6 = or i32 %3, %5
%7 = and i32 %6, 858993459
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = or i32 %8, %10
%12 = and i32 %11, 252645135
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = ashr i32 %14, 4
%16 = or i32 %13, %15
%17 = and i32 %16, 16711935
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 8
%21 = or i32 %18, %20
%22 = and i32 %21, 65535
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 3
ret i32 %24
}

LLVM IR (-O2):
define i32 @compress(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = and i32 %3, 858993459
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = and i32 %6, 252645135
%8 = lshr i32 %7, 4
%9 = or i32 %8, %7
%10 = lshr i32 %9, 8
%11 = and i32 %10, 65280
%12 = and i32 %9, 248
%13 = or i32 %11, %12
%14 = lshr exact i32 %13, 3
ret i32 %14
}
int ShrTest7(int X) { return X >> 0; }


x86 assembly (clang, -O0):
<ShrTest7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ShrTest7(i32 returned %0) {
ret i32 %0
}