xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
scalar_t__ inc_addr(void *, int);
int utimes(void *, struct timeval const *);
int bad_utimes(void *addr) {
  return utimes(addr, (const struct timeval *)inc_addr(addr, 1));
}


x86 assembly (clang, -O0):
<bad_utimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
call   1030 <utimes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_utimes>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1040 <inc_addr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <utimes@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @bad_utimes(i8* %0) {
%2 = tail call i64 @inc_addr(i8* %0, i32 1)
%3 = inttoptr i64 %2 to %struct.timeval*
%4 = tail call i32 @utimes(i8* %0, %struct.timeval* %3)
ret i32 %4
}
int isonum_732(unsigned char *p) {
  return ((p[3] & 0xff) | ((p[2] & 0xff) << 8) | ((p[1] & 0xff) << 16) |
          ((p[0] & 0xff) << 24));
}


x86 assembly (clang, -O0):
<isonum_732>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_732>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @isonum_732(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, 255
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @isonum_732(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void uint8Copy(uint8_t *dst, const uint8_t *src) {
  assert(dst != NULL);
  assert(src != NULL);
  *dst = *src;
}


x86 assembly (clang, -O0):
<uint8Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint8Copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @uint8Copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32*, i32** %4
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @uint8Copy(i32* writeonly %0, i32* %1) {
%3 = icmp ne i32* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i32* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART1_Write_Text(char *);
void task2() { UART1_Write_Text("5 Seconds has passed\r\n"); }


x86 assembly (clang, -O0):
<task2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <UART1_Write_Text@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"5 Seconds has passed\0D\0A\00"
define void @task2() {
%1 = call i32 @UART1_Write_Text(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"5 Seconds has passed\0D\0A\00"
define void @task2() {
%1 = tail call i32 @UART1_Write_Text(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strcat(char *, char *);
char *str_concatene(char *str, char *strc) {
  char *res;
  res = strcat(str, strc);
  return res;
}


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

x86 assembly (clang, -O2):
<str_concatene>:
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define i8* @str_concatene(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Type definitions */
struct timeval {
  long long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long get_time_stamp() {
  struct timeval te;
  gettimeofday(&te, NULL);
  return te.tv_sec;
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @get_time_stamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ _errorloop();
void MemManage_Handler() { _errorloop(); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @DBGFR3RegCpuQueryU32() {
ret void
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int search(char row[256], char what[256]) {
  if (strstr(row, what)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1143 <search+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <search+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @search(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int plus(int a, int b) {
  int result = a + b;
  return result;
}


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

x86 assembly (clang, -O2):
<plus>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @plus(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void clearGraph(int g[10][10]) {
  int i, j;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      g[i][j] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<clearGraph>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1165 <clearGraph+0x65>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1152 <clearGraph+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <clearGraph+0x20>
jmp    1157 <clearGraph+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearGraph+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearGraph>:
push   %rax
mov    $0x190,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clearGraph([10 x i32]* nocapture writeonly %0) {
%2 = bitcast [10 x i32]* %0 to i8*
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t ring_space_wrapped(uint32_t size, uint32_t head, uint32_t tail) {
  if (size == 0)
    return 0;
  if (head < tail || !tail)
    return 0;
  else
    return tail - 1;
}


x86 assembly (clang, -O0):
<ring_space_wrapped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <ring_space_wrapped+0x28>
movq   $0x0,-0x8(%rbp)
jmp    115a <ring_space_wrapped+0x5a>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jl     1141 <ring_space_wrapped+0x41>
cmpq   $0x0,-0x20(%rbp)
jne    114e <ring_space_wrapped+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    115a <ring_space_wrapped+0x5a>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_space_wrapped>:
test   %rdi,%rdi
je     111a <ring_space_wrapped+0x1a>
xor    %ecx,%ecx
mov    %rdx,%rax
add    $0xffffffffffffffff,%rax
cmovae %rcx,%rax
cmp    %rdx,%rsi
cmovl  %rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @ring_space_wrapped(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp sge i64 %1, %2
%7 = icmp ne i64 %2, 0
%8 = and i1 %6, %7
%9 = add nsw i64 %2, -1
%10 = select i1 %8, i64 %9, i64 0
br label %11
11: ; preds = %5, %3
%12 = phi i64 [ 0, %3 ], [ %10, %5 ]
ret i64 %12
}
int myfunction(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @myfunction() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errSectTooBig(void) {
  error("Too much code (or data) or too big origin\n");
}


x86 assembly (clang, -O0):
<errSectTooBig>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <error@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [43 x i8] c"Too much code (or data) or too big origin\0A\00"
define void @errSectTooBig() {
%1 = call i32 @error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Too much code (or data) or too big origin\0A\00"
define void @errSectTooBig() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int led;
};
typedef TYPE_1__ XKeyboardControl;

/* Variables and functions */
void set_XKeyboardControl_led(void *_p, int _v) {
  ((XKeyboardControl *)_p)->led = (int)_v;
}


x86 assembly (clang, -O0):
<set_XKeyboardControl_led>:
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):
<set_XKeyboardControl_led>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyboardControl_led(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyboardControl_led(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__38__IO__makeOutput();
void Msp430GpioC__2__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__38__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__2__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__38__IO__makeOutput()
ret void
}
int fls(int _n) {
  unsigned int n = _n;
  int i = 0;
  for (i = 0; n > 0; n >>= 1, i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1141 <fls+0x41>
jmp    112a <fls+0x2a>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <fls+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls>:
xor    %eax,%eax
test   %edi,%edi
je     111c <fls+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <fls+0x10>
ret

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

LLVM IR (-O2):
define i32 @fls(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void R3StopGlut(void) {}


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

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

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

LLVM IR (-O2):
define void @R3StopGlut() {
ret void
}
/* Variables and functions */
float __nv_rnorm3df(float, float, float);
float rnorm3df(float __a, float __b, float __c) {
  return __nv_rnorm3df(__a, __b, __c);
}


x86 assembly (clang, -O0):
<rnorm3df>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <__nv_rnorm3df@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnorm3df>:
jmp    1030 <__nv_rnorm3df@plt>

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

LLVM IR (-O2):
define float @rnorm3df(float %0, float %1, float %2) {
%4 = tail call float @__nv_rnorm3df(float %0, float %1, float %2)
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
struct timespec {
  int dummy;
};

/* Variables and functions */
int FUTEX_WAIT;
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int /*<<< orphan*/,
            struct timespec *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_wait(u_int32_t *uaddr, u_int32_t val, struct timespec *timeout,
               int opflags) {
  return syscall(SYS_futex, uaddr, FUTEX_WAIT | opflags, val, timeout, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
or     -0x1c(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wait>:
push   %rax
mov    %rdx,%r8
mov    %esi,%eax
mov    %rdi,%rsi
mov    0x2eb8(%rip),%rdx
mov    (%rdx),%edi
mov    0x2ebf(%rip),%rdx
or     (%rdx),%ecx
movl   $0x0,(%rsp)
mov    %ecx,%edx
mov    %eax,%ecx
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
@FUTEX_WAIT = global i32 0
define i32 @futex_wait(i32* %0, i32 %1, %struct.timespec* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca %struct.timespec*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store %struct.timespec* %2, %struct.timespec** %7
store i32 %3, i32* %8
%9 = load i32, i32* @SYS_futex
%10 = load i32*, i32** %5
%11 = load i32, i32* @FUTEX_WAIT
%12 = load i32, i32* %8
%13 = or i32 %11, %12
%14 = load i32, i32* %6
%15 = load %struct.timespec*, %struct.timespec** %7
%16 = call i32 @syscall(i32 %9, i32* %10, i32 %13, i32 %14, %struct.timespec* %15, i32* null, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
@FUTEX_WAIT = global i32 0
define i32 @futex_wait(i32* %0, i32 %1, %struct.timespec* %2, i32 %3) {
%5 = load i32, i32* @SYS_futex
%6 = load i32, i32* @FUTEX_WAIT
%7 = or i32 %6, %3
%8 = tail call i32 @syscall(i32 %5, i32* %0, i32 %7, i32 %1, %struct.timespec* %2, i32* null, i32 0)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void *do_stuff(void *param) {
  long thread_no = (long)param;
  printf("Thread number %ld\n", thread_no);
  return (void *)(thread_no + 1);
}


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

x86 assembly (clang, -O2):
<do_stuff>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Thread number %ld\0A\00"
define i8* @do_stuff(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
@.str = [19 x i8] c"Thread number %ld\0A\00"
define i8* @do_stuff(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = add nsw i64 %2, 1
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
float ceilf(float);
void __hv_ceil_f(float bIn, float *bOut) { *bOut = ceilf(bIn); }


x86 assembly (clang, -O0):
<__hv_ceil_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <ceilf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_ceil_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ceilf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_ceil_f(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = call float @llvm.ceil.f32(float %5)
%7 = load float*, float** %4
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @__hv_ceil_f(float %0, float* nocapture writeonly %1) {
%3 = tail call float @llvm.ceil.f32(float %0)
store float %3, float* %1
ret void
}
/* Variables and functions */
unsigned long __raw_local_save_flags();
int /*<<< orphan*/ raw_local_irq_disable();
__attribute__((always_)) unsigned long __raw_local_irq_save(void) {
  unsigned long flags = __raw_local_save_flags();
  raw_local_irq_disable();
  return flags;
}


x86 assembly (clang, -O0):
<__raw_local_irq_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__raw_local_save_flags@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <raw_local_irq_disable@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__raw_local_irq_save>:
push   %rbx
xor    %eax,%eax
call   1030 <__raw_local_save_flags@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <raw_local_irq_disable@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__raw_local_irq_save() {
%1 = alloca i64
%2 = call i64 (...) @__raw_local_save_flags()
store i64 %2, i64* %1
%3 = call i32 (...) @raw_local_irq_disable()
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @__raw_local_irq_save() {
%1 = tail call i64 (...) @__raw_local_save_flags()
%2 = tail call i32 (...) @raw_local_irq_disable()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: [ -i input_file] [ -o output_file ] [ -n no_bytes]\n");
  printf("Changes no_bytes (default 1024) in input_file (default = - = stdin) "
         "and store\n");
  printf("result to output_file (default = - = stdout). It's possible to use "
         "same file\n");
  printf("as both input and output\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
lea    0xf47(%rip),%rdi
call   1030 <printf@plt>
lea    0xf89(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf48(%rip),%rdi
call   1030 <puts@plt>
lea    0xf89(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Usage: [ -i input_file] [ -o output_file ] [ -n no_bytes]\0A\00"
@.str.1 = [79 x i8] c"Changes no_bytes (default 1024) in input_file (default = - = stdin) and store\0A\00"
@.str.2 = [78 x i8] c"result to output_file (default = - = stdout). It's possible to use same file\0A\00"
@.str.3 = [26 x i8] c"as both input and output\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [58 x i8] c"Usage: [ -i input_file] [ -o output_file ] [ -n no_bytes]\00"
@str.4 = [78 x i8] c"Changes no_bytes (default 1024) in input_file (default = - = stdin) and store\00"
@str.5 = [77 x i8] c"result to output_file (default = - = stdout). It's possible to use same file\00"
@str.6 = [25 x i8] c"as both input and output\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void dispsynt(char **argv) {
  fprintf(stderr,
          "Syntax: %s i_sacs stftype [-imas] [-icmtf] [-gfdir] [-t] [-h]\n",
          argv[0]);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"Syntax: %s i_sacs stftype [-imas] [-icmtf] [-gfdir] [-t] [-h]\0A\00"
define void @dispsynt(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"Syntax: %s i_sacs stftype [-imas] [-icmtf] [-gfdir] [-t] [-h]\0A\00"
define void @dispsynt(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void eshdn6(x) register unsigned short *x;
{
  int i;
  register unsigned short *p;
  x += (6 + 3) - 1;
  p = x + 1;
  for (i = 2; i < (6 + 3) - 1; i++)
    *(--p) = *(--x);
  *(--p) = 0;
}


x86 assembly (clang, -O0):
<eshdn6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1165 <eshdn6+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffe,%rcx
mov    %rcx,-0x8(%rbp)
mov    -0x2(%rax),%cx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffe,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cx,-0x2(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <eshdn6+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffe,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x0,-0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<eshdn6>:
mov    0xc(%rdi),%eax
mov    %eax,0xe(%rdi)
mov    0x4(%rdi),%rax
mov    %rax,0x6(%rdi)
movw   $0x0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @eshdn6(i16* nocapture %0) {
%2 = getelementptr i16, i16* %0, i64 3
%3 = bitcast i16* %2 to i8*
%4 = getelementptr i16, i16* %0, i64 2
%5 = bitcast i16* %4 to i8*
%6 = getelementptr i16, i16* %0, i64 2
store i16 0, i16* %6
ret void
}
int execute_pause() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pause() {
ret i32 0
}
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int16_t s2n_kyber_512_r3_barrett_reduce(int16_t a) {
  int16_t t;
  const int16_t v = ((1U << 26) + 3329 / 2) / 3329;
  t = (int32_t)v * a >> 26;
  t *= 3329;
  return a - t;
}


x86 assembly (clang, -O0):
<s2n_kyber_512_r3_barrett_reduce>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4ebf,-0xc(%rbp)
imul   $0x4ebf,-0x4(%rbp),%eax
sar    $0x1a,%eax
mov    %eax,-0x8(%rbp)
imul   $0xd01,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2n_kyber_512_r3_barrett_reduce>:
imul   $0x4ebf,%edi,%eax
sar    $0x1a,%eax
imul   $0xfffff2ff,%eax,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @s2n_kyber_512_r3_barrett_reduce(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 20159, i32* %4
%5 = load i32, i32* %2
%6 = mul nsw i32 20159, %5
%7 = ashr i32 %6, 26
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 3329
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @s2n_kyber_512_r3_barrett_reduce(i32 %0) {
%2 = mul nsw i32 %0, 20159
%3 = ashr i32 %2, 26
%4 = mul nsw i32 %3, -3329
%5 = add i32 %4, %0
ret i32 %5
}
void store_char(char *buf, int idx, int blen, int ch) {
  if (buf && (idx < (blen - 1))) {
    buf[idx] = (char)ch;
  }
}


x86 assembly (clang, -O0):
<store_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113d <store_char+0x3d>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    113d <store_char+0x3d>
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_char>:
test   %rdi,%rdi
je     1112 <store_char+0x12>
add    $0xffffffff,%edx
cmp    %esi,%edx
jle    1112 <store_char+0x12>
movslq %esi,%rax
mov    %cl,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @store_char(i8* writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i8* %0, null
%6 = add nsw i32 %2, -1
%7 = icmp sgt i32 %6, %1
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = trunc i32 %3 to i8
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %10, i8* %12
br label %13
13: ; preds = %9, %4
ret void
}
void I_PauseCD(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
void wl_shell_destroy(struct wl_shell *wl_shell) {
  wl_proxy_destroy((struct wl_proxy *)wl_shell);
}


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

x86 assembly (clang, -O2):
<wl_shell_destroy>:
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_destroy(%struct.wl_shell* %0) {
%2 = alloca %struct.wl_shell*
store %struct.wl_shell* %0, %struct.wl_shell** %2
%3 = load %struct.wl_shell*, %struct.wl_shell** %2
%4 = bitcast %struct.wl_shell* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %4)
ret void
}

LLVM IR (-O2):
%struct.wl_shell = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_destroy(%struct.wl_shell* %0) {
%2 = bitcast %struct.wl_shell* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
/* Variables and functions */
char toupper(char);
char *strupr(char *string) {
  char *s;
  if (string) {
    for (s = string; *s; ++s)
      *s = toupper(*s);
  }
  return string;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <strupr+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <strupr+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <strupr+0x1f>
jmp    1166 <strupr+0x56>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <strupr+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <strupr+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @toupper(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d", n / 2 - (n + 1) % 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    %edx,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,%esi
shr    $0x1f,%esi
add    %eax,%esi
add    $0x1,%esi
and    $0xfffffffe,%esi
sub    %edx,%esi
add    %ecx,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 2
%6 = add nsw i32 %4, 1
%7 = srem i32 %6, 2
%8 = sub nsw i32 %5, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
short callback3_int_int_short(int (*f)(int)) { return f(3); }


x86 assembly (clang, -O0):
<callback3_int_int_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   *-0x8(%rbp)
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_int_int_short>:
push   %rax
mov    %rdi,%rax
mov    $0x3,%edi
call   *%rax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @callback3_int_int_short(i32 (i32)* %0) {
%2 = alloca i32 (i32)*
store i32 (i32)* %0, i32 (i32)** %2
%3 = load i32 (i32)*, i32 (i32)** %2
%4 = call i32 %3(i32 3)
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @callback3_int_int_short(i32 (i32)* nocapture %0) {
%2 = tail call i32 %0(i32 3)
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ voidpf;
typedef int uInt;

/* Variables and functions */
int /*<<< orphan*/ malloc(int);
voidpf zalloc(voidpf opaque, uInt items, uInt size) {
  return malloc(items * size);
}


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

x86 assembly (clang, -O2):
<zalloc>:
mov    %esi,%edi
imul   %edx,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define i32 @zalloc(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = tail call i32 @malloc(i32 %4)
ret i32 %5
}
printlabel(label) int label;
{
  outasm("cc");
  outdec(label);
}


x86 assembly (clang, -O0):
<printlabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <outasm@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <outdec@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlabel>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <outasm@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <outdec@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"cc\00"
define i32 @printlabel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @outdec to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"cc\00"
define i32 @printlabel(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @outdec to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void getusage(const char *s) {
  printf("usage: %s host:file host:file ... file, or\n", s);
  printf("       %s file file ... file if connected\n", s);
}


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

x86 assembly (clang, -O2):
<getusage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"usage: %s host:file host:file ... file, or\0A\00"
@.str.1 = [43 x i8] c" %s file file ... file if connected\0A\00"
define void @getusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"usage: %s host:file host:file ... file, or\0A\00"
@.str.1 = [43 x i8] c" %s file file ... file if connected\0A\00"
define void @getusage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}