xunge/DecIR huggingface dataset:
void exynos_disable_idle_clock_down(unsigned int cluster) {}


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

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

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

LLVM IR (-O2):
define void @exynos_disable_idle_clock_down(i32 %0) {
ret void
}
/* Variables and functions */
int different();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", different());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @different()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
bool bitmap_save(void *bitmap, const char *path, unsigned flags) {
  return true;
}


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

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

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

LLVM IR (-O2):
define i32 @bitmap_save(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 1
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ create_child(struct Node *, int const);
struct Node *node_new(int);
struct Node *f(const int len) {
  struct Node *s = node_new(777);
  create_child(s, len);
  return s;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x309,%edi
call   1030 <node_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <create_child@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x309,%edi
call   1030 <node_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <create_child@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
define %struct.Node* @f(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.Node*
store i32 %0, i32* %2
%4 = call %struct.Node* @node_new(i32 777)
store %struct.Node* %4, %struct.Node** %3
%5 = load %struct.Node*, %struct.Node** %3
%6 = load i32, i32* %2
%7 = call i32 @create_child(%struct.Node* %5, i32 %6)
%8 = load %struct.Node*, %struct.Node** %3
ret %struct.Node* %8
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define %struct.Node* @f(i32 %0) {
%2 = tail call %struct.Node* @node_new(i32 777)
%3 = tail call i32 @create_child(%struct.Node* %2, i32 %0)
ret %struct.Node* %2
}
int dev_open_default(struct device_d *dev, struct filep *f) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device_d = type opaque
%struct.filep = type opaque
define i32 @dev_open_default(%struct.device_d* nocapture readnone %0, %struct.filep* nocapture readnone %1) {
ret i32 0
}
int test_imm_36uint8_mem(unsigned char *val) {
  return ((*val) & (-0x36 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_36uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -54
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct uwsgi_stats {
  int dummy;
};

/* Variables and functions */
int uwsgi_stats_comma(struct uwsgi_stats *);
int uwsgi_stats_keyslong(struct uwsgi_stats *, char *, long long);
int uwsgi_stats_keyslong_comma(struct uwsgi_stats *us, char *key,
                               long long num) {
  int ret = uwsgi_stats_keyslong(us, key, num);
  if (ret)
    return -1;
  return uwsgi_stats_comma(us);
}


x86 assembly (clang, -O0):
<uwsgi_stats_keyslong_comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <uwsgi_stats_keyslong@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115e <uwsgi_stats_keyslong_comma+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <uwsgi_stats_keyslong_comma+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <uwsgi_stats_comma@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_stats_keyslong_comma>:
push   %rbx
mov    %rdi,%rbx
call   1030 <uwsgi_stats_keyslong@plt>
test   %eax,%eax
je     1134 <uwsgi_stats_keyslong_comma+0x14>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <uwsgi_stats_comma@plt>

LLVM IR (-O0):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_keyslong_comma(%struct.uwsgi_stats* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.uwsgi_stats*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store %struct.uwsgi_stats* %0, %struct.uwsgi_stats** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load %struct.uwsgi_stats*, %struct.uwsgi_stats** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @uwsgi_stats_keyslong(%struct.uwsgi_stats* %9, i8* %10, i64 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %19
16: ; preds = %3
%17 = load %struct.uwsgi_stats*, %struct.uwsgi_stats** %5
%18 = call i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_keyslong_comma(%struct.uwsgi_stats* %0, i8* %1, i64 %2) {
%4 = tail call i32 @uwsgi_stats_keyslong(%struct.uwsgi_stats* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %0)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
void libera(double **M, long n) {
  long i;
  if (!M)
    return;
  for (i = 0; i < n; i++)
    free(M[i]);
  free(M);
}


x86 assembly (clang, -O0):
<libera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1130 <libera+0x20>
jmp    1171 <libera+0x61>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1168 <libera+0x58>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <libera+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libera>:
test   %rdi,%rdi
je     114f <libera+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
test   %rsi,%rsi
jle    1142 <libera+0x32>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <libera+0x20>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @libera(double** %0, i64 %1) {
%3 = alloca double**
%4 = alloca i64
%5 = alloca i64
store double** %0, double*** %3
store i64 %1, i64* %4
%6 = load double**, double*** %3
%7 = icmp ne double** %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
br label %26
9: ; preds = %2
store i64 0, i64* %5
br label %10
10: ; preds = %20, %9
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = icmp slt i64 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load double**, double*** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds double*, double** %15, i64 %16
%18 = load double*, double** %17
%19 = bitcast double* %18 to i8*
br label %20
20: ; preds = %14
%21 = load i64, i64* %5
%22 = add nsw i64 %21, 1
store i64 %22, i64* %5
br label %10
23: ; preds = %10
%24 = load double**, double*** %3
%25 = bitcast double** %24 to i8*
br label %26
26: ; preds = %23, %8
ret void
}

LLVM IR (-O2):
define void @libera(double** %0, i64 %1) {
%3 = icmp eq double** %0, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = icmp sgt i64 %1, 0
br i1 %5, label %6, label %13
6: ; preds = %4, %6
%7 = phi i64 [ %11, %6 ], [ 0, %4 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %6
13: ; preds = %6, %4
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %2, %13
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int time_t;

/* Variables and functions */
double difftime(int, int);
int time(int /*<<< orphan*/ *);
uint32_t vhd_calc_timestamp(void) {
  time_t start_time;
  time_t curr_time;
  double vhd_time;
  start_time = 946684800;
  curr_time = time(NULL);
  vhd_time = difftime(curr_time, start_time);
  return (uint32_t)vhd_time;
}


x86 assembly (clang, -O0):
<vhd_calc_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x386d4380,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <difftime@plt>
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhd_calc_timestamp>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
mov    $0x386d4380,%esi
call   1030 <difftime@plt>
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vhd_calc_timestamp() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 946684800, i32* %1
%4 = call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = call double @difftime(i32 %5, i32 %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @vhd_calc_timestamp() {
%1 = tail call i32 @time(i32* null)
%2 = tail call double @difftime(i32 %1, i32 946684800)
%3 = fptosi double %2 to i32
ret i32 %3
}
unsigned long hash(const char *str) {
  unsigned long h = 0;
  while (*str) {
    h = (h << 4) + (unsigned char)*str++;
    if (h & 0xf0000000)
      h = (h ^ (h >> 24)) & 0xfffffff;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1174 <hash+0x74>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     116f <hash+0x6f>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x18,%rcx
xor    %rcx,%rax
and    $0xfffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113e <hash+0x3e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movzbl %cl,%ecx
add    %rax,%rcx
mov    %rcx,%rax
shr    $0x18,%rax
xor    %ecx,%eax
and    $0xfffffff,%eax
test   $0xf0000000,%ecx
cmove  %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %25, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %26
8: ; preds = %4
%9 = load i64, i64* %3
%10 = shl i64 %9, 4
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = zext i8 %13 to i64
%15 = add i64 %10, %14
store i64 %15, i64* %3
%16 = load i64, i64* %3
%17 = and i64 %16, 4026531840
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %8
%20 = load i64, i64* %3
%21 = load i64, i64* %3
%22 = lshr i64 %21, 24
%23 = xor i64 %20, %22
%24 = and i64 %23, 268435455
store i64 %24, i64* %3
br label %25
25: ; preds = %19, %8
br label %4
26: ; preds = %4
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %18, %4 ], [ %2, %1 ]
%6 = phi i64 [ %17, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i64 %6, 4
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %5 to i64
%11 = add i64 %8, %10
%12 = and i64 %11, 4026531840
%13 = icmp eq i64 %12, 0
%14 = lshr i64 %11, 24
%15 = xor i64 %14, %11
%16 = and i64 %15, 268435455
%17 = select i1 %13, i64 %11, i64 %16
%18 = load i8, i8* %9
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %4
20: ; preds = %4, %1
%21 = phi i64 [ 0, %1 ], [ %17, %4 ]
ret i64 %21
}
/* Variables and functions */
int binomialCoeff(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int n = 5, k = 2;
  printf("Value of C(%d, %d) is %d \n", n, k, binomialCoeff(n, k));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <binomialCoeff@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x2,%esi
call   1040 <binomialCoeff@plt>
lea    0xec9(%rip),%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"Value of C(%d, %d) is %d \0A\00"
define i32 @main() {
%1 = tail call i32 @binomialCoeff(i32 5, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 5, i32 2, i32 %1)
ret i32 0
}
int test_imm_2Euint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x2E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Euint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3014656
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_to_screen(char *, char *, int);
int get_rudder_angle() {
  int current_rudder_angle = 0;
  print_to_screen("global", "current rudder angle", current_rudder_angle);
  return current_rudder_angle;
}


x86 assembly (clang, -O0):
<get_rudder_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xed7(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <print_to_screen@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"global\00"
@.str.1 = [21 x i8] c"current rudder angle\00"
define i32 @get_rudder_angle() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @print_to_screen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"global\00"
@.str.1 = [21 x i8] c"current rudder angle\00"
define i32 @get_rudder_angle() {
%1 = tail call i32 @print_to_screen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ getuid();
__attribute__((__weak__, __always___)) uid_t softboundcets_getuid(void) {
  return getuid();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundcets_getuid() {
%1 = call i32 (...) @getuid()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundcets_getuid() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
double reduce(double cur, double new) { return cur + new; }


x86 assembly (clang, -O0):
<reduce>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @reduce(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @reduce(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int tet_multiple(char *, int);
int tet_one(char *, int /*<<< orphan*/);
int check_colrow(char *str, int tet) {
  int val;
  if (tet == 1)
    val = tet_one(str, 0);
  if (tet > 1)
    val = tet_multiple(str, tet);
  if (val)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<check_colrow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1147 <check_colrow+0x27>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <tet_one@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1160 <check_colrow+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <tet_multiple@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1176 <check_colrow+0x56>
movl   $0x1,-0x4(%rbp)
jmp    117d <check_colrow+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_colrow>:
push   %rax
cmp    $0x1,%esi
jne    112f <check_colrow+0xf>
xor    %esi,%esi
call   1030 <tet_one@plt>
jmp    1136 <check_colrow+0x16>
jle    1136 <check_colrow+0x16>
call   1040 <tet_multiple@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_colrow(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @tet_one(i8* %0, i32 0)
br label %10
6: ; preds = %2
%7 = icmp sgt i32 %1, 1
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @tet_multiple(i8* %0, i32 %1)
br label %10
10: ; preds = %4, %8, %6
%11 = phi i32 [ %9, %8 ], [ undef, %6 ], [ %5, %4 ]
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
int rotate_right(unsigned int num, unsigned int count) {
  count = count % 32;
  return (num >> count) | (num << (32 - count));
}


x86 assembly (clang, -O0):
<rotate_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotate_right(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = urem i32 %5, 32
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = lshr i32 %7, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub i32 32, %11
%13 = shl i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @rotate_right(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshr.i32(i32 %0, i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "df", message); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [3 x i8] c"df\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLUquadricObj;

/* Variables and functions */
int /*<<< orphan*/ GLU_FILL;
int /*<<< orphan*/ GLU_SMOOTH;
int /*<<< orphan*/ *gluNewQuadric();
int /*<<< orphan*/ gluQuadricDrawStyle(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ gluQuadricNormals(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ gluSphere(int /*<<< orphan*/ *, double, int, int);
void myDrawFootball1(void) {
  GLUquadricObj *qobj;
  qobj = gluNewQuadric();
  gluQuadricDrawStyle(qobj, GLU_FILL);
  gluQuadricNormals(qobj, GLU_SMOOTH);
  gluSphere(qobj, 2.30, 30, 30);
}


x86 assembly (clang, -O0):
<myDrawFootball1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gluNewQuadric@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
call   1050 <gluQuadricDrawStyle@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
call   1060 <gluQuadricNormals@plt>
mov    -0x8(%rbp),%rdi
movsd  0xe7d(%rip),%xmm0
mov    $0x1e,%edx
mov    %edx,%esi
call   1040 <gluSphere@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myDrawFootball1>:
push   %rbx
xor    %eax,%eax
call   1030 <gluNewQuadric@plt>
mov    %rax,%rbx
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <gluQuadricDrawStyle@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1060 <gluQuadricNormals@plt>
movsd  0xe8b(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    $0x1e,%edx
pop    %rbx
jmp    1040 <gluSphere@plt>

LLVM IR (-O0):
@GLU_FILL = global i32 0
@GLU_SMOOTH = global i32 0
define void @myDrawFootball1() {
%1 = alloca i32*
%2 = call i32* (...) @gluNewQuadric()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = load i32, i32* @GLU_FILL
%5 = call i32 @gluQuadricDrawStyle(i32* %3, i32 %4)
%6 = load i32*, i32** %1
%7 = load i32, i32* @GLU_SMOOTH
%8 = call i32 @gluQuadricNormals(i32* %6, i32 %7)
%9 = load i32*, i32** %1
%10 = call i32 @gluSphere(i32* %9, double 2.300000e+00, i32 30, i32 30)
ret void
}

LLVM IR (-O2):
@GLU_FILL = global i32 0
@GLU_SMOOTH = global i32 0
define void @myDrawFootball1() {
%1 = tail call i32* (...) @gluNewQuadric()
%2 = load i32, i32* @GLU_FILL
%3 = tail call i32 @gluQuadricDrawStyle(i32* %1, i32 %2)
%4 = load i32, i32* @GLU_SMOOTH
%5 = tail call i32 @gluQuadricNormals(i32* %1, i32 %4)
%6 = tail call i32 @gluSphere(i32* %1, double 2.300000e+00, i32 30, i32 30)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void die(char *msg) {
  printf("--- %s error ---\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"--- %s error ---\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"--- %s error ---\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int EVP_DigestFinal_ex(int /*<<< orphan*/ *, unsigned char *, unsigned int *);
int /*<<< orphan*/ EVP_MD_CTX_cleanup(int /*<<< orphan*/ *);
int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) {
  int ret;
  ret = EVP_DigestFinal_ex(ctx, md, size);
  EVP_MD_CTX_cleanup(ctx);
  return ret;
}


x86 assembly (clang, -O0):
<EVP_DigestFinal>:
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 <EVP_DigestFinal_ex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <EVP_MD_CTX_cleanup@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_DigestFinal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <EVP_DigestFinal_ex@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <EVP_MD_CTX_cleanup@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @EVP_DigestFinal(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = call i32 @EVP_DigestFinal_ex(i32* %8, i8* %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = call i32 @EVP_MD_CTX_cleanup(i32* %12)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @EVP_DigestFinal(i32* %0, i8* %1, i32* %2) {
%4 = tail call i32 @EVP_DigestFinal_ex(i32* %0, i8* %1, i32* %2)
%5 = tail call i32 @EVP_MD_CTX_cleanup(i32* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int L, D, K, P;
  scanf(" %d %d", &L, &D);
  scanf(" %d %d", &K, &P);
  printf("%d", L * K + L / D * P);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0x10(%rbp),%esi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
imul   -0x14(%rbp),%eax
add    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    0x4(%rsp),%esi
mov    %ecx,%eax
cltd
idivl  0x8(%rsp)
imul   %ecx,%esi
imul   (%rsp),%eax
add    %eax,%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5)
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sdiv i32 %11, %12
%14 = load i32, i32* %5
%15 = mul nsw i32 %13, %14
%16 = add nsw i32 %10, %15
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c" %d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%11 = load i32, i32* %1
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, %11
%14 = load i32, i32* %2
%15 = sdiv i32 %11, %14
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, %15
%18 = add nsw i32 %17, %13
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 0
}
void Hal_hook_rd_sgnbfield_bitb(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgnbfield_bitb() {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *strptime(char const *, char *, struct tm *);
char *nlr_strptime(const char *s, struct tm *tm) {
  return strptime(s, "%Y-%m-%d", tm);
}


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

x86 assembly (clang, -O2):
<nlr_strptime>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <strptime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%Y-%m-%d\00"
define i8* @nlr_strptime(i8* %0, %struct.tm* %1) {
%3 = alloca i8*
%4 = alloca %struct.tm*
store i8* %0, i8** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load i8*, i8** %3
%6 = load %struct.tm*, %struct.tm** %4
%7 = call i8* @strptime(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%Y-%m-%d\00"
define i8* @nlr_strptime(i8* %0, %struct.tm* %1) {
%3 = tail call i8* @strptime(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %1)
ret i8* %3
}
void seterr(const char *err) {
  if (err) {
  }
}


x86 assembly (clang, -O0):
<seterr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <seterr+0x18>
jmp    1118 <seterr+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @seterr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @seterr(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void testTaintedVLASize() {
  int x;
  scanf("%d", &x);
  int vla[x];
}


x86 assembly (clang, -O0):
<testTaintedVLASize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTaintedVLASize>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @testTaintedVLASize() {
%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)
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_zero(float *);
__attribute__((always_)) struct vec3 *psvec3_zero(struct vec3 *result) {
  vec3_zero((float *)result);
  return result;
}


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

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

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_zero(%struct.vec3* %0) {
%2 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %2
%3 = load %struct.vec3*, %struct.vec3** %2
%4 = bitcast %struct.vec3* %3 to float*
%5 = call i32 @vec3_zero(float* %4)
%6 = load %struct.vec3*, %struct.vec3** %2
ret %struct.vec3* %6
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_zero(%struct.vec3* returned %0) {
%2 = bitcast %struct.vec3* %0 to float*
%3 = tail call i32 @vec3_zero(float* %2)
ret %struct.vec3* %0
}
long IO_ConvertSigned(int c) {
  return (c & 0x80) ? (((long)c) & 0x7f) - 128 : ((long)c) & 0x7f;
}


x86 assembly (clang, -O0):
<IO_ConvertSigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112f <IO_ConvertSigned+0x2f>
movslq -0x4(%rbp),%rax
and    $0x7f,%rax
sub    $0x80,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <IO_ConvertSigned+0x3b>
movslq -0x4(%rbp),%rax
and    $0x7f,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IO_ConvertSigned>:
mov    %rdi,%rax
or     $0xffffffffffffff80,%rax
mov    %edi,%ecx
and    $0x7f,%ecx
test   $0x80,%dil
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @IO_ConvertSigned(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = and i64 %8, 127
%10 = sub nsw i64 %9, 128
br label %15
11: ; preds = %1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = and i64 %13, 127
br label %15
15: ; preds = %11, %6
%16 = phi i64 [ %10, %6 ], [ %14, %11 ]
ret i64 %16
}

LLVM IR (-O2):
define i64 @IO_ConvertSigned(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = zext i32 %0 to i64
%5 = or i64 %4, -128
%6 = and i32 %0, 127
%7 = zext i32 %6 to i64
%8 = select i1 %3, i64 %7, i64 %5
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ PAPI_shutdown();
void papif_shutdown(void) { PAPI_shutdown(); }


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

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

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

LLVM IR (-O2):
define void @papif_shutdown() {
%1 = tail call i32 (...) @PAPI_shutdown()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void SetToNonZero(void) {
  static int g = 5;
  clang_analyzer_eval(g == 5);
}


x86 assembly (clang, -O0):
<SetToNonZero>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x5,0x2f0d(%rip)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetToNonZero>:
mov    $0x1,%edi
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@SetToNonZero.g = internal global i32 5
define void @SetToNonZero() {
%1 = load i32, i32* @SetToNonZero.g
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
define void @SetToNonZero() {
%1 = tail call i32 @clang_analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ destruct(int /*<<< orphan*/);
int /*<<< orphan*/ this_object();
void remove() { destruct(this_object()); }


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <this_object@plt>
mov    %eax,%edi
call   1040 <destruct@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rax
xor    %eax,%eax
call   1030 <this_object@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <destruct@plt>

LLVM IR (-O0):
define void @remove() {
%1 = call i32 (...) @this_object()
%2 = call i32 @destruct(i32 %1)
ret void
}

LLVM IR (-O2):
define void @remove() {
%1 = tail call i32 (...) @this_object()
%2 = tail call i32 @destruct(i32 %1)
ret void
}
int hasdot(str)
char *str;
{
  while (*str)
    if (*str++ == '.')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<hasdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hasdot+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    113c <hasdot+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1148 <hasdot+0x48>
jmp    1108 <hasdot+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasdot>:
movzbl (%rdi),%eax
test   %al,%al
je     1115 <hasdot+0x15>
add    $0x1,%rdi
cmp    $0x2e,%al
jne    1100 <hasdot>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hasdot(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 46
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void __attribute__((destructor)) fini(void) { write(1, "6", 1); }


x86 assembly (clang, -O0):
<fini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
lea    0xee0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fini>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"6\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"6\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct timeval {
  unsigned long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
unsigned long long timerfold(struct timeval *tv) {
  return tv->tv_sec * 1000000ULL + tv->tv_usec;
}


x86 assembly (clang, -O0):
<timerfold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%rax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerfold>:
imul   $0xf4240,(%rdi),%rax
add    0x8(%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @timerfold(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @timerfold(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = add i64 %4, %6
ret i64 %7
}
void foo646() {}


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

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

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

LLVM IR (-O2):
define void @foo646() {
ret void
}
int test_imm_3Buint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x3B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Buint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3866624
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void CS_finish(void) { ; }


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

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

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

LLVM IR (-O2):
define void @CS_finish() {
ret void
}