xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void crypt_destroy(unsigned char *crypt) { free(crypt); }


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

x86 assembly (clang, -O2):
<crypt_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @crypt_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World, I am in CptS 121!\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 = [32 x i8] c"Hello World, I am in CptS 121!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"Hello World, I am in CptS 121!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void GetTag2JointLengths(double *tagLengths) {}


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

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

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

LLVM IR (-O2):
define void @GetTag2JointLengths(double* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t h264avcc_ppsh_get_length(const uint8_t *p) {
  return (p[0] << 8) | p[1];
}


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

x86 assembly (clang, -O2):
<h264avcc_ppsh_get_length>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @h264avcc_ppsh_get_length(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @h264avcc_ppsh_get_length(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
int test_imm_D1int64_lowword_mem(long long *val) {
  return ((*val) & (0xD1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D1int64_lowword_mem>:
testb  $0xd1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D1int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 209
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, res;
  printf("\n input number:");
  scanf("%d", &n);
  res = exact_square(n);
  printf("\n %d", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0A input number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @exact_square(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
void fakeClStageStarting(int stage) {}


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

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

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

LLVM IR (-O2):
define void @fakeClStageStarting(i32 %0) {
ret void
}
void rop3_175_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~T;
  stk1 = *D | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_175_1_0>:
not    %dl
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_175_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %1, -1
%8 = and i8 %6, %7
%9 = and i8 %5, %1
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday_or_die(struct timeval *);
int timevaldiff(struct timeval *, struct timeval *);
uint8_t get_random_byte() {
  struct timeval now, then;
  uint8_t cycles;
  gettimeofday_or_die(&then);
  while (1) {
    ++cycles;
    gettimeofday_or_die(&now);
    if (timevaldiff(&then, &now) > 100) {
      break;
    }
  }
  return cycles;
}


x86 assembly (clang, -O0):
<get_random_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1040 <gettimeofday_or_die@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <gettimeofday_or_die@plt>
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <timevaldiff@plt>
cmp    $0x64,%eax
jle    115e <get_random_byte+0x3e>
jmp    1163 <get_random_byte+0x43>
jmp    1131 <get_random_byte+0x11>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_byte>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <gettimeofday_or_die@plt>
lea    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <gettimeofday_or_die@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <timevaldiff@plt>
cmp    $0x65,%eax
jl     1140 <get_random_byte+0x20>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @get_random_byte() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = call i32 @gettimeofday_or_die(%struct.timeval* %2)
br label %5
5: ; preds = %0, %12
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = call i32 @gettimeofday_or_die(%struct.timeval* %1)
%9 = call i32 @timevaldiff(%struct.timeval* %2, %struct.timeval* %1)
%10 = icmp sgt i32 %9, 100
br i1 %10, label %11, label %12
11: ; preds = %5
br label %13
12: ; preds = %5
br label %5
13: ; preds = %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_random_byte() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @gettimeofday_or_die(%struct.timeval* %2)
br label %6
6: ; preds = %6, %0
%7 = phi i32 [ undef, %0 ], [ %8, %6 ]
%8 = add nsw i32 %7, 1
%9 = call i32 @gettimeofday_or_die(%struct.timeval* %1)
%10 = call i32 @timevaldiff(%struct.timeval* %2, %struct.timeval* %1)
%11 = icmp sgt i32 %10, 100
br i1 %11, label %12, label %6
12: ; preds = %6
ret i32 %8
}
/* Variables and functions */
long binaryToDecimal(int, int, char *);
long reverseSignedMagnitude(int size, char binaryIn[size]) {
  long result = binaryToDecimal(1, size, binaryIn);
  if (binaryIn[0] == '1')
    result *= -1;
  return result;
}


x86 assembly (clang, -O0):
<reverseSignedMagnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <binaryToDecimal@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    114d <reverseSignedMagnitude+0x3d>
imul   $0xffffffffffffffff,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseSignedMagnitude>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1030 <binaryToDecimal@plt>
mov    %rax,%rcx
neg    %rcx
cmpb   $0x31,(%rbx)
cmove  %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @reverseSignedMagnitude(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i64 @binaryToDecimal(i32 1, i32 %8, i8* %9)
store i64 %10, i64* %5
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 49
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i64, i64* %5
%18 = mul nsw i64 %17, -1
store i64 %18, i64* %5
br label %19
19: ; preds = %16, %2
%20 = load i64, i64* %5
ret i64 %20
}

LLVM IR (-O2):
define i64 @reverseSignedMagnitude(i32 %0, i8* %1) {
%3 = tail call i64 @binaryToDecimal(i32 1, i32 %0, i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 49
%6 = sub nsw i64 0, %3
%7 = select i1 %5, i64 %6, i64 %3
ret i64 %7
}
void rop3_171_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_171_1_0>:
or     %esi,%edx
not    %dl
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_171_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %6, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
void TimerOC2PolarityConfigure(unsigned long ulBase, unsigned long ulPolarity) {
  unsigned long ulTempccer = 0;

  ;

  ;
  ulTempccer = (*((volatile unsigned long *)(ulBase + 0x00000020)));
  ulTempccer &= ~0x00000020;
  ulTempccer |= (ulPolarity << 4);
  (*((volatile unsigned long *)(ulBase + 0x00000020))) = ulTempccer;
}


x86 assembly (clang, -O0):
<TimerOC2PolarityConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xffffffffffffffdf,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOC2PolarityConfigure>:
mov    0x20(%rdi),%rax
and    $0xffffffffffffffdf,%rax
shl    $0x4,%rsi
or     %rax,%rsi
mov    %rsi,0x20(%rdi)
ret

LLVM IR (-O0):
define void @TimerOC2PolarityConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 32
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -33
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = shl i64 %12, 4
%14 = load i64, i64* %5
%15 = or i64 %14, %13
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %3
%18 = add i64 %17, 32
%19 = inttoptr i64 %18 to i64*
store volatile i64 %16, i64* %19
ret void
}

LLVM IR (-O2):
define void @TimerOC2PolarityConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 32
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -33
%7 = shl i64 %1, 4
%8 = or i64 %6, %7
store volatile i64 %8, i64* %4
ret void
}
int test_imm_C5uint16_reg(unsigned short val) {
  return ((val) & (-0xC5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C5uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff3b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C5uint16_reg>:
test   $0xff3b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C5uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -197
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ohci_dump(struct ohci_hcd *controller) {}


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

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

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

LLVM IR (-O2):
%struct.ohci_hcd = type opaque
define void @ohci_dump(%struct.ohci_hcd* nocapture %0) {
ret void
}
int main() {
  int MAX;
  int a, b, c;
  MAX = 1000;
  a = 1;
  b = 1;
  c = 1;
  while (((a * a * a) != ((b * b * b) + (c * c * c))) && c <= MAX) {
    a = a + 1;
    if (a > MAX) {
      a = 1;
      b = b + 1;
    }
    if (b > MAX) {
      b = 1;
      c = c + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
imul   -0x10(%rbp),%edx
imul   -0x10(%rbp),%edx
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
add    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
je     1163 <main+0x63>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1173 <main+0x73>
jmp    11b9 <main+0xb9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1198 <main+0x98>
movl   $0x1,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11b4 <main+0xb4>
movl   $0x1,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <main+0x27>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %46, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %5
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = mul nsw i32 %19, %20
%22 = add nsw i32 %16, %21
%23 = icmp ne i32 %11, %22
br i1 %23, label %24, label %28
24: ; preds = %6
%25 = load i32, i32* %5
%26 = load i32, i32* %2
%27 = icmp sle i32 %25, %26
br label %28
28: ; preds = %24, %6
%29 = phi i1 [ false, %6 ], [ %27, %24 ]
br i1 %29, label %30, label %47
30: ; preds = %28
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
%33 = load i32, i32* %3
%34 = load i32, i32* %2
%35 = icmp sgt i32 %33, %34
br i1 %35, label %36, label %39
36: ; preds = %30
store i32 1, i32* %3
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %39
39: ; preds = %36, %30
%40 = load i32, i32* %4
%41 = load i32, i32* %2
%42 = icmp sgt i32 %40, %41
br i1 %42, label %43, label %46
43: ; preds = %39
store i32 1, i32* %4
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %46
46: ; preds = %43, %39
br label %6
47: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(double);
void math_rad(void) {
  lua_pushnumber(luaL_check_number(1) *
                 (((double)3.14159265358979323846) / 180.0));
}


x86 assembly (clang, -O0):
<math_rad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_rad>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mulsd  0xecd(%rip),%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_rad() {
%1 = call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = call i32 @lua_pushnumber(double %2)
ret void
}

LLVM IR (-O2):
define void @math_rad() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = fmul double %1, 0x3F91DF46A2529D39
%3 = tail call i32 @lua_pushnumber(double %2)
ret void
}
/* Type definitions */
struct xhda_node {
  int dummy;
};
struct xhda_codec {
  int dummy;
};

/* Variables and functions */
int set_verb_val(struct xhda_codec *, unsigned int, unsigned int, int);
int set_cached_verb4(struct xhda_codec *codec, struct xhda_node *node,
                     unsigned int cmd) {
  return set_verb_val(codec, ((cmd >> 8) & 0x7ff) - 3, cmd, 3);
}


x86 assembly (clang, -O0):
<set_cached_verb4>:
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    -0x14(%rbp),%esi
shr    $0x8,%esi
and    $0x7ff,%esi
sub    $0x3,%esi
mov    -0x14(%rbp),%edx
mov    $0x3,%ecx
call   1030 <set_verb_val@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cached_verb4>:
mov    %edx,%esi
shr    $0x8,%esi
and    $0x7ff,%esi
add    $0xfffffffd,%esi
mov    $0x3,%ecx
jmp    1030 <set_verb_val@plt>

LLVM IR (-O0):
%struct.xhda_codec = type { i32 }
%struct.xhda_node = type { i32 }
define i32 @set_cached_verb4(%struct.xhda_codec* %0, %struct.xhda_node* %1, i32 %2) {
%4 = alloca %struct.xhda_codec*
%5 = alloca %struct.xhda_node*
%6 = alloca i32
store %struct.xhda_codec* %0, %struct.xhda_codec** %4
store %struct.xhda_node* %1, %struct.xhda_node** %5
store i32 %2, i32* %6
%7 = load %struct.xhda_codec*, %struct.xhda_codec** %4
%8 = load i32, i32* %6
%9 = lshr i32 %8, 8
%10 = and i32 %9, 2047
%11 = sub i32 %10, 3
%12 = load i32, i32* %6
%13 = call i32 @set_verb_val(%struct.xhda_codec* %7, i32 %11, i32 %12, i32 3)
ret i32 %13
}

LLVM IR (-O2):
%struct.xhda_codec = type { i32 }
%struct.xhda_node = type { i32 }
define i32 @set_cached_verb4(%struct.xhda_codec* %0, %struct.xhda_node* nocapture readnone %1, i32 %2) {
%4 = lshr i32 %2, 8
%5 = and i32 %4, 2047
%6 = add nsw i32 %5, -3
%7 = tail call i32 @set_verb_val(%struct.xhda_codec* %0, i32 %6, i32 %2, i32 3)
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t cu_gpos2bpos(uint8_t gpos) {
  uint8_t bpos = gpos;
  bpos &= 0xf0;
  bpos >>= 1;
  gpos &= 0x0f;
  bpos |= gpos;
  return bpos;
}


x86 assembly (clang, -O0):
<cu_gpos2bpos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu_gpos2bpos>:
mov    %edi,%eax
shr    %eax
and    $0x78,%eax
and    $0xf,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cu_gpos2bpos(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 240
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = ashr i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = and i32 %9, 15
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @cu_gpos2bpos(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 120
%4 = and i32 %0, 15
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int);
void main() { printf("%d\n", fact(5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <fact@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @fact(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *kmalloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<kmalloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @kmalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @kmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetSegmentReMap(char x) {
  unsigned char d[] = {0xA0 | (x & 0x01)};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetSegmentReMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
or     $0xa0,%eax
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetSegmentReMap>:
push   %rax
and    $0x1,%dil
or     $0xa0,%dil
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetSegmentReMap(i8 signext %0) {
%2 = alloca i8
%3 = alloca [1 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = and i32 %6, 1
%8 = or i32 160, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%11 = call i32 @oled_SendCommand(i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @SetSegmentReMap(i8 signext %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = and i8 %0, 1
%5 = or i8 %4, -96
store i8 %5, i8* %3
%6 = call i32 @oled_SendCommand(i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inverte(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  inverte(num);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <inverte@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @inverte(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void memset_bad1() {
  int arr[10];
  memset(arr, 0, 44);
}


x86 assembly (clang, -O0):
<memset_bad1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c,%edx
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_bad1>:
sub    $0x28,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x2c,%edx
call   1030 <memset@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @memset_bad1() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @memset(i32* %2, i32 0, i32 44)
ret void
}

LLVM IR (-O2):
define void @memset_bad1() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 44)
ret void
}
/* Variables and functions */
char *cnfCreim(char *const, int);
int /*<<< orphan*/ cnfFree(char *);
int /*<<< orphan*/ datChscn(char *, int *const);
void dat_chscn_(char *const name, int *const status, int name_length) {
  char *name_c;
  if (*status != 0)
    return;
  name_c = cnfCreim(name, name_length);
  datChscn(name_c, status);
  cnfFree(name_c);
}


x86 assembly (clang, -O0):
<dat_chscn_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1155 <dat_chscn_+0x25>
jmp    117b <dat_chscn_+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <cnfCreim@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <datChscn@plt>
mov    -0x20(%rbp),%rdi
call   1030 <cnfFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dat_chscn_>:
push   %r14
push   %rbx
push   %rax
cmpl   $0x0,(%rsi)
je     1141 <dat_chscn_+0x11>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rsi,%rbx
mov    %edx,%esi
call   1050 <cnfCreim@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <datChscn@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <cnfFree@plt>

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

LLVM IR (-O2):
define void @dat_chscn_(i8* %0, i32* %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i8* @cnfCreim(i8* %0, i32 %2)
%8 = tail call i32 @datChscn(i8* %7, i32* %1)
%9 = tail call i32 @cnfFree(i8* %7)
br label %10
10: ; preds = %3, %6
ret void
}
/* Variables and functions */
int read_mail_box(int, int);
bool read_lmb(int index) {
  int left_index = (index + 1) % 5;
  return read_mail_box(false, left_index);
}


x86 assembly (clang, -O0):
<read_lmb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
xor    %edi,%edi
call   1030 <read_mail_box@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lmb>:
add    $0x1,%edi
movslq %edi,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
xor    %edi,%edi
jmp    1030 <read_mail_box@plt>

LLVM IR (-O0):
define i32 @read_lmb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = srem i32 %5, 5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @read_mail_box(i32 0, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_lmb(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 5
%4 = tail call i32 @read_mail_box(i32 0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int EINVAL;
int pm8921_bms_get_ccc(void) { return -EINVAL; }


x86 assembly (clang, -O0):
<pm8921_bms_get_ccc>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_bms_get_ccc>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pm8921_bms_get_ccc() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pm8921_bms_get_ccc() {
%1 = load i32, i32* @EINVAL
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  ft_putstr(argv[0]);
  ft_putchar('\n');
  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    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @ft_putstr(i8* %8)
%10 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @ft_putstr(i8* %3)
%5 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, i;
  scanf("%d", &num);
  i = exact_square(num);
  printf("%d", i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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


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

x86 assembly (clang, -O2):
<my_compare_data>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @my_compare_data(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test61_AvrPin_clear__E();
int /*<<< orphan*/ test61_AvrPin_makeOutput__E();
void test61_Led_targetInit__I() {
  test61_AvrPin_clear__E();
  test61_AvrPin_makeOutput__E();
}


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

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

LLVM IR (-O0):
define void @test61_Led_targetInit__I() {
%1 = call i32 (...) @test61_AvrPin_clear__E()
%2 = call i32 (...) @test61_AvrPin_makeOutput__E()
ret void
}

LLVM IR (-O2):
define void @test61_Led_targetInit__I() {
%1 = tail call i32 (...) @test61_AvrPin_clear__E()
%2 = tail call i32 (...) @test61_AvrPin_makeOutput__E()
ret void
}
/* Variables and functions */
int GetInt();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I'd like an integer please: ");
  int n = GetInt();
  if (n > 0) {
    printf("You picked a positive number!\n");
  } else {
    printf("You picked a negative number!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <GetInt@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1160 <main+0x40>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    116c <main+0x4c>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <GetInt@plt>
test   %eax,%eax
lea    0xeee(%rip),%rax
lea    0xec9(%rip),%rdi
cmovg  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"I'd like an integer please: \00"
@.str.1 = [31 x i8] c"You picked a positive number!\0A\00"
@.str.2 = [31 x i8] c"You picked a negative number!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @GetInt()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [29 x i8] c"I'd like an integer please: \00"
@str = [30 x i8] c"You picked a negative number!\00"
@str.3 = [30 x i8] c"You picked a positive number!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @GetInt()
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ interrupt_keybd();
void PortCPortAIsr(void) { interrupt_keybd(); }


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

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

LLVM IR (-O0):
define void @PortCPortAIsr() {
%1 = call i32 (...) @interrupt_keybd()
ret void
}

LLVM IR (-O2):
define void @PortCPortAIsr() {
%1 = tail call i32 (...) @interrupt_keybd()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lsli0(uint32_t x) { return x << 0; }


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

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

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

LLVM IR (-O2):
define i32 @lsli0(i32 returned %0) {
ret i32 %0
}
int ft_min2(int n1, int n2) {
  if (n1 < n2)
    return (n1);
  return (n2);
}


x86 assembly (clang, -O0):
<ft_min2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <ft_min2+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <ft_min2+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_min2>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_min2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
TAG_CALLBACK(spp_endif) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @TAG_CALLBACK(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int rename(char const *, char const *);
int main(int argc, const char *argv[]) {
  const char *from, *to;
  if (argc < 3)
    return (1);
  from = argv[1];
  to = argv[2];
  if (rename(from, to) == -1)
    return (2);
  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)
cmpl   $0x3,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    117d <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <rename@plt>
cmp    $0xffffffff,%eax
jne    1176 <main+0x66>
movl   $0x2,-0x4(%rbp)
jmp    117d <main+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1138 <main+0x28>
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <rename@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
add    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @rename(i8* %6, i8* %8)
%10 = icmp eq i32 %9, -1
%11 = select i1 %10, i32 2, i32 0
br label %12
12: ; preds = %4, %2
%13 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ bgnqstrip();
void bgnqst_() { bgnqstrip(); }


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

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

LLVM IR (-O0):
define void @bgnqst_() {
%1 = call i32 (...) @bgnqstrip()
ret void
}

LLVM IR (-O2):
define void @bgnqst_() {
%1 = tail call i32 (...) @bgnqstrip()
ret void
}