xunge/DecIR huggingface dataset:
unsigned int bcd2bin(unsigned int val) {
  return ((val)&0x0f) + ((val & 0xff) >> 4) * 10;
}


x86 assembly (clang, -O0):
<bcd2bin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shr    $0x4,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2bin>:
mov    %edi,%eax
and    $0xf,%eax
shr    $0x4,%edi
and    $0xf,%edi
lea    (%rdi,%rdi,4),%ecx
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @bcd2bin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = load i32, i32* %2
%6 = and i32 %5, 255
%7 = lshr i32 %6, 4
%8 = mul i32 %7, 10
%9 = add i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bcd2bin(i32 %0) {
%2 = and i32 %0, 15
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = mul nuw nsw i32 %4, 10
%6 = add nuw nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ GMP_RNDD;
int /*<<< orphan*/ mpfr_set_default_rounding_mode(int /*<<< orphan*/);
double sub_lo(double x, double y) {
  mpfr_set_default_rounding_mode(GMP_RNDD);
  ;
  return (x - y);
}


x86 assembly (clang, -O0):
<sub_lo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_lo>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <mpfr_set_default_rounding_mode@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@GMP_RNDD = global i32 0
define double @sub_lo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @GMP_RNDD
%6 = call i32 @mpfr_set_default_rounding_mode(i32 %5)
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
ret double %9
}

LLVM IR (-O2):
@GMP_RNDD = global i32 0
define double @sub_lo(double %0, double %1) {
%3 = load i32, i32* @GMP_RNDD
%4 = tail call i32 @mpfr_set_default_rounding_mode(i32 %3)
%5 = fsub double %0, %1
ret double %5
}
void ri_thread_exit(void *val_ptr) { (void)val_ptr; }


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

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

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

LLVM IR (-O2):
define void @ri_thread_exit(i8* nocapture %0) {
ret void
}
/* Variables and functions */
#define EACCES 131
#define EINVAL 130
#define EPERM 129
#define ERANGE 128
int errno;
void assignSemDestroyError() {
  switch (errno) {
  case EACCES:
    errno = EINVAL;
    break;
  case EINVAL:
    break;
  case EPERM:
    errno = EINVAL;
    break;
  case ERANGE:
    break;
  }
}


