xunge/DecIR huggingface dataset:
/* Type definitions */
typedef long time_t;

/* Variables and functions */
long daylight_seconds(long const *);
long solar_noon(long const *);
time_t sun_set(const time_t *timer) {
  long n;
  time_t t;
  t = solar_noon(timer);
  n = daylight_seconds(timer) / 2L;
  t += n;
  return t;
}


x86 assembly (clang, -O0):
<sun_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <solar_noon@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <daylight_seconds@plt>
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_set>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <solar_noon@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <daylight_seconds@plt>
mov    %rax,%rcx
shr    $0x3f,%rcx
add    %rcx,%rax
sar    %rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @sun_set(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = call i64 @solar_noon(i64* %5)
store i64 %6, i64* %4
%7 = load i64*, i64** %2
%8 = call i64 @daylight_seconds(i64* %7)
%9 = sdiv i64 %8, 2
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = add nsw i64 %11, %10
store i64 %12, i64* %4
%13 = load i64, i64* %4
ret i64 %13
}

LLVM IR (-O2):
define i64 @sun_set(i64* %0) {
%2 = tail call i64 @solar_noon(i64* %0)
%3 = tail call i64 @daylight_seconds(i64* %0)
%4 = sdiv i64 %3, 2
%5 = add nsw i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int printkv(char *key, char *val) {
  printf("key: %s, val: %s\n", key, val);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"key: %s, val: %s\0A\00"
define i32 @printkv(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
extern void android_memory_store_barrier(void) { android_compiler_barrier(); }


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

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

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

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

/* Variables and functions */
void set_sint16(char *buf, const int16_t val) {
  buf[0] = (val >> 0) & 0xFF;
  buf[1] = (val >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<set_sint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sint16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @set_sint16(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 = ashr i32 %5, 0
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @set_sint16(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
void command_nop(char *params) {}


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

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

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

LLVM IR (-O2):
define void @command_nop(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct listIterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wfree(struct listIterator *);
void freeListIterator(struct listIterator *iter) { wfree(iter); }


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

x86 assembly (clang, -O2):
<freeListIterator>:
jmp    1030 <wfree@plt>

LLVM IR (-O0):
%struct.listIterator = type { i32 }
define void @freeListIterator(%struct.listIterator* %0) {
%2 = alloca %struct.listIterator*
store %struct.listIterator* %0, %struct.listIterator** %2
%3 = load %struct.listIterator*, %struct.listIterator** %2
%4 = call i32 @wfree(%struct.listIterator* %3)
ret void
}

LLVM IR (-O2):
%struct.listIterator = type { i32 }
define void @freeListIterator(%struct.listIterator* %0) {
%2 = tail call i32 @wfree(%struct.listIterator* %0)
ret void
}
void gtk_border_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_border_copy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printNewLine();
int /*<<< orphan*/ printNum(int);
int processA(int argc, char **argv) {
  int counter = 2;
  print("Scheduler process A is running\n");
  while (counter > 0) {
    print("Scheduler process A: row ");
    printNum(counter);
    printNewLine();
    counter--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<processA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <print@plt>
cmpl   $0x0,-0x14(%rbp)
jle    1185 <processA+0x55>
lea    0xebd(%rip),%rdi
call   1030 <print@plt>
mov    -0x14(%rbp),%edi
call   1040 <printNum@plt>
mov    $0x0,%al
call   1050 <printNewLine@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <processA+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processA>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <print@plt>
lea    0xedc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print@plt>
mov    $0x2,%edi
call   1040 <printNum@plt>
xor    %eax,%eax
call   1050 <printNewLine@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    $0x1,%edi
call   1040 <printNum@plt>
xor    %eax,%eax
call   1050 <printNewLine@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Scheduler process A is running\0A\00"
@.str.1 = [26 x i8] c"Scheduler process A: row \00"
define i32 @processA(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 2, i32* %5
%6 = call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = call i32 @print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %5
%13 = call i32 @printNum(i32 %12)
%14 = call i32 (...) @printNewLine()
%15 = load i32, i32* %5
%16 = add nsw i32 %15, -1
store i32 %16, i32* %5
br label %7
17: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Scheduler process A is running\0A\00"
@.str.1 = [26 x i8] c"Scheduler process A: row \00"
define i32 @processA(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @printNum(i32 2)
%6 = tail call i32 (...) @printNewLine()
%7 = tail call i32 @print(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @printNum(i32 1)
%9 = tail call i32 (...) @printNewLine()
ret i32 0
}
int cputest_sse(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @cputest_sse() {
ret i32 1
}

LLVM IR (-O2):
define i32 @cputest_sse() {
ret i32 1
}
void g_arith_sqrt_u64(void *s, void *d, void *o) {}


x86 assembly (clang, -O0):
<g_arith_sqrt_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g_arith_sqrt_u64(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ AuxAdiDdiSafeWrite(int, int, int);
void DDI16SetValBit(uint32_t ui32Base, uint32_t ui32Reg, bool bWriteHigh,
                    uint32_t ui32Mask, uint32_t ui32Val) {
  uint32_t ui32RegOffset;
  ;
  ;
  ;
  ;
  ui32RegOffset = 0x00000200 + (ui32Reg << 1) + (bWriteHigh ? 4 : 0);
  AuxAdiDdiSafeWrite(ui32Base + ui32RegOffset, (ui32Mask << 16) | ui32Val, 4);
}


x86 assembly (clang, -O0):
<DDI16SetValBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x200,%eax
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    $0x4,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x18(%rbp),%edi
mov    -0x10(%rbp),%esi
shl    $0x10,%esi
or     -0x14(%rbp),%esi
mov    $0x4,%edx
call   1030 <AuxAdiDdiSafeWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DDI16SetValBit>:
xor    %eax,%eax
test   %edx,%edx
setne  %al
lea    (%rdi,%rsi,2),%edx
lea    (%rdx,%rax,4),%edi
add    $0x200,%edi
shl    $0x10,%ecx
or     %r8d,%ecx
mov    %ecx,%esi
mov    $0x4,%edx
jmp    1030 <AuxAdiDdiSafeWrite@plt>

LLVM IR (-O0):
define void @DDI16SetValBit(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %7
%13 = shl i32 %12, 1
%14 = add nsw i32 512, %13
%15 = load i32, i32* %8
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 4, i32 0
%19 = add nsw i32 %14, %18
store i32 %19, i32* %11
%20 = load i32, i32* %6
%21 = load i32, i32* %11
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %9
%24 = shl i32 %23, 16
%25 = load i32, i32* %10
%26 = or i32 %24, %25
%27 = call i32 @AuxAdiDdiSafeWrite(i32 %22, i32 %26, i32 4)
ret void
}

LLVM IR (-O2):
define void @DDI16SetValBit(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = shl i32 %1, 1
%7 = icmp eq i32 %2, 0
%8 = select i1 %7, i32 0, i32 4
%9 = add i32 %0, 512
%10 = add i32 %9, %6
%11 = add i32 %10, %8
%12 = shl i32 %3, 16
%13 = or i32 %12, %4
%14 = tail call i32 @AuxAdiDdiSafeWrite(i32 %11, i32 %13, i32 4)
ret void
}
int git_path_is_relative(const char *p) {
  return (p[0] == '.' && (p[1] == '/' || (p[1] == '.' && p[2] == '/')));
}


x86 assembly (clang, -O0):
<git_path_is_relative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1166 <git_path_is_relative+0x66>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0xa(%rbp)
je     1160 <git_path_is_relative+0x60>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0xb(%rbp)
jne    115a <git_path_is_relative+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_path_is_relative>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    111d <git_path_is_relative+0x1d>
mov    0x1(%rdi),%cl
cmp    $0x2f,%cl
je     111e <git_path_is_relative+0x1e>
cmp    $0x2e,%cl
jne    111d <git_path_is_relative+0x1d>
xor    %eax,%eax
cmpb   $0x2f,0x2(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @git_path_is_relative(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %30
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br i1 %13, label %28, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 46
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 47
br label %26
26: ; preds = %20, %14
%27 = phi i1 [ false, %14 ], [ %25, %20 ]
br label %28
28: ; preds = %26, %8
%29 = phi i1 [ true, %8 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %1
%31 = phi i1 [ false, %1 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @git_path_is_relative(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %12 [
i8 47, label %13
i8 46, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 47
%11 = zext i1 %10 to i32
br label %13
12: ; preds = %4
br label %13
13: ; preds = %4, %12, %7, %1
%14 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %7 ], [ 0, %12 ]
ret i32 %14
}
int emac1_aframestransmittedok_set(unsigned int dev_id,
                                   union emac1_aframestransmittedok_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_aframestransmittedok_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_aframestransmittedok_u = type opaque
define i32 @emac1_aframestransmittedok_set(i32 %0, %union.emac1_aframestransmittedok_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_aframestransmittedok_u*
store i32 %0, i32* %3
store %union.emac1_aframestransmittedok_u* %1, %union.emac1_aframestransmittedok_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_aframestransmittedok_u = type opaque
define i32 @emac1_aframestransmittedok_set(i32 %0, %union.emac1_aframestransmittedok_u* nocapture readnone %1) {
ret i32 1
}
int btree_destroy(struct btree_info *info) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.btree_info = type opaque
define i32 @btree_destroy(%struct.btree_info* nocapture readnone %0) {
ret i32 0
}
int foo_func(char *foo_char) {}


x86 assembly (clang, -O0):
<foo_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo_func(i8* nocapture readnone %0) {
ret i32 undef
}
int get_all_one(unsigned int n) {
  unsigned int c = 0;
  for (c = 0; n; c++) {
    n &= (n - 1);
  }
  return c;
}


x86 assembly (clang, -O0):
<get_all_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <get_all_one+0x39>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <get_all_one+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_all_one>:
xor    %eax,%eax
test   %edi,%edi
je     111c <get_all_one+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <get_all_one+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_all_one(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void square(int side) {
  int i, j;
  for (i = 0; i < side; i++) {
    for (j = 0; j < side; j++) {
      printf("*");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <square+0x65>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <square+0x4b>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <square+0x25>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <square+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1151 <square+0x41>
mov    %edi,%r14d
xor    %ebp,%ebp
nopl   (%rax)
mov    %r14d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <square+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %r14d,%ebp
jne    1120 <square+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %24
9: ; preds = %5
store i32 0, i32* %4
br label %10
10: ; preds = %16, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %10
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @square(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1, %10
%4 = phi i32 [ %12, %10 ], [ 0, %1 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @putchar(i32 42)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = tail call i32 @putchar(i32 10)
%12 = add nuw nsw i32 %4, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %3
14: ; preds = %10, %1
ret void
}
void EnsureMarkFree3() {}


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

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

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

LLVM IR (-O2):
define void @EnsureMarkFree3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ metal_bitmap_is_bit_set(unsigned long *, int);
int metal_bitmap_is_bit_clear(unsigned long *bitmap, int bit) {
  return !metal_bitmap_is_bit_set(bitmap, bit);
}


x86 assembly (clang, -O0):
<metal_bitmap_is_bit_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <metal_bitmap_is_bit_set@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @metal_bitmap_is_bit_clear(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = call i32 @metal_bitmap_is_bit_set(i64* %5, i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @metal_bitmap_is_bit_clear(i64* %0, i32 %1) {
%3 = tail call i32 @metal_bitmap_is_bit_set(i64* %0, i32 %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_memdel(void **);
void ft_strdel(char **as) { ft_memdel((void **)as); }


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

x86 assembly (clang, -O2):
<ft_strdel>:
jmp    1030 <ft_memdel@plt>

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = tail call i32 @ft_memdel(i8** %0)
ret void
}
int my_power_rec(int nb, int power) {
  int a;
  int b;
  a = nb;
  b = power;
  if (b == 0) {
    return (1);
  } else if (a == 0 || b < 0 || b >= 12) {
    return (0);
  } else {
    return (a * my_power_rec(a, b - 1));
  }
}


x86 assembly (clang, -O0):
<my_power_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1140 <my_power_rec+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1189 <my_power_rec+0x79>
cmpl   $0x0,-0x10(%rbp)
je     115e <my_power_rec+0x4e>
cmpl   $0x0,-0x14(%rbp)
jl     115e <my_power_rec+0x4e>
cmpl   $0xc,-0x14(%rbp)
jl     116a <my_power_rec+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1189 <my_power_rec+0x79>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <my_power_rec@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_power_rec>:
mov    $0x1,%eax
test   %esi,%esi
je     1129 <my_power_rec+0x29>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
test   %edi,%edi
je     1126 <my_power_rec+0x26>
cmp    $0xb,%esi
ja     1126 <my_power_rec+0x26>
imul   %edi,%eax
add    $0xffffffff,%esi
jne    1110 <my_power_rec+0x10>
mov    $0x1,%ecx
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_power_rec(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %19, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 0
br label %6
6: ; preds = %4, %11
%7 = phi i32 [ %1, %4 ], [ %12, %11 ]
%8 = phi i32 [ 1, %4 ], [ %13, %11 ]
%9 = icmp ugt i32 %7, 11
%10 = or i1 %5, %9
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = add nsw i32 %7, -1
%13 = mul nsw i32 %8, %0
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %11
%16 = phi i32 [ %13, %11 ], [ %8, %6 ]
%17 = phi i32 [ 1, %11 ], [ 0, %6 ]
%18 = mul nuw nsw i32 %17, %16
br label %19
19: ; preds = %15, %2
%20 = phi i32 [ %18, %15 ], [ 1, %2 ]
ret i32 %20
}
void test2(int a) {
  int *p = &a;
  int b = 2;
  __asm("movl $5, %0 \n"
        "movl $6, %1 \n"
        : "=m"(*p), "=m"(b)
        :);
  assert(a == 5);
  assert(b == 6);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
movl   $0x6,-0x14(%rbp)
cmpl   $0x5,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
cmpl   $0x6,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
mov    %edi,0x4(%rsp)
movl   $0x2,(%rsp)
movl   $0x5,0x4(%rsp)
movl   $0x6,(%rsp)
xor    %edi,%edi
cmpl   $0x5,0x4(%rsp)
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,(%rsp)
sete   %dil
xor    %eax,%eax
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
store i32* %2, i32** %3
store i32 2, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 5
%8 = zext i1 %7 to i32
%9 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %8)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 6
%12 = zext i1 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %12)
ret void
}

LLVM IR (-O2):
define void @test2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 5
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delete (char const *);
void delete_command(const char *dir) { delete (dir); }


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

x86 assembly (clang, -O2):
<delete_command>:
jmp    1030 <delete@plt>

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

LLVM IR (-O2):
define void @delete_command(i8* %0) {
%2 = tail call i32 @delete(i8* %0)
ret void
}
void uDMAChannelEnable(unsigned long ulChannel) {
  ;
  (*((volatile unsigned long *)(0x400FF028))) = 1 << ulChannel;
}


x86 assembly (clang, -O0):
<uDMAChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff028,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelEnable>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff028
40
ret

LLVM IR (-O0):
define void @uDMAChannelEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 1074786344 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelEnable(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1074786344 to i64*)
ret void
}
void avio_wb16() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKUP(int);
void BrzNullAdapt_ackdown(struct comp *comp, int port) {
  struct BrzNullAdapt_ *c = (struct BrzNullAdapt_ *)comp;
  SEND_ACKUP(1);
}


x86 assembly (clang, -O0):
<BrzNullAdapt_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <SEND_ACKUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzNullAdapt_ = type { i32 }
define void @BrzNullAdapt_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzNullAdapt_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzNullAdapt_*
store %struct.BrzNullAdapt_* %7, %struct.BrzNullAdapt_** %5
%8 = call i32 @SEND_ACKUP(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzNullAdapt_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKUP(i32 1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XClientMessageEvent;

/* Variables and functions */
void set_XClientMessageEvent_type(void *_p, int _v) {
  ((XClientMessageEvent *)_p)->type = (int)_v;
}


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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XClientMessageEvent_type(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_XClientMessageEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ float32_le_write(float, unsigned char *);
void f2bf_array(float *buffer, int count) {
  while (--count >= 0) {
    float32_le_write(buffer[count], (unsigned char *)(buffer + count));
  };
}


x86 assembly (clang, -O0):
<f2bf_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1157 <f2bf_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <float32_le_write@plt>
jmp    111f <f2bf_array+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2bf_array>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    114c <f2bf_array+0x3c>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
lea    (%r14,%rax,4),%rdi
movss  (%r14,%rax,4),%xmm0
call   1030 <float32_le_write@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <f2bf_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @f2bf_array(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load float*, float** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %10, i64 %12
%14 = load float, float* %13
%15 = load float*, float** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %15, i64 %17
%19 = bitcast float* %18 to i8*
%20 = call i32 @float32_le_write(float %14, i8* %19)
br label %5
21: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @f2bf_array(float* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = load float, float* %10
%12 = bitcast float* %10 to i8*
%13 = tail call i32 @float32_le_write(float %11, i8* %12)
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret void
}
void yy_1_TableRowTransient(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_TableRowTransient(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @yy_1_TableRowTransient(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int getpriority(int /*<<< orphan*/, int /*<<< orphan*/);
int setpriority(int /*<<< orphan*/, int /*<<< orphan*/, int);
int nice(int increment) {
  int priority = getpriority(PRIO_PROCESS, 0);
  return setpriority(PRIO_PROCESS, 0, priority + increment);
}


x86 assembly (clang, -O0):
<nice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
add    -0x4(%rbp),%edx
xor    %esi,%esi
call   1040 <setpriority@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nice>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
mov    (%r14),%edi
add    %eax,%ebx
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <setpriority@plt>

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
define i32 @nice(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @PRIO_PROCESS
%5 = call i32 @getpriority(i32 %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* @PRIO_PROCESS
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = call i32 @setpriority(i32 %6, i32 0, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
define i32 @nice(i32 %0) {
%2 = load i32, i32* @PRIO_PROCESS
%3 = tail call i32 @getpriority(i32 %2, i32 0)
%4 = load i32, i32* @PRIO_PROCESS
%5 = add nsw i32 %3, %0
%6 = tail call i32 @setpriority(i32 %4, i32 0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int cmpr_checkextension(char *);
int /*<<< orphan*/ filename_extension(char *, int, char const *);
int cmpr_checkfiletype(const char *filename) {
  int cmpr = 0;
  char extension[1024];
  filename_extension(extension, 1024, filename);
  cmpr = cmpr_checkextension(extension);
  return (cmpr);
}


x86 assembly (clang, -O0):
<cmpr_checkfiletype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <filename_extension@plt>
lea    -0x410(%rbp),%rdi
call   1040 <cmpr_checkextension@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpr_checkfiletype>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <filename_extension@plt>
mov    %rbx,%rdi
call   1040 <cmpr_checkextension@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cmpr_checkfiletype(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [1024 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @filename_extension(i8* %5, i32 1024, i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = call i32 @cmpr_checkextension(i8* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @cmpr_checkfiletype(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @filename_extension(i8* %3, i32 1024, i8* %0)
%5 = call i32 @cmpr_checkextension(i8* %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  int *v = (int *)malloc(argc * sizeof(int));
  v[0] = 0;
  return v[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
shl    $0x2,%edi
call   1030 <malloc@plt>
movl   $0x0,(%rax)
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**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 0, i32* %14
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = shl i32 %0, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
store i32 0, i32* %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_ldy();
void e_ldy_abs() {
  e_abs();
  e_ldy();
}


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

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

LLVM IR (-O0):
define void @e_ldy_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_ldy()
ret void
}

LLVM IR (-O2):
define void @e_ldy_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_ldy()
ret void
}
/* Variables and functions */
int get_r_opcode(unsigned char *);
bool r_bit_is_set(unsigned char *pkt_buf) {
  return ((get_r_opcode(pkt_buf) & (1 << 7)) > 0);
}


x86 assembly (clang, -O0):
<r_bit_is_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_r_opcode@plt>
and    $0x80,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_bit_is_set>:
push   %rax
call   1030 <get_r_opcode@plt>
shr    $0x7,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @r_bit_is_set(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_r_opcode(i8* %3)
%5 = and i32 %4, 128
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @r_bit_is_set(i8* %0) {
%2 = tail call i32 @get_r_opcode(i8* %0)
%3 = lshr i32 %2, 7
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
scalar_t__ isgraph(char const);
const char *trim_right(const char *start, const char *stop) {
  for (stop--; start <= stop; stop--) {
    if (isgraph(*stop)) {
      ++stop;
      break;
    }
  }
  return stop;
}


x86 assembly (clang, -O0):
<trim_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1177 <trim_right+0x67>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isgraph@plt>
cmp    $0x0,%rax
je     1161 <trim_right+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1177 <trim_right+0x67>
jmp    1166 <trim_right+0x56>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <trim_right+0x1c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_right>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
cmp    %r14,%rbx
jb     113a <trim_right+0x2a>
movsbl (%rbx),%edi
call   1030 <isgraph@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
je     1120 <trim_right+0x10>
add    $0x2,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @trim_right(i8* readnone %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %5, %7 ]
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ult i8* %5, %0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load i8, i8* %5
%9 = tail call i64 @isgraph(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %7, %3
%12 = phi i8* [ %5, %3 ], [ %4, %7 ]
ret i8* %12
}
void func() {
  int a = 10;
  int *b = &a;
  int **c = &b;
  int *d = *c;
  int e = *d;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca i32*
%5 = alloca i32
store i32 10, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%6 = load i32**, i32*** %3
%7 = load i32*, i32** %6
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %5
ret void
}

LLVM IR (-O2):
define void @func() {
ret void
}
struct Buf *buf_strappend(buf, str)
struct Buf *buf;
const char *str;
{ return buf_strnappend(buf, str, strlen(str)); }


x86 assembly (clang, -O0):
<buf_strappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
mov    $0x0,%al
call   1040 <buf_strnappend@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_strappend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <buf_strnappend@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.Buf = type opaque
define %struct.Buf* @buf_strappend(%struct.Buf* %0, i8* %1) {
%3 = alloca %struct.Buf*
%4 = alloca i8*
store %struct.Buf* %0, %struct.Buf** %3
store i8* %1, i8** %4
%5 = load %struct.Buf*, %struct.Buf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = call i32 (%struct.Buf*, i8*, i64, ...) bitcast (i32 (...)* @buf_strnappend to i32 (%struct.Buf*, i8*, i64, ...)*)(%struct.Buf* %5, i8* %6, i64 %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.Buf*
ret %struct.Buf* %11
}

LLVM IR (-O2):
%struct.Buf = type opaque
define %struct.Buf* @buf_strappend(%struct.Buf* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 (%struct.Buf*, i8*, i64, ...) bitcast (i32 (...)* @buf_strnappend to i32 (%struct.Buf*, i8*, i64, ...)*)(%struct.Buf* %0, i8* %1, i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.Buf*
ret %struct.Buf* %6
}