xunge/DecIR huggingface dataset:
int test_imm_33uint8_reg(unsigned char val) {
  return ((val) & (-0x33 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_33uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffcd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_33uint8_reg>:
test   $0xcd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_33uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -51
%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_33uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -51
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ stdout;
void cutils_cout_long_print(long number) { fprintf(stdout, "%ldl\n", number); }


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

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

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"%ldl\0A\00"
define void @cutils_cout_long_print(i64 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t gettimeshort() {
  struct timeval start;
  gettimeofday(&start, NULL);
  return start.tv_sec;
}


x86 assembly (clang, -O0):
<gettimeshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeshort>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @gettimeshort() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @gettimeshort() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
void warten() {
  int i;
  float x;
  for (i = 0; i < 800000; i++) {
    x += 92.77 / 29388;
  }
}


x86 assembly (clang, -O0):
<warten>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xc3500,-0x4(%rbp)
jge    1144 <warten+0x44>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <warten+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @warten() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 800000
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fadd double %8, 0x3F69DC24DB542057
%10 = fptrunc double %9 to float
store float %10, float* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @warten() {
ret void
}
/* Variables and functions */
double Slater_1S_3S(double, double, double);
double Slater_3S_1S(double rij, double xii, double xij) {
  return Slater_1S_3S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<Slater_3S_1S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <Slater_1S_3S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Slater_3S_1S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_1S_3S@plt>

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

LLVM IR (-O2):
define double @Slater_3S_1S(double %0, double %1, double %2) {
%4 = tail call double @Slater_1S_3S(double %0, double %2, double %1)
ret double %4
}
int execute_mq_timedsend() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mq_timedsend() {
ret i32 0
}
/* Variables and functions */
unsigned short strlen(const char *str) {
  unsigned short i = 0;
  while (str[i++] != 0)
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xa(%rbp),%cx
mov    %cx,%dx
add    $0x1,%dx
mov    %dx,-0xa(%rbp)
movzwl %cx,%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    110e <strlen+0xe>
movzwl -0xa(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffff,%ax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
movzwl %ax,%ecx
cmpb   $0x0,(%rdi,%rcx,1)
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define zeroext i16 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i16, i16* %3
%7 = add i16 %6, 1
store i16 %7, i16* %3
%8 = zext i16 %6 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %4
br label %4
14: ; preds = %4
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
%17 = sub nsw i32 %16, 1
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i16 [ 0, %1 ], [ %4, %2 ]
%4 = add i16 %3, 1
%5 = zext i16 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ uart_put_uint(unsigned int);
unsigned int keyboard_get(void) {
  unsigned int keycode;
  volatile unsigned int dummy;
  unsigned int result = 0;
  while (1) {
    dummy = *(volatile unsigned int *)((void *)((char *)(0x04000000 << 2) +
                                                (0 << 2)));
    keycode = *(volatile unsigned int *)((void *)((char *)(0x04000000 << 2) +
                                                  (1 << 2)));
    uart_put_uint(keycode);
    if (keycode & 0x100) {
      result = keycode & 0xff;
    } else {
      return result;
    }
  }
}


x86 assembly (clang, -O0):
<keyboard_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
mov    $0x10000000,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x10000000,%eax
mov    0x4(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <uart_put_uint@plt>
mov    -0x4(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     115d <keyboard_get+0x4d>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <keyboard_get+0x56>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    111f <keyboard_get+0xf>

x86 assembly (clang, -O2):
<keyboard_get>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ebx
mov    0x10000000,%eax
mov    %eax,0x4(%rsp)
mov    0x10000004,%ebp
mov    %ebp,%edi
call   1030 <uart_put_uint@plt>
movzbl %bpl,%eax
test   $0x100,%ebp
jne    1120 <keyboard_get+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @keyboard_get() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
br label %4
4: ; preds = %0, %17
%5 = load volatile i32, i32* inttoptr (i64 268435456 to i32*)
store volatile i32 %5, i32* %2
%6 = load volatile i32, i32* bitcast (i8* getelementptr inbounds (i8, i8* inttoptr (i64 268435456 to i8*), i64 4) to i32*)
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @uart_put_uint(i32 %7)
%9 = load i32, i32* %1
%10 = and i32 %9, 256
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %1
%14 = and i32 %13, 255
store i32 %14, i32* %3
br label %17
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
17: ; preds = %12
br label %4
}

LLVM IR (-O2):
define i32 @keyboard_get() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %10, %3 ]
%5 = load volatile i32, i32* inttoptr (i64 268435456 to i32*)
store volatile i32 %5, i32* %1
%6 = load volatile i32, i32* inttoptr (i64 268435460 to i32*)
%7 = tail call i32 @uart_put_uint(i32 %6)
%8 = and i32 %6, 256
%9 = icmp eq i32 %8, 0
%10 = and i32 %6, 255
br i1 %9, label %11, label %3
11: ; preds = %3
ret i32 %4
}
unsigned char buf_get_uint8(const void *buf, unsigned long addr) {
  const unsigned char *tmp = (const unsigned char *)buf + addr;
  return (tmp[0]);
}


x86 assembly (clang, -O0):
<buf_get_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_get_uint8>:
mov    (%rdi,%rsi,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @buf_get_uint8(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @buf_get_uint8(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x7_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x7_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x7_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x7_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x7_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
float degree2decimal(float d, float m, float s) {
  return d + (m / 60) + (s / 3600);
}


x86 assembly (clang, -O0):
<degree2decimal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xedf(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xec6(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degree2decimal>:
unpcklps %xmm2,%xmm1
divps  0xef6(%rip),%xmm1
addss  %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @degree2decimal(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fdiv float %8, 6.000000e+01
%10 = fadd float %7, %9
%11 = load float, float* %6
%12 = fdiv float %11, 3.600000e+03
%13 = fadd float %10, %12
ret float %13
}

LLVM IR (-O2):
define float @degree2decimal(float %0, float %1, float %2) {
%4 = insertelement <2 x float> poison, float %1, i64 0
%5 = insertelement <2 x float> %4, float %2, i64 1
%6 = fdiv <2 x float> %5, <float 6.000000e+01, float 3.600000e+03>
%7 = extractelement <2 x float> %6, i64 0
%8 = fadd float %7, %0
%9 = extractelement <2 x float> %6, i64 1
%10 = fadd float %8, %9
ret float %10
}
/* Type definitions */
struct vec4i {
  int dummy;
};
struct vec4 {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4_assign_vec4i(float *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec4 *psvec4_assign_vec4i(struct vec4 *result,
                                                          struct vec4i *a) {
  vec4_assign_vec4i((float *)result, (int32_t *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec4_assign_vec4i>:
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 <vec4_assign_vec4i@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4_assign_vec4i>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4_assign_vec4i@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4 = type { i32 }
%struct.vec4i = type { i32 }
define %struct.vec4* @psvec4_assign_vec4i(%struct.vec4* %0, %struct.vec4i* %1) {
%3 = alloca %struct.vec4*
%4 = alloca %struct.vec4i*
store %struct.vec4* %0, %struct.vec4** %3
store %struct.vec4i* %1, %struct.vec4i** %4
%5 = load %struct.vec4*, %struct.vec4** %3
%6 = bitcast %struct.vec4* %5 to float*
%7 = load %struct.vec4i*, %struct.vec4i** %4
%8 = bitcast %struct.vec4i* %7 to i32*
%9 = call i32 @vec4_assign_vec4i(float* %6, i32* %8)
%10 = load %struct.vec4*, %struct.vec4** %3
ret %struct.vec4* %10
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
%struct.vec4i = type { i32 }
define %struct.vec4* @psvec4_assign_vec4i(%struct.vec4* returned %0, %struct.vec4i* %1) {
%3 = bitcast %struct.vec4* %0 to float*
%4 = getelementptr %struct.vec4i, %struct.vec4i* %1, i64 0, i32 0
%5 = tail call i32 @vec4_assign_vec4i(float* %3, i32* %4)
ret %struct.vec4* %0
}
/* Variables and functions */
int ei_decode_string(char const *, int *, char *);
int ei_decode_atom(const char *buf, int *index, char *p) {
  return ei_decode_string(buf, index, p);
}


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

x86 assembly (clang, -O2):
<ei_decode_atom>:
jmp    1030 <ei_decode_string@plt>

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

LLVM IR (-O2):
define i32 @ei_decode_atom(i8* %0, i32* %1, i8* %2) {
%4 = tail call i32 @ei_decode_string(i8* %0, i32* %1, i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_read(int, int /*<<< orphan*/ *, int);
unsigned w5100_readSUBR(uint8_t *buff) { return w5100_read(0x0005, buff, 4); }


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

x86 assembly (clang, -O2):
mov    %rdi,%rsi
mov    $0x5,%edi
mov    $0x4,%edx
jmp    1030 <w5100_read@plt>

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

LLVM IR (-O2):
define i32 @w5100_readSUBR(i32* %0) {
%2 = tail call i32 @w5100_read(i32 5, i32* %0, i32 4)
ret i32 %2
}
void Swap(int arr[], int idx1, int idx2) {
  int temp = arr[idx1];
  arr[idx1] = arr[idx2];
  arr[idx2] = temp;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @Swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void *getvideoL7(struct udphdr *pudp, int tproto, void *pdir, void *plast) {
  return (void *)pudp;
}


x86 assembly (clang, -O0):
<getvideoL7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.udphdr = type opaque
define i8* @getvideoL7(%struct.udphdr* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.udphdr*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.udphdr* %0, %struct.udphdr** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct.udphdr*, %struct.udphdr** %5
%10 = bitcast %struct.udphdr* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
%struct.udphdr = type opaque
define i8* @getvideoL7(%struct.udphdr* readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = bitcast %struct.udphdr* %0 to i8*
ret i8* %5
}
int do_503() { return 503; }


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

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

LLVM IR (-O0):
define i32 @do_503() {
ret i32 503
}

LLVM IR (-O2):
define i32 @do_503() {
ret i32 503
}
void al_code(char **app, int atrnum) {
  char *ap;
  ap = *app;
  for (;;) {
    *ap = atrnum & 0x7f;
    atrnum = atrnum >> 7;
    if (!atrnum) {
      *app = ++ap;
      return;
    }
    *ap++ |= 0x80;
  }
}


x86 assembly (clang, -O0):
<al_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7f,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114c <al_code+0x4c>
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%ecx
or     $0x80,%ecx
mov    %cl,(%rax)
jmp    1116 <al_code+0x16>

x86 assembly (clang, -O2):
<al_code>:
mov    (%rdi),%rax
mov    %esi,%ecx
and    $0x7f,%cl
mov    %cl,(%rax)
cmp    $0x80,%esi
jae    1117 <al_code+0x17>
mov    %rax,%r9
jmp    1147 <al_code+0x47>
mov    %esi,%r8d
mov    %esi,%ecx
nopl   0x0(%rax)
sar    $0x7,%ecx
lea    0x1(%rax),%r9
or     $0x80,%sil
mov    %sil,(%rax)
mov    %ecx,%edx
and    $0x7f,%dl
mov    %dl,0x1(%rax)
mov    %ecx,%esi
mov    %r9,%rax
cmp    $0x4000,%r8d
mov    %ecx,%r8d
jae    1120 <al_code+0x20>
add    $0x1,%r9
mov    %r9,(%rdi)
ret

LLVM IR (-O0):
define void @al_code(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* %4
%10 = and i32 %9, 127
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %5
store i8 %11, i8* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 7
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %5
%20 = load i8**, i8*** %3
store i8* %19, i8** %20
ret void
21: ; preds = %8
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
%24 = load i8, i8* %22
%25 = sext i8 %24 to i32
%26 = or i32 %25, 128
%27 = trunc i32 %26 to i8
store i8 %27, i8* %22
br label %8
}

LLVM IR (-O2):
define void @al_code(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = trunc i32 %1 to i8
%5 = and i8 %4, 127
store i8 %5, i8* %3
%6 = icmp ult i32 %1, 128
br i1 %6, label %7, label %10
7: ; preds = %10, %2
%8 = phi i8* [ %3, %2 ], [ %15, %10 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
ret void
10: ; preds = %2, %10
%11 = phi i8 [ %17, %10 ], [ %4, %2 ]
%12 = phi i8* [ %15, %10 ], [ %3, %2 ]
%13 = phi i32 [ %14, %10 ], [ %1, %2 ]
%14 = ashr i32 %13, 7
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = or i8 %11, -128
store i8 %16, i8* %12
%17 = trunc i32 %14 to i8
%18 = and i8 %17, 127
store i8 %18, i8* %15
%19 = icmp ult i32 %13, 16384
br i1 %19, label %7, label %10
}
int getLexShort(char **readPointer) {
  int value = *(unsigned char *)(*readPointer);
  (*readPointer)++;
  value += 256 * *(unsigned char *)(*readPointer);
  (*readPointer)++;
  return value;
}


x86 assembly (clang, -O0):
<getLexShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLexShort>:
mov    (%rdi),%rcx
movzbl (%rcx),%edx
lea    0x1(%rcx),%rax
mov    %rax,(%rdi)
movzbl 0x1(%rcx),%eax
shl    $0x8,%eax
or     %edx,%eax
add    $0x2,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @getLexShort(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %8
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = mul nsw i32 256, %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @getLexShort(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %5, i8** %0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %10, i8** %0
ret i32 %9
}
/* Variables and functions */
int __bsfd(int);
int test__bsfd(int X) { return __bsfd(X); }


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

x86 assembly (clang, -O2):
<test__bsfd>:
jmp    1030 <__bsfd@plt>

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

LLVM IR (-O2):
define i32 @test__bsfd(i32 %0) {
%2 = tail call i32 @__bsfd(i32 %0)
ret i32 %2
}
void update_m2ip(void) { return; }


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

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

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

LLVM IR (-O2):
define void @update_m2ip() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int numr;
  printf("Entre com o numero de elementos: ");
  scanf("%d", &numr);
  fib(numr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <fib@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"Entre com o numero de elementos: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fib(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Entre com o numero de elementos: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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 @fib(i32 %5)
ret i32 0
}
/* Variables and functions */
void *myalloc(size_t);
void *myalloc2(size_t n) { return myalloc(n); }


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

x86 assembly (clang, -O2):
<myalloc2>:
jmp    1030 <myalloc@plt>

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

LLVM IR (-O2):
define i8* @myalloc2(i64 %0) {
%2 = tail call i8* @myalloc(i64 %0)
ret i8* %2
}
int ys(int v, char s, int g) {
  switch (s) {
  case '*':
    return v * g;
    break;
  case '/':
    return v / g;
    break;
  case '+':
    return v + g;
    break;
  case '-':
    return v - g;
    break;
  default:
    return v;
  }
}


x86 assembly (clang, -O0):
<ys>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     1174 <ys+0x74>
mov    -0x18(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <ys+0x7a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x4(%rbp)
jmp    117a <ys+0x7a>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <ys+0x7a>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117a <ys+0x7a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ys>:
mov    %edi,%eax
add    $0xffffffd6,%esi
cmp    $0x5,%esi
ja     1125 <ys+0x25>
mov    %edx,%ecx
lea    0xeed(%rip),%rdx
movslq (%rdx,%rsi,4),%rsi
add    %rdx,%rsi
jmp    *%rsi
imul   %ecx,%eax
ret
add    %ecx,%eax
ret
sub    %ecx,%eax
ret
cltd
idiv   %ecx
ret

LLVM IR (-O0):
define i32 @ys(i32 %0, i8 signext %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
switch i32 %9, label %26 [
i32 42, label %10
i32 47, label %14
i32 43, label %18
i32 45, label %22
]
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
br label %28
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = sdiv i32 %15, %16
store i32 %17, i32* %4
br label %28
18: ; preds = %3
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
store i32 %21, i32* %4
br label %28
22: ; preds = %3
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = sub nsw i32 %23, %24
store i32 %25, i32* %4
br label %28
26: ; preds = %3
%27 = load i32, i32* %5
store i32 %27, i32* %4
br label %28
28: ; preds = %26, %22, %18, %14, %10
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @ys(i32 %0, i8 signext %1, i32 %2) {
%4 = sext i8 %1 to i32
switch i32 %4, label %13 [
i32 42, label %5
i32 47, label %7
i32 43, label %9
i32 45, label %11
]
5: ; preds = %3
%6 = mul nsw i32 %2, %0
br label %13
7: ; preds = %3
%8 = sdiv i32 %0, %2
br label %13
9: ; preds = %3
%10 = add nsw i32 %2, %0
br label %13
11: ; preds = %3
%12 = sub nsw i32 %0, %2
br label %13
13: ; preds = %3, %11, %9, %7, %5
%14 = phi i32 [ %12, %11 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ %0, %3 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
int /*<<< orphan*/ date_mktime(struct tm *, int);
int /*<<< orphan*/ date_tm_to_current_pre_1970(struct tm *, int);
time_t date_tm_to_current(struct tm *tm, int utc_offset) {
  if (tm->tm_year < 70) {
    return date_tm_to_current_pre_1970(tm, utc_offset);
  } else {
    return date_mktime(tm, utc_offset);
  }
}


x86 assembly (clang, -O0):
<date_tm_to_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x46,(%rax)
jge    1150 <date_tm_to_current+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <date_tm_to_current_pre_1970@plt>
mov    %eax,-0x4(%rbp)
jmp    115f <date_tm_to_current+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <date_mktime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_tm_to_current>:
cmpl   $0x45,(%rdi)
jg     112a <date_tm_to_current+0xa>
jmp    1040 <date_tm_to_current_pre_1970@plt>
jmp    1030 <date_mktime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_tm_to_current(%struct.tm* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.tm*
%5 = alloca i32
store %struct.tm* %0, %struct.tm** %4
store i32 %1, i32* %5
%6 = load %struct.tm*, %struct.tm** %4
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 70
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load %struct.tm*, %struct.tm** %4
%12 = load i32, i32* %5
%13 = call i32 @date_tm_to_current_pre_1970(%struct.tm* %11, i32 %12)
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load %struct.tm*, %struct.tm** %4
%16 = load i32, i32* %5
%17 = call i32 @date_mktime(%struct.tm* %15, i32 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_tm_to_current(%struct.tm* %0, i32 %1) {
%3 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 70
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @date_tm_to_current_pre_1970(%struct.tm* %0, i32 %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @date_mktime(%struct.tm* %0, i32 %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int _watchdog();
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_watchdog(void) {
  int ret;
  monLock();
  ret = _watchdog();
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_watchdog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <monLock@plt>
mov    $0x0,%al
call   1040 <_watchdog@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_watchdog>:
push   %rbx
xor    %eax,%eax
call   1030 <monLock@plt>
xor    %eax,%eax
call   1040 <_watchdog@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mon_watchdog() {
%1 = alloca i32
%2 = call i32 (...) @monLock()
%3 = call i32 (...) @_watchdog()
store i32 %3, i32* %1
%4 = call i32 (...) @monUnlock()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @mon_watchdog() {
%1 = tail call i32 (...) @monLock()
%2 = tail call i32 (...) @_watchdog()
%3 = tail call i32 (...) @monUnlock()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ellipse(int, int, int, int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basEllipse() {
  int x, y, rx, ry;
  ry = popNumber();
  rx = popNumber();
  y = popNumber();
  x = popNumber();
  pushNumber(ellipse(x, y, rx, ry));
}


x86 assembly (clang, -O0):
<basEllipse>:
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 <ellipse@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basEllipse>:
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 <ellipse@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basEllipse() {
%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 @ellipse(i32 %9, i32 %10, i32 %11, i32 %12)
%14 = call i32 @pushNumber(i32 %13)
ret void
}

LLVM IR (-O2):
define void @basEllipse() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 (...) @popNumber()
%4 = tail call i32 (...) @popNumber()
%5 = tail call i32 @ellipse(i32 %4, i32 %3, i32 %2, i32 %1)
%6 = tail call i32 @pushNumber(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ChipResetStateMachine();
int /*<<< orphan*/ EventCheck();
int /*<<< orphan*/ InterruptCheck();
int /*<<< orphan*/ PsPollCheck();
int /*<<< orphan*/ RxPacketCheck();
void WF_Task(void) {
  ChipResetStateMachine();
  EventCheck();
  InterruptCheck();
  RxPacketCheck();
  PsPollCheck();
}


x86 assembly (clang, -O0):
<WF_Task>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <ChipResetStateMachine@plt>
mov    $0x0,%al
call   1030 <EventCheck@plt>
mov    $0x0,%al
call   1040 <InterruptCheck@plt>
mov    $0x0,%al
call   1050 <RxPacketCheck@plt>
mov    $0x0,%al
call   1060 <PsPollCheck@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WF_Task>:
push   %rax
xor    %eax,%eax
call   1070 <ChipResetStateMachine@plt>
xor    %eax,%eax
call   1030 <EventCheck@plt>
xor    %eax,%eax
call   1040 <InterruptCheck@plt>
xor    %eax,%eax
call   1050 <RxPacketCheck@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <PsPollCheck@plt>

LLVM IR (-O0):
define void @WF_Task() {
%1 = call i32 (...) @ChipResetStateMachine()
%2 = call i32 (...) @EventCheck()
%3 = call i32 (...) @InterruptCheck()
%4 = call i32 (...) @RxPacketCheck()
%5 = call i32 (...) @PsPollCheck()
ret void
}

LLVM IR (-O2):
define void @WF_Task() {
%1 = tail call i32 (...) @ChipResetStateMachine()
%2 = tail call i32 (...) @EventCheck()
%3 = tail call i32 (...) @InterruptCheck()
%4 = tail call i32 (...) @RxPacketCheck()
%5 = tail call i32 (...) @PsPollCheck()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int main() {
  int x;
  printf("x value:     %d\n", x);
  printf("x address:   %p\n", (void *)&x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movslq -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
lea    0xed7(%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
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"x value: %d\0A\00"
@.str.1 = [17 x i8] c"x address: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* null)
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
void database_term(sqlite3 *db) { sqlite3_close(db); }


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

x86 assembly (clang, -O2):
<database_term>:
jmp    1030 <sqlite3_close@plt>

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

LLVM IR (-O2):
define void @database_term(i32* %0) {
%2 = tail call i32 @sqlite3_close(i32* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
int fm_test_bit(const uint8_t *bmap, const uint64_t bit) {
  return (bmap[bit >> 3] >> (bit & 7)) & 1;
}


x86 assembly (clang, -O0):
<fm_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm_test_bit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fm_test_bit(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 = ashr i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = and i32 %11, 7
%13 = ashr i32 %10, %12
%14 = and i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @fm_test_bit(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
void do_nothing(void *item) {}


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

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

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

LLVM IR (-O2):
define void @do_nothing(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *print_message_function(void *ptr) {
  char *message;
  message = (char *)ptr;
  printf("%s \n", message);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_message_function>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define noalias i8* @print_message_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}
unsigned long sec_to_jiffies(int sec) { return 1000000ULL * sec / 10000; }


x86 assembly (clang, -O0):
<sec_to_jiffies>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
imul   $0xf4240,%rax,%rax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec_to_jiffies>:
movslq %edi,%rax
imul   $0xf4240,%rax,%rax
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
mul    %rcx
mov    %rdx,%rax
shr    $0xb,%rax
ret

LLVM IR (-O0):
define i64 @sec_to_jiffies(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 1000000, %4
%6 = udiv i64 %5, 10000
ret i64 %6
}

LLVM IR (-O2):
define i64 @sec_to_jiffies(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul nsw i64 %2, 1000000
%4 = udiv i64 %3, 10000
ret i64 %4
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ schedule();
void scheduler_tick(struct task_struct *p) { schedule(); }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define void @scheduler_tick(%struct.task_struct* nocapture readnone %0) {
%2 = tail call i32 (...) @schedule()
ret void
}