x86 assembly (clang, -O0):
<assignSemDestroyError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x8(%rbp)
sub    $0x3,%eax
ja     1161 <assignSemDestroyError+0x61>
mov    -0x8(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2ea6(%rip),%rax
movl   $0x82,(%rax)
jmp    1161 <assignSemDestroyError+0x61>
jmp    1161 <assignSemDestroyError+0x61>
mov    0x2e8f(%rip),%rax
movl   $0x82,(%rax)
jmp    1161 <assignSemDestroyError+0x61>
jmp    1161 <assignSemDestroyError+0x61>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignSemDestroyError>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
or     $0x2,%ecx
cmp    $0x83,%ecx
jne    111a <assignSemDestroyError+0x1a>
movl   $0x82,(%rax)
ret

LLVM IR (-O0):
@errno = global i32 0
define void @assignSemDestroyError() {
%1 = load i32, i32* @errno
switch i32 %1, label %6 [
i32 131, label %2
i32 130, label %3
i32 129, label %4
i32 128, label %5
]
2: ; preds = %0
store i32 130, i32* @errno
br label %6
3: ; preds = %0
br label %6
4: ; preds = %0
store i32 130, i32* @errno
br label %6
5: ; preds = %0
br label %6
6: ; preds = %0, %5, %4, %3, %2
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @assignSemDestroyError() {
%1 = load i32, i32* @errno
switch i32 %1, label %3 [
i32 131, label %2
i32 129, label %2
]
2: ; preds = %0, %0
store i32 130, i32* @errno
br label %3
3: ; preds = %2, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int i = 12345;
  char str[20];
  itoa(i, str, 19);
  printf("%s\n", str);
  i = -12345;
  itoa(i, str, 19);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3039,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x13,%edx
call   1040 <itoa@plt>
lea    -0x20(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffcfc7,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x13,%edx
call   1040 <itoa@plt>
lea    -0x20(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rbx
mov    $0x3039,%edi
mov    %rbx,%rsi
mov    $0x13,%edx
call   1040 <itoa@plt>
lea    0xebd(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffcfc7,%edi
mov    %rbx,%rsi
mov    $0x13,%edx
call   1040 <itoa@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 12345, i8* %2, i32 19)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @itoa(i32 -12345, i8* %2, i32 19)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int mdp4_dsi_cmd_pipe_commit(int cndx, int wait) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mdp4_dsi_cmd_pipe_commit(i32 %0, i32 %1) {
ret i32 0
}
long kernel__Int__lshift(long self, long p0) {
  long var;
  long var1;
  var1 = self << p0;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<kernel__Int__lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Int__lshift>:
mov    %rsi,%rcx
mov    %rdi,%rax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @kernel__Int__lshift(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = shl i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @kernel__Int__lshift(i64 %0, i64 %1) {
%3 = shl i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ match(char *);
need_semicolon() {
  if (!match(";"))
    error("missing semicolon");
}


x86 assembly (clang, -O0):
<need_semicolon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <match@plt>
cmp    $0x0,%eax
jne    1149 <need_semicolon+0x29>
lea    0xebe(%rip),%rdi
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<need_semicolon>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <match@plt>
test   %eax,%eax
je     1133 <need_semicolon+0x13>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <error@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
@.str.1 = [18 x i8] c"missing semicolon\00"
define i32 @need_semicolon() {
%1 = alloca i32
%2 = call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
@.str.1 = [18 x i8] c"missing semicolon\00"
define i32 @need_semicolon() {
%1 = tail call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ down_piece(int);
void drop_piece(int player) {
  while (!down_piece(player)) {
  }
}


x86 assembly (clang, -O0):
<drop_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <down_piece@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <drop_piece+0x28>
jmp    113d <drop_piece+0x2d>
jmp    111b <drop_piece+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_piece>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <down_piece@plt>
test   %eax,%eax
je     1120 <drop_piece+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @drop_piece(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @down_piece(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_unsigned_int(unsigned int const k1,
                                         unsigned int const k2) {
  return k1 < k2;
}


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

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

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_unsigned_int(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 ult i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_unsigned_int(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int const uint16_t;

/* Variables and functions */
scalar_t__ ndm_endian_is_le();
uint16_t ndm_endian_letoh16(const uint16_t x) {
  if (ndm_endian_is_le()) {
    return x;
  }
  const uint8_t *p = (const uint8_t *)&x;
  return (uint16_t)(((uint16_t) * (p + 0)) << 0 | ((uint16_t) * (p + 1)) << 8);
}


x86 assembly (clang, -O0):
<ndm_endian_letoh16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ndm_endian_is_le@plt>
cmp    $0x0,%rax
je     1137 <ndm_endian_letoh16+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <ndm_endian_letoh16+0x49>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_endian_letoh16>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ndm_endian_is_le@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ndm_endian_letoh16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
%5 = call i64 (...) @ndm_endian_is_le()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %22
9: ; preds = %1
%10 = bitcast i32* %3 to i64*
store i64* %10, i64** %4
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 0
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 0
%16 = load i64*, i64** %4
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
store i32 %21, i32* %2
br label %22
22: ; preds = %9, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @ndm_endian_letoh16(i32 returned %0) {
%2 = tail call i64 (...) @ndm_endian_is_le()
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ core4_swap(char *, int);
void U_EMRRECTANGLE_swap(char *record, int torev) { core4_swap(record, torev); }


x86 assembly (clang, -O0):
<U_EMRRECTANGLE_swap>:
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 <core4_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRRECTANGLE_swap>:
jmp    1030 <core4_swap@plt>

LLVM IR (-O0):
define void @U_EMRRECTANGLE_swap(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 @core4_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_EMRRECTANGLE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ line(int, int, int, int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basLine() {
  int x, y, x1, y1;
  y1 = popNumber();
  x1 = popNumber();
  y = popNumber();
  x = popNumber();
  pushNumber(line(x, y, x1, y1));
}


x86 assembly (clang, -O0):
<basLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <line@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basLine>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <line@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basLine() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @popNumber()
store i32 %5, i32* %4
%6 = call i32 (...) @popNumber()
store i32 %6, i32* %3
%7 = call i32 (...) @popNumber()
store i32 %7, i32* %2
%8 = call i32 (...) @popNumber()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @line(i32 %9, i32 %10, i32 %11, i32 %12)
%14 = call i32 @pushNumber(i32 %13)
ret void
}

LLVM IR (-O2):
define void @basLine() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 (...) @popNumber()
%4 = tail call i32 (...) @popNumber()
%5 = tail call i32 @line(i32 %4, i32 %3, i32 %2, i32 %1)
%6 = tail call i32 @pushNumber(i32 %5)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int syscall(int, char const *, struct timeval const *);
int utimes(const char *path, const struct timeval times[2]) {
  return syscall(269, path, times);
}


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

x86 assembly (clang, -O2):
<utimes>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x10d,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @utimes(i8* %0, %struct.timeval* %1) {
%3 = alloca i8*
%4 = alloca %struct.timeval*
store i8* %0, i8** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i8*, i8** %3
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = call i32 @syscall(i32 269, i8* %5, %struct.timeval* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @utimes(i8* %0, %struct.timeval* %1) {
%3 = tail call i32 @syscall(i32 269, i8* %0, %struct.timeval* %1)
ret i32 %3
}
int max17058_FG_SOC(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @max17058_FG_SOC() {
ret i32 0
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ svz_file_del(int);
int /*<<< orphan*/ svz_log(int, char *, int /*<<< orphan*/);
int svz_close(int fd) {
  if (close(fd) < 0) {
    svz_log(1, "close: %s\n", strerror(errno));
    return -1;
  }
  svz_file_del(fd);
  return 0;
}


x86 assembly (clang, -O0):
<svz_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
jge    118a <svz_close+0x4a>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe87(%rip),%rsi
call   1060 <svz_log@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1199 <svz_close+0x59>
mov    -0x8(%rbp),%edi
call   1030 <svz_file_del@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svz_close>:
push   %rbx
mov    %edi,%ebx
call   1040 <close@plt>
test   %rax,%rax
js     1158 <svz_close+0x18>
mov    %ebx,%edi
call   1030 <svz_file_del@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe93(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1060 <svz_log@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"close: %s\0A\00"
@errno = global i32 0
define i32 @svz_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @svz_log(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 -1, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @svz_file_del(i32 %12)
store i32 0, i32* %2
br label %14
14: ; preds = %11, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"close: %s\0A\00"
@errno = global i32 0
define i32 @svz_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @svz_log(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %10
8: ; preds = %1
%9 = tail call i32 @svz_file_del(i32 %0)
br label %10
10: ; preds = %8, %4
%11 = phi i32 [ -1, %4 ], [ 0, %8 ]
ret i32 %11
}
void iomuxc_init(void) {
  (*((volatile unsigned int *)((0x53F00000 + 0x000A8000) + 0xe8))) = 0b00010;
  (*((volatile unsigned int *)((0x53F00000 + 0x000A8000) + 0xec))) = 0b00010;
  (*((volatile unsigned int *)((0x53F00000 + 0x000A8000) + 0x878))) = 0x1;
}


x86 assembly (clang, -O0):
<iomuxc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53fa80e8,%eax
movl   $0x2,(%rax)
mov    $0x53fa80ec,%eax
movl   $0x2,(%rax)
mov    $0x53fa8878,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<iomuxc_init>:
movl   $0x2,0x53fa80e8
movl   $0x2,0x53fa80ec
movl   $0x1,0x53fa8878
ret

LLVM IR (-O0):
define void @iomuxc_init() {
store volatile i32 2, i32* inttoptr (i64 1408925928 to i32*)
store volatile i32 2, i32* inttoptr (i64 1408925932 to i32*)
store volatile i32 1, i32* inttoptr (i64 1408927864 to i32*)
ret void
}

LLVM IR (-O2):
define void @iomuxc_init() {
store volatile i32 2, i32* inttoptr (i64 1408925928 to i32*)
store volatile i32 2, i32* inttoptr (i64 1408925932 to i32*)
store volatile i32 1, i32* inttoptr (i64 1408927864 to i32*)
ret void
}
/* Variables and functions */
size_t utf8len(char *s) {
  size_t len = 0;
  for (; *s; ++s)
    if ((*s & 0xC0) != 0x80)
      ++len;
  return len;
}


x86 assembly (clang, -O0):
<utf8len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <utf8len+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1140 <utf8len+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1145 <utf8len+0x45>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <utf8len+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8len>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <utf8len+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <utf8len+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @utf8len(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %18, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = and i32 %11, 192
%13 = icmp ne i32 %12, 128
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i64, i64* %3
%16 = add i64 %15, 1
store i64 %16, i64* %3
br label %17
17: ; preds = %14, %8
br label %18
18: ; preds = %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %4
21: ; preds = %4
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @utf8len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = and i8 %5, -64
%9 = icmp ne i8 %8, -128
%10 = zext i1 %9 to i64
%11 = add i64 %6, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void store32(uint8_t *b, uint32_t i) { memcpy(b, &i, 4); }


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

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

LLVM IR (-O0):
define void @store32(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 = call i32 @memcpy(i32* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @store32(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
void createPageTable(void) {
  unsigned int va, pa;
  unsigned int *ttb = (unsigned int *)0x50000000;
  va = 0;
  pa = 0;
  ttb[0] = (0 | ((3 << 10) | (0 << 5) | (1 << 4) | (1 << 3) | (1 << 2) | (2)));
  va = 0xB0000000;
  pa = 0x50000000;
  *(ttb + (va >> 20)) = (pa & 0xFFF00000) | ((3 << 10) | (0 << 5) | (1 << 4) |
                                             (1 << 3) | (1 << 2) | (2));
  va = 0xA0000000;
  pa = 0x7F008000;
  *(ttb + (va >> 20)) =
      (pa & 0xFFF00000) | ((3 << 10) | (0 << 5) | (1 << 4) | (2));
  return;
}


x86 assembly (clang, -O0):
<createPageTable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50000000,%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xc1e,(%rax)
movl   $0xb0000000,-0x4(%rbp)
movl   $0x50000000,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xfff00000,%edx
or     $0xc1e,%edx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shr    $0x14,%ecx
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
movl   $0xa0000000,-0x4(%rbp)
movl   $0x7f008000,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xfff00000,%edx
or     $0xc12,%edx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shr    $0x14,%ecx
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<createPageTable>:
movl   $0xc1e,0x50000000
movl   $0x50000c1e,0x50002c00
movl   $0x7f000c12,0x50002800
ret

LLVM IR (-O0):
define void @createPageTable() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32* inttoptr (i64 1342177280 to i32*), i32** %3
store i32 0, i32* %1
store i32 0, i32* %2
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 3102, i32* %5
store i32 -1342177280, i32* %1
store i32 1342177280, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, -1048576
%8 = or i32 %7, 3102
%9 = load i32*, i32** %3
%10 = load i32, i32* %1
%11 = lshr i32 %10, 20
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
store i32 %8, i32* %13
store i32 -1610612736, i32* %1
store i32 2130739200, i32* %2
%14 = load i32, i32* %2
%15 = and i32 %14, -1048576
%16 = or i32 %15, 3090
%17 = load i32*, i32** %3
%18 = load i32, i32* %1
%19 = lshr i32 %18, 20
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
store i32 %16, i32* %21
ret void
}

LLVM IR (-O2):
define void @createPageTable() {
store i32 3102, i32* inttoptr (i64 1342177280 to i32*)
store i32 1342180382, i32* inttoptr (i64 1342188544 to i32*)
store i32 2130709522, i32* inttoptr (i64 1342187520 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ executeSql(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void rmConfigRow(char *key) {
  char sql[200];
  sprintf(sql, "DELETE FROM config WHERE key='%s'", key);
  executeSql(sql, NULL);
}


x86 assembly (clang, -O0):
<rmConfigRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xd0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <executeSql@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmConfigRow>:
push   %rbx
sub    $0xd0,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <executeSql@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"DELETE FROM config WHERE key='%s'\00"
define void @rmConfigRow(i8* %0) {
%2 = alloca i8*
%3 = alloca [200 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%8 = call i32 @executeSql(i8* %7, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"DELETE FROM config WHERE key='%s'\00"
define void @rmConfigRow(i8* %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @executeSql(i8* %3, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_hbond(int, char **);
int main(int argc, char *argv[]) {
  gmx_hbond(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_hbond(i32 %0, i8** %1)
ret i32 0
}
void g_queue_pop_nth_link() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_pop_nth_link() {
ret void
}
int ABS(int x) { return (((x) >= 0) ? (x) : (-(x))); }


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <ABS+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ABS+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ABS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @ABS(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int test_imm_F0int16_mem(short *val) {
  return ((*val) & (-0xF0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F0int16_mem>:
movzwl (%rdi),%eax
test   $0xff10,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F0int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -240
%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_F0int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -240
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int methodC(int a, int b) {
  printf("NonFileLocalC used by G\n");
  return a - b;
}


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

x86 assembly (clang, -O2):
<methodC>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
sub    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"NonFileLocalC used by G\0A\00"
define i32 @methodC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
@str = [24 x i8] c"NonFileLocalC used by G\00"
define i32 @methodC(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = sub nsw i32 %0, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_info(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/transfer.c",
            471, "[ INFO ] at %s:%d ,info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/transfer.c",
            471, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x1d7,%r8d
lea    0xf67(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_info>:
mov    %rdi,%r9
lea    0xf81(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x1d7,%esi
mov    $0x1d7,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/transfer.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 471, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 471, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/transfer.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 471, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0), i32 471, i8* %0)
ret void
}
int main() {
  while (1) {
  while_1_continue:;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1110 <main+0x10>
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %3
br label %3
3: ; preds = %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
__attribute__((always_)) void outsw(int port, const void *addr,
                                    unsigned long count) {
  asm volatile("rep; outs"
               "w"
               : "+S"(addr), "+c"(count)
               : "d"(port));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsw %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsw(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsw(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
void SDHostIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  (*((volatile unsigned long *)(0x44026000 + 0x00000090))) = (ulIntFlags >> 30);
  (*((volatile unsigned long *)(ulBase + 0x00000238))) &=
      ~(ulIntFlags & 0x3FFFFFFF);
}


x86 assembly (clang, -O0):
<SDHostIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
shr    $0x1e,%rcx
mov    $0x44026090,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdx
and    $0x3fffffff,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x238(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x238(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDHostIntDisable>:
mov    %esi,%eax
not    %eax
shr    $0x1e,%rsi
mov    %rsi,0x44026090
44
or     $0xffffffffc0000000,%rax
and    %rax,0x238(%rdi)
ret

LLVM IR (-O0):
define void @SDHostIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = lshr i64 %5, 30
store volatile i64 %6, i64* inttoptr (i64 1141006480 to i64*)
%7 = load i64, i64* %4
%8 = and i64 %7, 1073741823
%9 = xor i64 %8, -1
%10 = load i64, i64* %3
%11 = add i64 %10, 568
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @SDHostIntDisable(i64 %0, i64 %1) {
%3 = lshr i64 %1, 30
store volatile i64 %3, i64* inttoptr (i64 1141006480 to i64*)
%4 = and i64 %1, 1073741823
%5 = xor i64 %4, -1
%6 = add i64 %0, 568
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
int strlen(char *);
void Utils_clean(char *string) {
  char *temp = &string[strlen(string) - 1];
  temp[0] = 0;
}


x86 assembly (clang, -O0):
<Utils_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Utils_clean>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @Utils_clean(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 0, i8* %11
ret void
}

LLVM IR (-O2):
define void @Utils_clean(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
void HwMdSetNTable(unsigned short word) {
  while ((*(volatile unsigned short *)0x20004020))
    ;
  (*(volatile unsigned short *)0x20004022) = word;
  (*(volatile unsigned short *)0x20004020) = 0x0600;
  while ((*(volatile unsigned short *)0x20004020))
    ;
}


x86 assembly (clang, -O0):
<HwMdSetNTable>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x20004020,%eax
mov    (%rax),%ax
cmp    $0x0,%ax
je     1122 <HwMdSetNTable+0x22>
jmp    110b <HwMdSetNTable+0xb>
mov    -0x2(%rbp),%cx
mov    $0x20004022,%eax
mov    %cx,(%rax)
mov    $0x20004020,%eax
movw   $0x600,(%rax)
mov    $0x20004020,%eax
mov    (%rax),%ax
cmp    $0x0,%ax
je     114f <HwMdSetNTable+0x4f>
jmp    1138 <HwMdSetNTable+0x38>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwMdSetNTable>:
cmpw   $0x0,0x20004020
jne    1100 <HwMdSetNTable>
mov    %di,0x20004022
20
movw   $0x600,0x20004020
nopl   (%rax)
cmpw   $0x0,0x20004020
jne    1120 <HwMdSetNTable+0x20>
ret

LLVM IR (-O0):
define void @HwMdSetNTable(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
br label %3
3: ; preds = %6, %1
%4 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%5 = icmp ne i16 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i16, i16* %2
store volatile i16 %8, i16* inttoptr (i64 536887330 to i16*)
store volatile i16 1536, i16* inttoptr (i64 536887328 to i16*)
br label %9
9: ; preds = %12, %7
%10 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%11 = icmp ne i16 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %9
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @HwMdSetNTable(i16 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
store volatile i16 %0, i16* inttoptr (i64 536887330 to i16*)
store volatile i16 1536, i16* inttoptr (i64 536887328 to i16*)
br label %6
6: ; preds = %6, %5
%7 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%8 = icmp eq i16 %7, 0
br i1 %8, label %9, label %6
9: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_movrr(int, int);
void co__mmr(int md, int ms) { e_movrr(md, ms); }


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

x86 assembly (clang, -O2):
<co__mmr>:
jmp    1030 <e_movrr@plt>

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

LLVM IR (-O2):
define void @co__mmr(i32 %0, i32 %1) {
%3 = tail call i32 @e_movrr(i32 %0, i32 %1)
ret void
}
int main() {
  int i, b, a;
  a = 12;
  b = 13;
  i = b = a + a + b + b * a;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %4
store i32 13, i32* %3
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %9, %12
store i32 %13, i32* %3
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
ret i32 193
}
/* Variables and functions */
int errno;
int posix_errno_get(void) { return errno; }


x86 assembly (clang, -O0):
<posix_errno_get>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@errno = global i32 0
define i32 @posix_errno_get() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @posix_errno_get() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Started the main\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Started the main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void check(int a, int b, int *c) {
  if (a > b) {
    *c = b;
  } else if (a < b) {
    *c = a;
  } else {
    *c = 0;
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1128 <check+0x28>
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1151 <check+0x51>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <check+0x42>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    114c <check+0x4c>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1151 <check+0x51>
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %eax,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
cmovg  %esi,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @check(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 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32*, i32** %6
store i32 %11, i32* %12
br label %23
13: ; preds = %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %4
%19 = load i32*, i32** %6
store i32 %18, i32* %19
br label %22
20: ; preds = %13
%21 = load i32*, i32** %6
store i32 0, i32* %21
br label %22
22: ; preds = %20, %17
br label %23
23: ; preds = %22, %10
ret void
}

LLVM IR (-O2):
define void @check(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %0, i32 0
%7 = select i1 %4, i32 %1, i32 %6
store i32 %7, i32* %2
ret void
}