xunge/DecIR huggingface dataset:
int offset(int x, int m, int s) {
  if (s > 0)
    return x;
  else {
    const int n = 1 << (m - 1);
    const int o = (1 << m) - 1;
    return (x + n) & o;
  }
}


x86 assembly (clang, -O0):
<offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1122 <offset+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <offset+0x4e>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset>:
mov    %edi,%eax
test   %edx,%edx
jle    1107 <offset+0x7>
ret
lea    -0x1(%rsi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    $0xffffffff,%edi
mov    %esi,%ecx
shl    %cl,%edi
not    %edi
add    %eax,%edx
and    %edi,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @offset(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
store i32 %13, i32* %4
br label %26
14: ; preds = %3
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, 1
%17 = shl i32 1, %16
store i32 %17, i32* %8
%18 = load i32, i32* %6
%19 = shl i32 1, %18
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %9
%21 = load i32, i32* %5
%22 = load i32, i32* %8
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %9
%25 = and i32 %23, %24
store i32 %25, i32* %4
br label %26
26: ; preds = %14, %12
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @offset(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = add nsw i32 %1, -1
%7 = shl nuw i32 1, %6
%8 = shl nsw i32 -1, %1
%9 = xor i32 %8, -1
%10 = add nsw i32 %7, %0
%11 = and i32 %10, %9
br label %12
12: ; preds = %3, %5
%13 = phi i32 [ %11, %5 ], [ %0, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ get_result(struct chirp_client *, int /*<<< orphan*/);
int64_t chirp_client_fsync_finish(struct chirp_client *c, int64_t fd,
                                  time_t stoptime) {
  return get_result(c, stoptime);
}


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

x86 assembly (clang, -O2):
<chirp_client_fsync_finish>:
mov    %edx,%esi
jmp    1030 <get_result@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
define i32 @chirp_client_fsync_finish(%struct.chirp_client* %0, i32 %1, i32 %2) {
%4 = alloca %struct.chirp_client*
%5 = alloca i32
%6 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.chirp_client*, %struct.chirp_client** %4
%8 = load i32, i32* %6
%9 = call i32 @get_result(%struct.chirp_client* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
define i32 @chirp_client_fsync_finish(%struct.chirp_client* %0, i32 %1, i32 %2) {
%4 = tail call i32 @get_result(%struct.chirp_client* %0, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ file1_func2();
void file1_func1(void) { file1_func2(); }


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

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

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

LLVM IR (-O2):
define void @file1_func1() {
%1 = tail call i32 (...) @file1_func2()
ret void
}
/* Variables and functions */
size_t malloc_usable_size(void *);
size_t __memoria_tamanio(void *ptr) { return malloc_usable_size(ptr); }


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

x86 assembly (clang, -O2):
<__memoria_tamanio>:
jmp    1030 <malloc_usable_size@plt>

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

LLVM IR (-O2):
define i64 @__memoria_tamanio(i8* %0) {
%2 = tail call i64 @malloc_usable_size(i8* %0)
ret i64 %2
}
void gtk_cell_layout_set_attributes() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_layout_set_attributes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_GPIO();
scalar_t__ getPin(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void set_GPIO_transmit() {
  char pin[3];
  if (getPin(pin))
    return;
  config_GPIO();
  char cmd[50];
  sprintf(cmd, "  echo \"1\" > /sys/class/gpio/gpio%s/value", pin);
  system(cmd);
}


x86 assembly (clang, -O0):
<set_GPIO_transmit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x3(%rbp),%rdi
call   1050 <getPin@plt>
cmp    $0x0,%rax
je     1160 <set_GPIO_transmit+0x20>
jmp    1184 <set_GPIO_transmit+0x44>
mov    $0x0,%al
call   1040 <config_GPIO@plt>
lea    -0x40(%rbp),%rdi
lea    -0x3(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_GPIO_transmit>:
push   %rbx
sub    $0x50,%rsp
lea    0xd(%rsp),%rdi
call   1050 <getPin@plt>
test   %rax,%rax
jne    117c <set_GPIO_transmit+0x3c>
xor    %eax,%eax
call   1040 <config_GPIO@plt>
lea    0xe9e(%rip),%rsi
lea    0x10(%rsp),%rbx
lea    0xd(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c" echo \221\22 > /sys/class/gpio/gpio%s/value\00"
define void @set_GPIO_transmit() {
%1 = alloca [3 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i64 @getPin(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %14
7: ; preds = %0
%8 = call i32 (...) @config_GPIO()
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%13 = call i32 @system(i8* %12)
br label %14
14: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c" echo \221\22 > /sys/class/gpio/gpio%s/value\00"
define void @set_GPIO_transmit() {
%1 = alloca [3 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i64 @getPin(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = call i32 (...) @config_GPIO()
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %3)
%10 = call i32 @system(i8* %8)
br label %11
11: ; preds = %0, %6
ret void
}
void foo023(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo023(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_units_endunit();
void fgmvwrite_units_endunit_() { gmvwrite_units_endunit(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_units_endunit_() {
%1 = tail call i32 (...) @gmvwrite_units_endunit()
ret void
}
/* Variables and functions */
double dasum_(int *, double *, int *);
double dasum(int N, double *X, int INCX) { return dasum_(&N, X, &INCX); }


x86 assembly (clang, -O0):
<dasum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
call   1030 <dasum_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dasum>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
call   1030 <dasum_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @dasum(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %2, i32* %5
%6 = call double @dasum_(i32* %4, double* %1, i32* %5)
ret double %6
}
void callme(void (*cb)()) {
  int i;
  for (i = 0; i < 10; i++)
    cb();
}


x86 assembly (clang, -O0):
<callme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1130 <callme+0x30>
mov    $0x0,%al
call   *-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <callme+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callme>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   *%rdi
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

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

LLVM IR (-O2):
define void @callme(void (...)* nocapture %0) {
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
tail call void (...) %0()
ret void
}
void rop3_3_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T | S;
  stk1 = ~stk1;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


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

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

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

LLVM IR (-O2):
define void @rop3_3_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = xor i8 %2, -1
%7 = or i8 %5, %6
%8 = and i8 %7, %4
store i8 %8, i8* %0
ret void
}
int test_imm_EBuint8_mem(unsigned char *val) {
  return ((*val) & (-0xEB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EBuint8_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, -235
%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_EBuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 21
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double ___yn(int, double *);
double y1(double x) { return ___yn(1, &x); }


x86 assembly (clang, -O0):
<y1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
call   1030 <___yn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<y1>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1030 <___yn@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @y1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @___yn(i32 1, double* %2)
ret double %3
}

LLVM IR (-O2):
define double @y1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @___yn(i32 1, double* %2)
ret double %3
}
/* Type definitions */
typedef scalar_t__ key_t;

/* Variables and functions */
scalar_t__ osd_getkey(char *);
int semget(scalar_t__, int /*<<< orphan*/, int /*<<< orphan*/);
int open_semaphore(char *name) {
  int status;
  key_t key;
  key = (key_t)osd_getkey(name);
  status = semget(key, 0, 0);
  if (status < 0)
    return (0);
  else
    return status;
}


x86 assembly (clang, -O0):
<open_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <osd_getkey@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <semget@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115f <open_semaphore+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1165 <open_semaphore+0x45>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_semaphore>:
push   %rbx
call   1040 <osd_getkey@plt>
xor    %ebx,%ebx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <semget@plt>
test   %eax,%eax
cmovs  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @open_semaphore(i8* %0) {
%2 = tail call i64 @osd_getkey(i8* %0)
%3 = tail call i32 @semget(i64 %2, i32 0, i32 0)
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Type definitions */
struct vec2i {
  int dummy;
};
struct vec2 {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2_assign_vec2i(float *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2 *psvec2_assign_vec2i(struct vec2 *result,
                                                          struct vec2i *a) {
  vec2_assign_vec2i((float *)result, (int32_t *)a);
  return result;
}


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

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

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

LLVM IR (-O2):
%struct.vec2 = type { i32 }
%struct.vec2i = type { i32 }
define %struct.vec2* @psvec2_assign_vec2i(%struct.vec2* returned %0, %struct.vec2i* %1) {
%3 = bitcast %struct.vec2* %0 to float*
%4 = getelementptr %struct.vec2i, %struct.vec2i* %1, i64 0, i32 0
%5 = tail call i32 @vec2_assign_vec2i(float* %3, i32* %4)
ret %struct.vec2* %0
}
/* Variables and functions */
long internal__syscall5(long, long, long, long, long, long);
long __syscall5(long n, long a1, long a2, long a3, long a4, long a5) {
  return internal__syscall5(n, a1, a2, a3, a4, a5);
}


x86 assembly (clang, -O0):
<__syscall5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <internal__syscall5@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall5>:
jmp    1030 <internal__syscall5@plt>

LLVM IR (-O0):
define i64 @__syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = load i64, i64* %11
%18 = load i64, i64* %12
%19 = call i64 @internal__syscall5(i64 %13, i64 %14, i64 %15, i64 %16, i64 %17, i64 %18)
ret i64 %19
}

LLVM IR (-O2):
define i64 @__syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = tail call i64 @internal__syscall5(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ hmac_sha1(unsigned char *, size_t, unsigned char *, size_t,
                             unsigned char *);
char *oauth_encode_base64(int, unsigned char *);
char *oauth_sign_hmac_sha1_raw(const char *m, size_t ml, const char *k,
                               size_t kl) {
  unsigned char result[20];
  hmac_sha1((unsigned char *)k, kl, (unsigned char *)m, ml, result);
  return oauth_encode_base64(20, result);
}


x86 assembly (clang, -O0):
<oauth_sign_hmac_sha1_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x40(%rbp),%r8
call   1030 <hmac_sha1@plt>
lea    -0x40(%rbp),%rsi
mov    $0x14,%edi
call   1040 <oauth_encode_base64@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oauth_sign_hmac_sha1_raw>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r8
mov    %rdi,%rax
mov    %rsp,%rbx
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %rax,%rdx
mov    %r8,%rcx
mov    %rbx,%r8
call   1030 <hmac_sha1@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
call   1040 <oauth_encode_base64@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @oauth_sign_hmac_sha1_raw(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca [20 x i8]
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %7
%11 = load i64, i64* %8
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%15 = call i32 @hmac_sha1(i8* %10, i64 %11, i8* %12, i64 %13, i8* %14)
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%17 = call i8* @oauth_encode_base64(i32 20, i8* %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @oauth_sign_hmac_sha1_raw(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca [20 x i8]
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = call i32 @hmac_sha1(i8* %2, i64 %3, i8* %0, i64 %1, i8* %6)
%8 = call i8* @oauth_encode_base64(i32 20, i8* %6)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char s[16];
  printf("String please: ");
  scanf("%s", s);
  printf("Thanks for the %s!\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"String please: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"Thanks for the %s!\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"String please: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"Thanks for the %s!\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int j;
  int k;
  assume(i < j && k > i - j);
  while (i < j) {
    k = k + 1;
    i = i + 1;
  }
  assert(k > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jge    1151 <main+0x31>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1181 <main+0x61>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x3e>
cmpl   $0x0,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
%13 = icmp sgt i32 %9, %12
br label %14
14: ; preds = %8, %0
%15 = phi i1 [ false, %0 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assume(i32 %16)
br label %18
18: ; preds = %22, %14
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %18
27: ; preds = %18
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 0
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
void UARTDMAEnable(unsigned int baseAdd, unsigned int flags) {
  (*((volatile unsigned int *)(baseAdd + (0x8)))) =
      (flags & ((0x00000001u) | (0x00000008u) | (0x000000C0u)));
}


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

x86 assembly (clang, -O2):
<UARTDMAEnable>:
and    $0xc9,%esi
add    $0x8,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTDMAEnable(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 = and i32 %5, 201
%7 = load i32, i32* %3
%8 = add i32 %7, 8
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %6, i32* %10
ret void
}

LLVM IR (-O2):
define void @UARTDMAEnable(i32 %0, i32 %1) {
%3 = and i32 %1, 201
%4 = add i32 %0, 8
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %3, i32* %6
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_sapxsumkbn(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_sapxsumkbn(N, 5.0f, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1030 <stdlib_strided_sapxsumkbn@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_sapxsumkbn@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_sapxsumkbn(i32 %6, float 5.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_sapxsumkbn(i32 4, float 5.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
int _fips_qcrypto_aead_selftest(struct fips_selftest_data *selftest_d) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.fips_selftest_data = type opaque
define i32 @_fips_qcrypto_aead_selftest(%struct.fips_selftest_data* nocapture readnone %0) {
ret i32 0
}
void cloudbox_init(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_set_preview_widget() {
ret void
}
void outb(unsigned short port, unsigned char val) {
  asm volatile("outb %b0, %w1" : : "a"(val), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb ${0:b}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yyparse();
int main(int argc, const char *argv[]) {
  yyparse();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @yyparse()
ret i32 0
}
/* Variables and functions */
scalar_t__ tolower(int);
char util_tolower(char c) { return (char)tolower((int)c); }


x86 assembly (clang, -O0):
<util_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_tolower>:
push   %rax
call   1030 <tolower@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @util_tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = call i64 @tolower(i32 %4)
%6 = trunc i64 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @util_tolower(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i64 @tolower(i32 %2)
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int count(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  int k;
  scanf("%d", &k);
  int dearrangements = count(number, k);
  printf("The number of partial dearrangements is %d", dearrangements);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [43 x i8] c"The number of partial dearrangements is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast i32* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @count(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void volatile_store_u8(volatile uint8_t *dest, uint8_t val) { *dest = val; }


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

x86 assembly (clang, -O2):
<volatile_store_u8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_store_u8(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 = load i32*, i32** %3
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @volatile_store_u8(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snanmeanwd(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 0.0 / 0.0, 3.0, 0.0 / 0.0, 4.0,
               5.0, 6.0, 0.0 / 0.0, 7.0, 8.0,       0.0 / 0.0};
  int64_t N = 6;
  int64_t stride = 2;
  float v = stdlib_strided_snanmeanwd(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
movl   $0x6,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1030 <stdlib_strided_snanmeanwd@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_snanmeanwd@plt>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [12 x float]* %1 to i8*
store i32 6, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snanmeanwd(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [12 x float] [float 1.000000e+00, float 2.000000e+00, float 0x7FF8000000000000, float 3.000000e+00, float 0x7FF8000000000000, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 0x7FF8000000000000, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [12 x float]
%2 = bitcast [12 x float]* %1 to i8*
%3 = getelementptr inbounds [12 x float], [12 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snanmeanwd(i32 6, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
struct opencl_x86_work_group_t *opencl_x86_device_get_work_group_data(void) {
  struct opencl_x86_work_group_t *data;
  asm volatile("lea "
               "0x00002000"
               "(%%esp), %%eax\n\t"
               "and $"
               "0xffffe000"
               ", %%eax\n\t"
               "mov "
               "-0x60"
               "(%%eax), %0\n\t"
               : "=r"(data)
               :
               : "eax");
  return data;
}


x86 assembly (clang, -O0):
<opencl_x86_device_get_work_group_data>:
push   %rbp
mov    %rsp,%rbp
lea    0x2000(%esp),%eax
and    $0xffffe000,%eax
mov    -0x60(%eax),%rcx
mov    %rcx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opencl_x86_device_get_work_group_data>:
lea    0x2000(%esp),%eax
and    $0xffffe000,%eax
mov    -0x60(%eax),%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
%struct.opencl_x86_work_group_t = type opaque
define %struct.opencl_x86_work_group_t* @opencl_x86_device_get_work_group_data() {
%1 = alloca %struct.opencl_x86_work_group_t*
%2 = call %struct.opencl_x86_work_group_t* asm sideeffect "lea 0x00002000(%esp), %eax\0A\09and $$0xffffe000, %eax\0A\09mov -0x60(%eax), $0\0A\09", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store %struct.opencl_x86_work_group_t* %2, %struct.opencl_x86_work_group_t** %1
%3 = load %struct.opencl_x86_work_group_t*, %struct.opencl_x86_work_group_t** %1
ret %struct.opencl_x86_work_group_t* %3
}

LLVM IR (-O2):
%struct.opencl_x86_work_group_t = type opaque
define %struct.opencl_x86_work_group_t* @opencl_x86_device_get_work_group_data() {
%1 = tail call %struct.opencl_x86_work_group_t* asm sideeffect "lea 0x00002000(%esp), %eax\0A\09and $$0xffffe000, %eax\0A\09mov -0x60(%eax), $0\0A\09", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret %struct.opencl_x86_work_group_t* %1
}
void copy3d(float *out, const float *in) {
  out[0] = in[0];
  out[1] = in[1];
  out[2] = in[2];
}


x86 assembly (clang, -O0):
<copy3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy3d>:
movss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @copy3d(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
ret void
}

LLVM IR (-O2):
define void @copy3d(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ td_thrhandle_t;
typedef int /*<<< orphan*/ td_err_e;

/* Variables and functions */
int /*<<< orphan*/ TD_OK;
td_err_e td_thr_validate(const td_thrhandle_t *__th) { return TD_OK; }


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

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

LLVM IR (-O0):
@TD_OK = global i32 0
define i32 @td_thr_validate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @TD_OK
ret i32 %3
}

LLVM IR (-O2):
@TD_OK = global i32 0
define i32 @td_thr_validate(i32* nocapture readnone %0) {
%2 = load i32, i32* @TD_OK
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ infohelper_output(int, char *);
int /*<<< orphan*/ serialport_close();
void espcomm_close(void) {
  infohelper_output(2, "closing bootloader");
  serialport_close();
}


x86 assembly (clang, -O0):
<espcomm_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
call   1040 <infohelper_output@plt>
mov    $0x0,%al
call   1030 <serialport_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<espcomm_close>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
call   1040 <infohelper_output@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <serialport_close@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"closing bootloader\00"
define void @espcomm_close() {
%1 = call i32 @infohelper_output(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @serialport_close()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"closing bootloader\00"
define void @espcomm_close() {
%1 = tail call i32 @infohelper_output(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @serialport_close()
ret void
}
__typeof__(isalpha("")) test_isalpha_14(void) { return isalpha(""); }


x86 assembly (clang, -O0):
<test_isalpha_14>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <isalpha@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isalpha_14>:
lea    0xee9(%rip),%rdi
jmp    1030 <isalpha@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_isalpha_14() {
%1 = call i32 @isalpha(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_isalpha_14() {
%1 = tail call i32 @isalpha(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
/* Variables and functions */
int maxof2(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  a = maxof2(3, 5);
  printf("%d\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1040 <maxof2@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <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
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @maxof2(i32 3, i32 5)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

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