xunge/DecIR huggingface dataset:
unsigned todec(unsigned bin) {
  unsigned dec = 0, p = 1;
  do {
    dec += bin % 10 * p;
    p *= 2;
  } while (bin /= 10);
  return dec;
}


x86 assembly (clang, -O0):
<todec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1115 <todec+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<todec>:
mov    $0x1,%ecx
xor    %eax,%eax
mov    $0xcccccccd,%r8d
nopl   (%rax)
mov    %edi,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%edx
lea    (%rdx,%rdx,4),%r9d
mov    %edi,%edx
sub    %r9d,%edx
imul   %ecx,%edx
add    %edx,%eax
add    %ecx,%ecx
cmp    $0x9,%edi
mov    %esi,%edi
ja     1110 <todec+0x10>
ret

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

LLVM IR (-O2):
define i32 @todec(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %10, %2 ]
%4 = phi i32 [ 0, %1 ], [ %8, %2 ]
%5 = phi i32 [ 1, %1 ], [ %9, %2 ]
%6 = urem i32 %3, 10
%7 = mul i32 %5, %6
%8 = add i32 %7, %4
%9 = shl i32 %5, 1
%10 = udiv i32 %3, 10
%11 = icmp ult i32 %3, 10
br i1 %11, label %12, label %2
12: ; preds = %2
ret i32 %8
}
/* Type definitions */
struct intel_bo {
  int dummy;
};

/* Variables and functions */
scalar_t__ intel_bo_wait(struct intel_bo *, int /*<<< orphan*/);
bool intel_bo_is_busy(struct intel_bo *bo) {
  return (intel_bo_wait(bo, 0) != 0);
}


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

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

