xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void test4(int a4, char b, char c, char d, char e, char f, char g, char h) {
  char *p = (char *)&a4;
  p++;
  p++;
  p++;
  p++;
  bar(p);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x28(%rbp)
mov    %ecx,%eax
mov    -0x28(%rbp),%ecx
mov    %eax,-0x24(%rbp)
mov    %edx,%eax
mov    -0x24(%rbp),%edx
mov    %eax,-0x20(%rbp)
mov    %esi,%eax
mov    -0x20(%rbp),%esi
mov    %eax,-0x1c(%rbp)
mov    %edi,%r8d
mov    -0x1c(%rbp),%edi
mov    %r9b,%al
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8d,-0x4(%rbp)
mov    %dil,-0x5(%rbp)
mov    %sil,-0x6(%rbp)
mov    %dl,-0x7(%rbp)
mov    %cl,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <bar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test4(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i32
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
%17 = alloca i8*
store i32 %0, i32* %9
store i8 %1, i8* %10
store i8 %2, i8* %11
store i8 %3, i8* %12
store i8 %4, i8* %13
store i8 %5, i8* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
%18 = bitcast i32* %9 to i8*
store i8* %18, i8** %17
%19 = load i8*, i8** %17
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %17
%21 = load i8*, i8** %17
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %17
%23 = load i8*, i8** %17
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %17
%25 = load i8*, i8** %17
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %17
%27 = load i8*, i8** %17
%28 = call i32 @bar(i8* %27)
ret void
}

LLVM IR (-O2):
define void @test4(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i32
store i32 %0, i32* %9
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = bitcast i32* %10 to i8*
%12 = call i32 @bar(i8* %11)
ret void
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_logoff(struct wpa_ctrl *ctrl, int argc, const char *argv[]) {
  return wpa_ctrl_command(ctrl, "LOGOFF");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_logoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_logoff>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [7 x i8] c"LOGOFF\00"
define i32 @wpa_cli_cmd_logoff(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [7 x i8] c"LOGOFF\00"
define i32 @wpa_cli_cmd_logoff(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
int mapfilter_check(struct FilterInfo *filter,
                    const struct EthFrameInfo *ethframe) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.FilterInfo = type opaque
%struct.EthFrameInfo = type opaque
define i32 @mapfilter_check(%struct.FilterInfo* %0, %struct.EthFrameInfo* %1) {
%3 = alloca %struct.FilterInfo*
%4 = alloca %struct.EthFrameInfo*
store %struct.FilterInfo* %0, %struct.FilterInfo** %3
store %struct.EthFrameInfo* %1, %struct.EthFrameInfo** %4
ret i32 0
}

LLVM IR (-O2):
%struct.FilterInfo = type opaque
%struct.EthFrameInfo = type opaque
define i32 @mapfilter_check(%struct.FilterInfo* nocapture readnone %0, %struct.EthFrameInfo* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEgoto(int, int /*<<< orphan*/ *);
void code_goto(int label) { appendCODE(makeCODEgoto(label, NULL)); }


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

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

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

LLVM IR (-O2):
define void @code_goto(i32 %0) {
%2 = tail call i32 @makeCODEgoto(i32 %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cov_spec_log(double, int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  float a[3] = {2.1, 2.2, 2.3};
  double b = 3;
  double c = a[1] + b;
  cov_spec_log(c, 0, argv[1]);
  printf("%1.15e\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x14(%rbp)
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %edi,%edi
call   1040 <cov_spec_log@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rsi
movsd  0xed3(%rip),%xmm0
xor    %edi,%edi
call   1040 <cov_spec_log@plt>
lea    0xecd(%rip),%rdi
movsd  0xebd(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [3 x float] [float 0x4000CCCCC0000000, float 0x40019999A0000000, float 0x4002666660000000]
@.str = [8 x i8] c"%1.15e\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x float]
%7 = alloca double
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [3 x float]* %6 to i8*
store double 3.000000e+00, double* %7
%10 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 1
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = load double, double* %7
%14 = fadd double %12, %13
store double %14, double* %8
%15 = load double, double* %8
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @cov_spec_log(double %15, i32 0, i8* %18)
%20 = load double, double* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%1.15e\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @cov_spec_log(double 0x4014CCCCD0000000, i32 0, i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x4014CCCCD0000000)
ret i32 0
}
/* Variables and functions */
int bcmp(char *, char *, int);
int f(char *p, char *q, int i) { return bcmp(p, q, i); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <bcmp@plt>

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

LLVM IR (-O2):
define i32 @f(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double mply(double a, double b) {
  printf("inside mply function \n");
  return a * b;
}


x86 assembly (clang, -O0):
<mply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mply>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"inside mply function \0A\00"
define double @mply(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
@str = [22 x i8] c"inside mply function \00"
define double @mply(double %0, double %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = fmul double %0, %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M110_f(char *s) {
  debug("M110_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M110_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M110_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M110_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M110_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M110_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M110_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
XGetErrorText() {}


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

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

LLVM IR (-O0):
define i32 @XGetErrorText() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetErrorText() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_open_try(char *file_name, char *mode) {
  FILE *fp;
  fp = fopen(file_name, mode);
  if (NULL == fp) {
    return -1;
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<file_open_try>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    1159 <file_open_try+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <file_open_try+0x49>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_open_try>:
push   %rax
call   1040 <fopen@plt>
test   %rax,%rax
je     1137 <file_open_try+0x17>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @file_open_try(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fclose(i32* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float atof(char *);
int /*<<< orphan*/ free(char *);
char *gdp_files_getstring(int /*<<< orphan*/ *, char *);
double gdp_files_getfloat(FILE *fFile, char *cParameter) {
  char *charToInt = " ";
  float nRet = 0;
  charToInt = gdp_files_getstring(fFile, cParameter);
  nRet = atof(charToInt);
  free(charToInt);
  return nRet;
}


x86 assembly (clang, -O0):
<gdp_files_getfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rax
mov    %rax,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <gdp_files_getstring@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atof@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdp_files_getfloat>:
push   %rbx
sub    $0x10,%rsp
call   1040 <gdp_files_getstring@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define double @gdp_files_getfloat(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
store i32* %0, i32** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %5
store float 0.000000e+00, float* %6
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i8* @gdp_files_getstring(i32* %7, i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call float @atof(i8* %10)
store float %11, float* %6
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
%14 = load float, float* %6
%15 = fpext float %14 to double
ret double %15
}

LLVM IR (-O2):
define double @gdp_files_getfloat(i32* %0, i8* %1) {
%3 = tail call i8* @gdp_files_getstring(i32* %0, i8* %1)
%4 = tail call float @atof(i8* %3)
%5 = tail call i32 @free(i8* %3)
%6 = fpext float %4 to double
ret double %6
}
/* Variables and functions */
int remote_vsend(int, char *, char *);
int remote_sig_gui_warn(char *text) {
  return remote_vsend(2, "gui warn ", text);
}


x86 assembly (clang, -O0):
<remote_sig_gui_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
call   1030 <remote_vsend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_sig_gui_warn>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <remote_vsend@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"gui warn \00"
define i32 @remote_sig_gui_warn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @remote_vsend(i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"gui warn \00"
define i32 @remote_sig_gui_warn(i8* %0) {
%2 = tail call i32 @remote_vsend(i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
int test_imm_AFint8_mem(signed char *val) {
  return ((*val) & (-0xAF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_AFint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff51,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_AFint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -175
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct timeval {
  int dummy;
};
struct ip {
  int dummy;
};
struct in_addr {
  int dummy;
};

/* Variables and functions */
int inbound(struct timeval, struct in_addr, struct in_addr, int /*<<< orphan*/,
            int /*<<< orphan*/, struct ip const *);
int client_outbound(struct timeval tv, struct in_addr laddr,
                    struct in_addr raddr, uint16_t lport, uint16_t rport,
                    const struct ip *ip) {
  return inbound(tv, laddr, raddr, lport, rport, ip);
}


x86 assembly (clang, -O0):
<client_outbound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <inbound@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_outbound>:
jmp    1030 <inbound@plt>

LLVM IR (-O0):
%struct.ip = type { i32 }
%struct.timeval = type { i32 }
%struct.in_addr = type { i32 }
define i32 @client_outbound(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, %struct.ip* %5) {
%7 = alloca %struct.timeval
%8 = alloca %struct.in_addr
%9 = alloca %struct.in_addr
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.ip*
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i32 %0, i32* %13
%14 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
store i32 %1, i32* %14
%15 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %9, i32 0, i32 0
store i32 %2, i32* %15
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.ip* %5, %struct.ip** %12
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.ip*, %struct.ip** %12
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%20 = load i32, i32* %19
%21 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
%22 = load i32, i32* %21
%23 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %9, i32 0, i32 0
%24 = load i32, i32* %23
%25 = call i32 @inbound(i32 %20, i32 %22, i32 %24, i32 %16, i32 %17, %struct.ip* %18)
ret i32 %25
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define i32 @client_outbound(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, %struct.ip* %5) {
%7 = tail call i32 @inbound(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, %struct.ip* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("2 + 2 = %d \n", 2 + 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"2 + 2 = %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(int, char const *);
void print_err(const char *str) { __console_tx_string(3, str); }


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

x86 assembly (clang, -O2):
<print_err>:
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <__console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_err(i8* %0) {
%2 = tail call i32 @__console_tx_string(i32 3, i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ rand();
float ranf() { return ((float)rand() / 2147483647.); }


x86 assembly (clang, -O0):
<ranf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xed7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ranf() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fdiv double %3, 0x41DFFFFFFFC00000
%5 = fptrunc double %4 to float
ret float %5
}

LLVM IR (-O2):
define float @ranf() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fdiv double %3, 0x41DFFFFFFFC00000
%5 = fptrunc double %4 to float
ret float %5
}
void init_rs() {}


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

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

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

LLVM IR (-O2):
define void @init_rs() {
ret void
}
int cs_rprune(int i, int j, double aij, void *other) {
  int *rr = (int *)other;
  return (i >= rr[1] && i < rr[2]);
}


x86 assembly (clang, -O0):
<cs_rprune>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rdx
xor    %eax,%eax
cmp    0x4(%rdx),%ecx
mov    %al,-0x21(%rbp)
jl     1140 <cs_rprune+0x40>
mov    -0x4(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    0x8(%rcx),%eax
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_rprune>:
xor    %eax,%eax
cmp    %edi,0x4(%rdx)
jg     110f <cs_rprune+0xf>
xor    %eax,%eax
cmp    %edi,0x8(%rdx)
setg   %al
ret

LLVM IR (-O0):
define i32 @cs_rprune(i32 %0, i32 %1, double %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
%9 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i32, i32* %5
%13 = load i32*, i32** %9
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = icmp sge i32 %12, %15
br i1 %16, label %17, label %23
17: ; preds = %4
%18 = load i32, i32* %5
%19 = load i32*, i32** %9
%20 = getelementptr inbounds i32, i32* %19, i64 2
%21 = load i32, i32* %20
%22 = icmp slt i32 %18, %21
br label %23
23: ; preds = %17, %4
%24 = phi i1 [ false, %4 ], [ %22, %17 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @cs_rprune(i32 %0, i32 %1, double %2, i8* nocapture %3) {
%5 = getelementptr inbounds i8, i8* %3, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, %0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %3, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, %0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %9, %4
%16 = phi i32 [ 0, %4 ], [ %14, %9 ]
ret i32 %16
}
/* Variables and functions */
unsigned int bit(int);
int bit_test(unsigned w, int n) {
  int result = (bit(n) & w) == 0 ? 0 : 1;
  return result;
}


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bit@plt>
mov    %eax,%edx
and    -0x4(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <bit@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bit_test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @bit(i32 %6)
%8 = load i32, i32* %3
%9 = and i32 %7, %8
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @bit_test(i32 %0, i32 %1) {
%3 = tail call i32 @bit(i32 %1)
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
AX0RX1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (((float *)10000000)[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<AX0RX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0RX1>:
movslq %esi,%rax
movss  (%rcx,%rax,4),%xmm0
movslq %edi,%rax
movss  %xmm0,0x989680(,%rax,4)
ret

LLVM IR (-O0):
define i32 @AX0RX1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %16, i64 %18
%20 = load float, float* %19
%21 = load i32, i32* %10
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %22
store float %20, float* %23
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @AX0RX1(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* %5, i64 %7
%9 = load float, float* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %10
store float %9, float* %11
ret i32 undef
}
long idxof(long i) { return i; }


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

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

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

LLVM IR (-O2):
define i64 @idxof(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int abs(double);
int get_grid_cell_to_coordinate(double pos, double gridsize) {
  if (pos < 0)
    return -abs(pos / gridsize - 0.999999999999);
  else
    return abs(pos / gridsize);
}


x86 assembly (clang, -O0):
<get_grid_cell_to_coordinate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1159 <get_grid_cell_to_coordinate+0x49>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <get_grid_cell_to_coordinate+0x5b>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1030 <abs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_grid_cell_to_coordinate>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
divsd  %xmm1,%xmm0
jbe    1130 <get_grid_cell_to_coordinate+0x20>
push   %rax
addsd  0xed9(%rip),%xmm0
call   1030 <abs@plt>
neg    %eax
pop    %rcx
ret
jmp    1030 <abs@plt>

LLVM IR (-O0):
define i32 @get_grid_cell_to_coordinate(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fdiv double %9, %10
%12 = fsub double %11, 0x3FEFFFFFFFFFDCD1
%13 = call i32 @abs(double %12)
%14 = sub nsw i32 0, %13
store i32 %14, i32* %3
br label %20
15: ; preds = %2
%16 = load double, double* %4
%17 = load double, double* %5
%18 = fdiv double %16, %17
%19 = call i32 @abs(double %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_grid_cell_to_coordinate(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = fdiv double %0, %1
br i1 %3, label %5, label %9
5: ; preds = %2
%6 = fadd double %4, 0xBFEFFFFFFFFFDCD1
%7 = tail call i32 @abs(double %6)
%8 = sub nsw i32 0, %7
br label %11
9: ; preds = %2
%10 = tail call i32 @abs(double %4)
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %8, %5 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ gen_rand_walk(int **);
int /*<<< orphan*/ print_array(int **);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  srand((unsigned)time(NULL));
  int board[10][10];
  gen_rand_walk(board);
  print_array(board);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    -0x1a0(%rbp),%rdi
call   1060 <gen_rand_walk@plt>
lea    -0x1a0(%rbp),%rdi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gen_rand_walk@plt>
mov    %rbx,%rdi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i32]]
store i32 0, i32* %1
%3 = call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = call i32 @srand(i32 %4)
%6 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%7 = bitcast [10 x i32]* %6 to i32**
%8 = call i32 @gen_rand_walk(i32** %7)
%9 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%10 = bitcast [10 x i32]* %9 to i32**
%11 = call i32 @print_array(i32** %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @srand(i32 %3)
%5 = bitcast [10 x [10 x i32]]* %1 to i8*
%6 = bitcast [10 x [10 x i32]]* %1 to i32**
%7 = call i32 @gen_rand_walk(i32** %6)
%8 = call i32 @print_array(i32** %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lv1_panic(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void ps3_exit(void) {
  printf("ps3_exit\n");
  lv1_panic(0);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<ps3_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <lv1_panic@plt>
jmp    1137 <ps3_exit+0x17>

x86 assembly (clang, -O2):
<ps3_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <lv1_panic@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <ps3_exit+0x20>

LLVM IR (-O0):
@.str = [10 x i8] c"ps3_exit\0A\00"
define void @ps3_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @lv1_panic(i32 0)
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [9 x i8] c"ps3_exit\00"
define void @ps3_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @lv1_panic(i32 0)
br label %3
3: ; preds = %0, %3
br label %3
}
/* Type definitions */
typedef int u_int16_t;

/* Variables and functions */
u_int16_t Short_Little2Big(u_int16_t var) {
  unsigned char *ptmp;
  ptmp = (unsigned char *)&var;
  return (((u_int16_t)ptmp[1] << 8) + (u_int16_t)ptmp[0]);
}


x86 assembly (clang, -O0):
<Short_Little2Big>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Short_Little2Big>:
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @Short_Little2Big(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Short_Little2Big(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
scalar_t__ mindistD(unsigned long long);
int /*<<< orphan*/ printf(char *);
unsigned long long strtoull(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  unsigned long long d = strtoull(argv[1], NULL, 2);
  if (mindistD(d))
    printf("Minimum distance is at least D.\n");
  else
    printf("Minimum distance is less than D.\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1050 <strtoull@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <mindistD@plt>
cmp    $0x0,%rax
je     1184 <main+0x54>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
jmp    1190 <main+0x60>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <strtoull@plt>
mov    %rax,%rdi
call   1040 <mindistD@plt>
test   %rax,%rax
lea    0xead(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Minimum distance is at least D.\0A\00"
@.str.1 = [34 x i8] c"Minimum distance is less than D.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @strtoull(i8* %9, i32* null, i32 2)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = call i64 @mindistD(i64 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"Minimum distance is less than D.\00"
@str.2 = [32 x i8] c"Minimum distance is at least D.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtoull(i8* nocapture %4, i32* null, i32 2)
%6 = tail call i64 @mindistD(i64 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0)
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
int eb_float_to_d1c(float src, unsigned char *tgt) {
  if (src < 0.0 || src > 100.0) {
    *tgt = (unsigned char)(0xFF);
    return 0;
  } else {
    *tgt = (unsigned char)(src * 2.0);
    return 1;
  }
}


x86 assembly (clang, -O0):
<eb_float_to_d1c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     113e <eb_float_to_d1c+0x3e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1151 <eb_float_to_d1c+0x51>
mov    -0x10(%rbp),%rax
movb   $0xff,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1171 <eb_float_to_d1c+0x71>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb_float_to_d1c>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
seta   %al
ucomiss 0xef0(%rip),%xmm0
seta   %cl
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edx
or     %al,%cl
mov    $0xff,%esi
cmove  %edx,%esi
xor    $0x1,%cl
movzbl %cl,%eax
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define i32 @eb_float_to_d1c(float %0, i8* %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i8*
store float %0, float* %4
store i8* %1, i8** %5
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fcmp ogt double %11, 1.000000e+02
br i1 %12, label %13, label %15
13: ; preds = %9, %2
%14 = load i8*, i8** %5
store i8 -1, i8* %14
store i32 0, i32* %3
br label %21
15: ; preds = %9
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = fmul double %17, 2.000000e+00
%19 = fptoui double %18 to i8
%20 = load i8*, i8** %5
store i8 %19, i8* %20
store i32 1, i32* %3
br label %21
21: ; preds = %15, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @eb_float_to_d1c(float %0, i8* nocapture writeonly %1) {
%3 = fpext float %0 to double
%4 = fcmp olt float %0, 0.000000e+00
%5 = fcmp ogt float %0, 1.000000e+02
%6 = or i1 %4, %5
%7 = fmul double %3, 2.000000e+00
%8 = fptoui double %7 to i8
%9 = select i1 %6, i8 -1, i8 %8
%10 = or i1 %4, %5
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
store i8 %9, i8* %1
ret i32 %12
}
void vde_chain_nm2_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @vde_chain_nm2_decref() {
ret void
}
/* Variables and functions */
int fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
int puts(const char *s) { return fprintf(stdout, "%s\n", s); }


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %3
}
/* Type definitions */
typedef int wchar_t;
typedef int KeySym;

/* Variables and functions */
wchar_t KeySymToUnicode(KeySym keysym) {
  switch (keysym) {
  default:
    return 0x0000;
  }
}


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

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

LLVM IR (-O0):
define i32 @KeySymToUnicode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @KeySymToUnicode(i32 %0) {
ret i32 0
}
call0e(c1, l, c2, i, c3, s, c4, c5) char c1;
long l;
char c2;
int i;
char c3;
short s;
char c4;
char c5;
{
  c1 = 'a';
  l = 5;
  c2 = 'b';
  i = 7;
  c3 = 'c';
  s = 7;
  c4 = 'f';
  c5 = 'g';
}


x86 assembly (clang, -O0):
<call0e>:
push   %rbp
mov    %rsp,%rbp
mov    %r9d,-0x2c(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %edx,%r8d
mov    -0x2c(%rbp),%edx
mov    %rsi,%r9
mov    -0x28(%rbp),%esi
mov    %edi,%r10d
mov    -0x24(%rbp),%edi
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%ecx
mov    %r10b,-0x5(%rbp)
mov    %r9,-0x10(%rbp)
mov    %r8b,-0x11(%rbp)
mov    %edi,-0x18(%rbp)
mov    %sil,-0x19(%rbp)
mov    %dx,-0x1c(%rbp)
mov    %cl,-0x1d(%rbp)
mov    %al,-0x1e(%rbp)
movb   $0x61,-0x5(%rbp)
movq   $0x5,-0x10(%rbp)
movb   $0x62,-0x11(%rbp)
movl   $0x7,-0x18(%rbp)
movb   $0x63,-0x19(%rbp)
movw   $0x7,-0x1c(%rbp)
movb   $0x66,-0x1d(%rbp)
movb   $0x67,-0x1e(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call0e(i32 %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i8
%11 = alloca i64
%12 = alloca i8
%13 = alloca i32
%14 = alloca i8
%15 = alloca i16
%16 = alloca i8
%17 = alloca i8
%18 = trunc i32 %0 to i8
%19 = trunc i32 %2 to i8
%20 = trunc i32 %4 to i8
%21 = trunc i32 %5 to i16
%22 = trunc i32 %6 to i8
%23 = trunc i32 %7 to i8
store i8 %18, i8* %10
store i64 %1, i64* %11
store i8 %19, i8* %12
store i32 %3, i32* %13
store i8 %20, i8* %14
store i16 %21, i16* %15
store i8 %22, i8* %16
store i8 %23, i8* %17
store i8 97, i8* %10
store i64 5, i64* %11
store i8 98, i8* %12
store i32 7, i32* %13
store i8 99, i8* %14
store i16 7, i16* %15
store i8 102, i8* %16
store i8 103, i8* %17
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @call0e(i32 %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
ret i32 undef
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_unsigned(unsigned const k1, unsigned const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_unsigned>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_unsigned(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_unsigned(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SEQ_STOP_NOTE(int /*<<< orphan*/, int, int, int);
void seq_noteoff(int chn, int note, int vol) {
  SEQ_STOP_NOTE(0, chn, note, vol);
}


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

x86 assembly (clang, -O2):
<seq_noteoff>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <SEQ_STOP_NOTE@plt>

LLVM IR (-O0):
define void @seq_noteoff(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @SEQ_STOP_NOTE(i32 0, i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @seq_noteoff(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @SEQ_STOP_NOTE(i32 0, i32 %0, i32 %1, i32 %2)
ret void
}
int add(int i, int j) { return (i + j); }


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

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

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}