LLVM IR (-O0):
%struct.intel_bo = type { i32 }
define i32 @intel_bo_is_busy(%struct.intel_bo* %0) {
%2 = alloca %struct.intel_bo*
store %struct.intel_bo* %0, %struct.intel_bo** %2
%3 = load %struct.intel_bo*, %struct.intel_bo** %2
%4 = call i64 @intel_bo_wait(%struct.intel_bo* %3, i32 0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.intel_bo = type { i32 }
define i32 @intel_bo_is_busy(%struct.intel_bo* %0) {
%2 = tail call i64 @intel_bo_wait(%struct.intel_bo* %0, i32 0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
main() {
  char i, s[] = "+-*/";
  for (i = 0; i < 4; i++)
    printf("%d\n", s[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x6(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x4,%eax
jge    1165 <main+0x55>
movsbq -0x5(%rbp),%rax
lea    0xeb7(%rip),%rdi
movsbl -0xa(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1135 <main+0x25>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2b,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2d,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"+-*/\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [5 x i8]
store i32 0, i32* %1
%4 = bitcast [5 x i8]* %3 to i8*
store i8 0, i8* %2
br label %5
5: ; preds = %15, %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i8, i8* %2
%11 = sext i8 %10 to i64
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %13)
br label %15
15: ; preds = %9
%16 = load i8, i8* %2
%17 = add i8 %16, 1
store i8 %17, i8* %2
br label %5
18: ; preds = %5
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 43)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 45)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 42)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 47)
ret i32 0
}
void debug_log(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_results();
int /*<<< orphan*/ tests();
int main(void) {
  tests();
  show_results();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @tests()
%3 = call i32 (...) @show_results()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tests()
%2 = tail call i32 (...) @show_results()
ret i32 0
}
void ADC1Seq0_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<ADC1Seq0_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <ADC1Seq0_Handler+0x9>
jmp    1109 <ADC1Seq0_Handler+0x9>

x86 assembly (clang, -O2):
<ADC1Seq0_Handler>:
jmp    1100 <ADC1Seq0_Handler>

LLVM IR (-O0):
define void @ADC1Seq0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @ADC1Seq0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *, int *, int *);
void checkIntInput(int *a, int *b, int *c) {
  if ((scanf("%d %d %d", a, b, c)) != 3) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkIntInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xea9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x3,%eax
je     117f <checkIntInput+0x4f>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIntInput>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xebf(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x3,%eax
jne    114d <checkIntInput+0x1d>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(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** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, i32* %9)
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1, i32* %2)
%5 = icmp eq i32 %4, 3
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S_AdvanceBackgroundTrack(int);
void S_PrevBackgroundTrack(void) { S_AdvanceBackgroundTrack(-1); }


x86 assembly (clang, -O0):
<S_PrevBackgroundTrack>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <S_AdvanceBackgroundTrack@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_PrevBackgroundTrack>:
mov    $0xffffffff,%edi
jmp    1030 <S_AdvanceBackgroundTrack@plt>

LLVM IR (-O0):
define void @S_PrevBackgroundTrack() {
%1 = call i32 @S_AdvanceBackgroundTrack(i32 -1)
ret void
}

LLVM IR (-O2):
define void @S_PrevBackgroundTrack() {
%1 = tail call i32 @S_AdvanceBackgroundTrack(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void nl(void) { putchar('\n'); }


x86 assembly (clang, -O0):
<nl>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @nl() {
%1 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @nl() {
%1 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void foobar() { foo(); }


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

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

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

LLVM IR (-O2):
define void @foobar() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
#define SIGINT 129
#define SIGTERM 128
int /*<<< orphan*/ stopUSTun();
void signalHandler(int signal) {
  switch (signal) {
  case SIGINT:
  case SIGTERM:
    stopUSTun();
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     113b <signalHandler+0x2b>
jmp    112f <signalHandler+0x1f>
mov    $0x0,%al
call   1030 <stopUSTun@plt>
jmp    1140 <signalHandler+0x30>
jmp    1140 <signalHandler+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHandler>:
and    $0xfffffffe,%edi
cmp    $0x80,%edi
jne    1122 <signalHandler+0x12>
xor    %eax,%eax
jmp    1030 <stopUSTun@plt>
ret

LLVM IR (-O0):
define void @signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 129, label %4
i32 128, label %4
]
4: ; preds = %1, %1
%5 = call i32 (...) @stopUSTun()
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
define void @signalHandler(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 128
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @stopUSTun()
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void SetTile(int screenblock, int x, int y, int tile_num) {
  ((volatile uint16_t *)(0x6000000))[(screenblock * 1024) + (y * 32) + x] =
      tile_num;
}


x86 assembly (clang, -O0):
<SetTile>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
add    -0x8(%rbp),%eax
movslq %eax,%rcx
mov    $0x6000000,%eax
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTile>:
shl    $0xa,%edi
shl    $0x5,%edx
add    %esi,%edi
add    %edx,%edi
movslq %edi,%rax
mov    %ecx,0x6000000(,%rax,4)
ret

LLVM IR (-O0):
define void @SetTile(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 1024
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, 32
%14 = add nsw i32 %11, %13
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %17
store volatile i32 %9, i32* %18
ret void
}

LLVM IR (-O2):
define void @SetTile(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %0, 10
%6 = shl nsw i32 %2, 5
%7 = add i32 %5, %1
%8 = add i32 %7, %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %9
store volatile i32 %3, i32* %10
ret void
}
int sched_getcpu(void) { return 1000; }


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

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

LLVM IR (-O0):
define i32 @sched_getcpu() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @sched_getcpu() {
ret i32 1000
}
void dummyvideo_SetRenderingCallback(void (*callback)(int)) {}


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

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

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

LLVM IR (-O2):
define void @dummyvideo_SetRenderingCallback(void (i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pred(int *, int);
int main(void) {
  int myarray[] = {24, 37, 142, 205};
  pred(myarray, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1030 <pred@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <pred@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.myarray = [4 x i32] [i32 24, i32 37, i32 142, i32 205]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @pred(i32* %4, i32 2)
ret i32 0
}

LLVM IR (-O2):
@__const.main.myarray = [4 x i32] [i32 24, i32 37, i32 142, i32 205]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @pred(i32* %3, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRF4_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMRF4_swap>:
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 <U_WMRNOTIMPLEMENTED_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRF4_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRF4_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRF4_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int foo(int u) { return u * u; }


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
unsigned int countSetBits(unsigned int i) {
  i = i - ((i >> 1) & 0x55555555);
  i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
  return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
}


x86 assembly (clang, -O0):
<countSetBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countSetBits>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @countSetBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 4
%17 = add i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul i32 %18, 16843009
%20 = lshr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @countSetBits(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_time(void *_p, unsigned long _v) {
  ((XButtonEvent *)_p)->time = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XButtonEvent_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
int get_fs_usage(char *path, struct fs_usage *fsp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.fs_usage = type opaque
define i32 @get_fs_usage(i8* nocapture readnone %0, %struct.fs_usage* nocapture readnone %1) {
ret i32 0
}
char *s_buf() { return "test"; }


x86 assembly (clang, -O0):
<s_buf>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_buf>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i8* @s_buf() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i8* @s_buf() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __softboundmpx_safe_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<__softboundmpx_safe_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__softboundmpx_safe_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void ERRORMESSAGE(const char *str) { printf("%s", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @ERRORMESSAGE(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int __attribute__((no)) foo() {
  const int a[8] = {0, 1, 2, 3, 4, 5, 6, 7};
  int i, sum;
  sum = 0;
  for (i = 0; i < sizeof(a) / sizeof(*a); i++)
    sum += a[i];
  return sum;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    $0x8,%rax
jae    1168 <foo+0x68>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113e <foo+0x3e>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.foo.a = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
define i32 @foo() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [8 x i32]* %1 to i8*
store i32 0, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 8
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 28
}
/* Variables and functions */
int hash_check_v2c_valid(void *);
int /*<<< orphan*/ hash_free(void *);
void *hash_init(char const *);
int /*<<< orphan*/ hash_read(void *);
int vendor_license_check(const char *v2cfile) {
  void *ptr = hash_init(v2cfile);
  hash_read(ptr);
  int val = hash_check_v2c_valid(ptr);
  hash_free(ptr);
  return val;
}


x86 assembly (clang, -O0):
<vendor_license_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hash_init@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <hash_read@plt>
mov    -0x10(%rbp),%rdi
call   1030 <hash_check_v2c_valid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <hash_free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vendor_license_check>:
push   %rbp
push   %rbx
push   %rax
call   1040 <hash_init@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <hash_read@plt>
mov    %rbx,%rdi
call   1030 <hash_check_v2c_valid@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <hash_free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vendor_license_check(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @hash_init(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @hash_read(i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @hash_check_v2c_valid(i8* %9)
store i32 %10, i32* %4
%11 = load i8*, i8** %3
%12 = call i32 @hash_free(i8* %11)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
define i32 @vendor_license_check(i8* %0) {
%2 = tail call i8* @hash_init(i8* %0)
%3 = tail call i32 @hash_read(i8* %2)
%4 = tail call i32 @hash_check_v2c_valid(i8* %2)
%5 = tail call i32 @hash_free(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
main() {
  char indentStr[100];
  int i = 1;
  sprintf(indentStr, "%%%ds", i);
  sprintf(indentStr, indentStr, "");
  printf(">%s<\n", indentStr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x1,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%edx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    0xeb5(%rip),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xec6(%rip),%rdx
mov    %rbx,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%%%ds\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c">%s<\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
store i32 1, i32* %2
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* %2
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%%%ds\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c">%s<\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHelp(void) {
  printf("at the shoulders:");
  printf("forward       : q,w");
  printf("backwards     : a,s");
  printf("outwards      : z,x");
  printf("inwards       : Z,X");
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"at the shoulders:\00"
@.str.1 = [20 x i8] c"forward : q,w\00"
@.str.2 = [20 x i8] c"backwards : a,s\00"
@.str.3 = [20 x i8] c"outwards : z,x\00"
@.str.4 = [20 x i8] c"inwards : Z,X\00"
define void @printHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"at the shoulders:\00"
@.str.1 = [20 x i8] c"forward : q,w\00"
@.str.2 = [20 x i8] c"backwards : a,s\00"
@.str.3 = [20 x i8] c"outwards : z,x\00"
@.str.4 = [20 x i8] c"inwards : Z,X\00"
define void @printHelp() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ name();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char yourname[20];
  name();
  scanf("%s", &yourname);
  printf("Your name is : %s\n ", yourname);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <name@plt>
lea    -0x20(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"Your name is : %s\0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 (...) @name()
%4 = bitcast [20 x i8]* %2 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"Your name is : %s\0A \00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @name()
%4 = bitcast [20 x i8]* %1 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LZ4_compressBound(int);
int LZ4_compress_limitedOutput(int, int, int, int /*<<< orphan*/);
int LZ4_compress(int src, int dst, int src_len) {
  return LZ4_compress_limitedOutput(src, dst, src_len,
                                    LZ4_compressBound(src_len));
}


x86 assembly (clang, -O0):
<LZ4_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <LZ4_compressBound@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
call   1040 <LZ4_compress_limitedOutput@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <LZ4_compressBound@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <LZ4_compress_limitedOutput@plt>

LLVM IR (-O0):
define i32 @LZ4_compress(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @LZ4_compressBound(i32 %10)
%12 = call i32 @LZ4_compress_limitedOutput(i32 %7, i32 %8, i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @LZ4_compress(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @LZ4_compressBound(i32 %2)
%5 = tail call i32 @LZ4_compress_limitedOutput(i32 %0, i32 %1, i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
long double NAN;
long double nanl(const char *s) { return NAN; }


x86 assembly (clang, -O0):
<nanl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ee9(%rip),%rax
fldt   (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanl>:
mov    0x2ef1(%rip),%rax
fldt   (%rax)
ret

LLVM IR (-O0):
@NAN = global x86_fp80 0xK00000000000000000000
define x86_fp80 @nanl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load x86_fp80, x86_fp80* @NAN
ret x86_fp80 %3
}

LLVM IR (-O2):
@NAN = global x86_fp80 0xK00000000000000000000
define x86_fp80 @nanl(i8* nocapture readnone %0) {
%2 = load x86_fp80, x86_fp80* @NAN
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int mount(char *spec, char *dir, int rwflag) {
  printf("mount() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [25 x i8] c"mount() not implemented\0A\00"
define i32 @mount(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"mount() not implemented\00"
define i32 @mount(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
double *del_doubarray(double *array) {
  if (array)
    free(array);
  return NULL;
}


x86 assembly (clang, -O0):
<del_doubarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <del_doubarray+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_doubarray>:
test   %rdi,%rdi
je     111f <del_doubarray+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define double* @del_doubarray(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double*, double** %2
%7 = call i32 @free(double* %6)
br label %8
8: ; preds = %5, %1
ret double* null
}

LLVM IR (-O2):
define noalias double* @del_doubarray(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret double* null
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int k = 5 / 2;
  assert(k == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 2, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int priv_mkstemp(path)
char *path;
{
  int fd;
  return (_gettemp(path, &fd, 0) ? fd : -1);
}


x86 assembly (clang, -O0):
<priv_mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <_gettemp@plt>
cmp    $0x0,%eax
je     1141 <priv_mkstemp+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114e <priv_mkstemp+0x3e>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <priv_mkstemp+0x3e>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priv_mkstemp>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <_gettemp@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @priv_mkstemp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i32*, i32, ...) bitcast (i32 (...)* @_gettemp to i32 (i8*, i32*, i32, ...)*)(i8* %4, i32* %3, i32 0)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %3
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ -1, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @priv_mkstemp(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i32*, i32, ...) bitcast (i32 (...)* @_gettemp to i32 (i8*, i32*, i32, ...)*)(i8* %0, i32* %2, i32 0)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t wcore_attrib_list_length(const int32_t attrib_list[]) {
  const int32_t *i = attrib_list;
  if (attrib_list == NULL)
    return 0;
  while (*i != 0)
    i += 2;
  return (i - attrib_list) / 2;
}


x86 assembly (clang, -O0):
<wcore_attrib_list_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <wcore_attrib_list_length+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1169 <wcore_attrib_list_length+0x69>
jmp    112d <wcore_attrib_list_length+0x2d>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <wcore_attrib_list_length+0x4c>
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
jmp    112d <wcore_attrib_list_length+0x2d>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcore_attrib_list_length>:
test   %rdi,%rdi
je     112e <wcore_attrib_list_length+0x2e>
mov    $0xfffffffffffffff0,%rax
nopl   0x0(%rax)
cmpq   $0x0,0x10(%rdi,%rax,1)
lea    0x10(%rax),%rax
jne    1110 <wcore_attrib_list_length+0x10>
mov    %rax,%rcx
sar    $0x3,%rcx
shr    $0x3f,%rax
add    %rcx,%rax
sar    %rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @wcore_attrib_list_length(i64* %0) {
%2 = icmp eq i64* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64* [ %7, %3 ], [ %0, %1 ]
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i64, i64* %4, i64 2
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i64* %4 to i64
%10 = ptrtoint i64* %0 to i64
%11 = sub i64 %9, %10
%12 = ashr exact i64 %11, 3
%13 = sdiv i64 %12, 2
br label %14
14: ; preds = %1, %8
%15 = phi i64 [ %13, %8 ], [ 0, %1 ]
ret i64 %15
}
/* Type definitions */
struct proc_st {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct proc_st *);
int cmd_exit(struct proc_st *proc) {
  free(proc);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<cmd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cmd_exit>:
push   %rax
call   1030 <free@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.proc_st = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @cmd_exit(%struct.proc_st* %0) {
%2 = alloca %struct.proc_st*
store %struct.proc_st* %0, %struct.proc_st** %2
%3 = load %struct.proc_st*, %struct.proc_st** %2
%4 = call i32 @free(%struct.proc_st* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
%struct.proc_st = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @cmd_exit(%struct.proc_st* nocapture %0) {
%2 = tail call i32 @free(%struct.proc_st* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int fun275() { return 275; }


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

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

LLVM IR (-O0):
define i32 @fun275() {
ret i32 275
}

LLVM IR (-O2):
define i32 @fun275() {
ret i32 275
}
double GLMaxF(double x, double y) { return ((x > y) ? x : y); }


x86 assembly (clang, -O0):
<GLMaxF>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <GLMaxF+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <GLMaxF+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLMaxF>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @GLMaxF(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @GLMaxF(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}