xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_bad2() {
  int arr1[10];
  int arr2[20];
  memcpy(arr2, arr1, 44);
}


x86 assembly (clang, -O0):
<memcpy_bad2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_bad2>:
sub    $0x88,%rsp
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x2c,%edx
call   1030 <memcpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @memcpy_bad2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 44)
ret void
}

LLVM IR (-O2):
define void @memcpy_bad2() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 44)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Teapot_SetProjectionMatrix(float const *);
void Teapot_SetProjectionMatrixf(const float pMatrix[16]) {
  Teapot_SetProjectionMatrix(pMatrix);
}


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

x86 assembly (clang, -O2):
<Teapot_SetProjectionMatrixf>:
jmp    1030 <Teapot_SetProjectionMatrix@plt>

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

LLVM IR (-O2):
define void @Teapot_SetProjectionMatrixf(float* %0) {
%2 = tail call i32 @Teapot_SetProjectionMatrix(float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA6_DriverIRQHandler();
__attribute__((weak)) void DMA6_IRQHandler(void) { DMA6_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA6_IRQHandler() {
%1 = call i32 (...) @DMA6_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA6_IRQHandler() {
%1 = tail call i32 (...) @DMA6_DriverIRQHandler()
ret void
}
void *test1(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @test1() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test1() {
ret i8* null
}
void yy_1_ListTransient(char *yytext, int yyleng) {
  ;
  ;
}


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

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

LLVM IR (-O0):
define void @yy_1_ListTransient(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_ListTransient(i8* nocapture %0, i32 %1) {
ret void
}
four() { return (4); }


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

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

LLVM IR (-O0):
define i32 @four() {
ret i32 4
}

LLVM IR (-O2):
define i32 @four() {
ret i32 4
}
signed short interpret_int16(unsigned char *buffer) {
  return ((signed short)(buffer[0]) << 8) | (signed short)(buffer[1]);
}


x86 assembly (clang, -O0):
<interpret_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cwtl
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movswl %cx,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpret_int16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @interpret_int16(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 = zext i8 %5 to i16
%7 = sext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = sext i16 %12 to i32
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @interpret_int16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
unsigned char inportb(unsigned int port) {
  unsigned char ret;
  asm volatile("inb %%dx,%%al;outb %%al,$0x80" : "=a"(ret) : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
out    %al,$0x80
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8 asm sideeffect "inb %dx,%al;outb %al,$$0x80", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i32 %0) {
%2 = tail call i8 asm sideeffect "inb %dx,%al;outb %al,$$0x80", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
void test13(int x) {
  switch (x) {
  case 42:
    break;
  case 11:
    break;
  default:
    test13(42);
    break;
  }
}


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xb,%eax
je     1145 <test13+0x35>
jmp    112f <test13+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2a,%eax
jne    114a <test13+0x3a>
jmp    1140 <test13+0x30>
jmp    1154 <test13+0x44>
jmp    1154 <test13+0x44>
mov    $0x2a,%edi
call   1030 <test13@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test13(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
void gpio_set_value(unsigned gpio, int value) { WARN_ON(1); }


x86 assembly (clang, -O0):
<gpio_set_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gpio_set_value(i32 %0, i32 %1) {
%3 = tail call i32 @WARN_ON(i32 1)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int chkBstInorder(struct node *root) { printf("Under Const"); }


x86 assembly (clang, -O0):
<chkBstInorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [12 x i8] c"Under Const\00"
define i32 @chkBstInorder(%struct.node* %0) {
%2 = alloca i32
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [12 x i8] c"Under Const\00"
define i32 @chkBstInorder(%struct.node* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t abs_s(int16_t var1) {
  int16_t var_out;
  if (var1 == (int16_t)0X8000) {
    var_out = (int16_t)0x7fff;
  } else {
    if (var1 < 0) {
      var_out = -var1;
    } else {
      var_out = var1;
    }
  }
  return (var_out);
}


x86 assembly (clang, -O0):
<abs_s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x8000,-0x4(%rbp)
jne    1120 <abs_s+0x20>
movl   $0x7fff,-0x8(%rbp)
jmp    1142 <abs_s+0x42>
cmpl   $0x0,-0x4(%rbp)
jge    1137 <abs_s+0x37>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113d <abs_s+0x3d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <abs_s+0x42>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_s>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
cmp    $0x8000,%edi
mov    $0x7fff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @abs_s(i32 %0) {
%2 = icmp eq i32 %0, 32768
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = select i1 %2, i32 32767, i32 %3
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void intentional3(char *name) {
  char *new_name = (char *)malloc(strlen((name + 1)));
}


x86 assembly (clang, -O0):
<intentional3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intentional3>:
push   %rax
add    $0x1,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define void @intentional3(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i32 @strlen(i8* %5)
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
ret void
}

LLVM IR (-O2):
define void @intentional3(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i64 @malloc(i32 %3)
ret void
}
/* Variables and functions */
char *format_string(char *, int /*<<< orphan*/);
int /*<<< orphan*/ netstat_bytes(char *, int);
char *netstat_formatbytes(char *info_hash, int direction, char *format) {
  return format_string(format, netstat_bytes(info_hash, direction));
}


x86 assembly (clang, -O0):
<netstat_formatbytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <netstat_bytes@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <format_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netstat_formatbytes>:
push   %rbx
mov    %rdx,%rbx
call   1030 <netstat_bytes@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <format_string@plt>

LLVM IR (-O0):
define i8* @netstat_formatbytes(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @netstat_bytes(i8* %8, i32 %9)
%11 = call i8* @format_string(i8* %7, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @netstat_formatbytes(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @netstat_bytes(i8* %0, i32 %1)
%5 = tail call i8* @format_string(i8* %2, i32 %4)
ret i8* %5
}
int strstartwith(char *a, char *b) {
  int i = 0;
  while (a[i] != 0) {
    if (a[i] != b[i])
      return 0;
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strstartwith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1162 <strstartwith+0x62>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1154 <strstartwith+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1169 <strstartwith+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <strstartwith+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstartwith>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1122 <strstartwith+0x22>
xor    %edx,%edx
nopl   (%rax)
cmp    (%rsi,%rdx,1),%cl
jne    1123 <strstartwith+0x23>
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strstartwith+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strstartwith(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %30, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %33
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %21, %27
br i1 %28, label %29, label %30
29: ; preds = %15
store i32 0, i32* %3
br label %34
30: ; preds = %15
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %7
33: ; preds = %7
store i32 1, i32* %3
br label %34
34: ; preds = %33, %29
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @strstartwith(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %15
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %15, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %11, %13
%15 = add nuw i64 %10, 1
br i1 %14, label %5, label %16
16: ; preds = %9, %5, %2
%17 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ init_uart();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  init_uart();
  while (1) {
    c = getchar();
    putchar(c + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init_uart@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init_uart@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%al
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (...) @init_uart()
br label %4
4: ; preds = %0, %4
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 1
%9 = trunc i32 %8 to i8
%10 = call i32 @putchar(i8 signext %9)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_uart()
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = add i8 %3, 1
%5 = tail call i32 @putchar(i8 signext %4)
br label %2
}
unsigned long hash_djb2a(char *s) {
  unsigned long hash = 5381;
  unsigned long c;
  while ((c = (unsigned long)*s++))
    hash = ((hash << 5) + hash) ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_djb2a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114a <hash_djb2a+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_djb2a+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djb2a>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <hash_djb2a+0x3d>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %rdx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq %cl,%rcx
shl    $0x5,%rax
add    %rdx,%rax
xor    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %rax,%rdx
test   %cl,%cl
jne    1120 <hash_djb2a+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_djb2a(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i64 %7, 33
%11 = xor i64 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
void foo162(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo162(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 10;
  int *y = &x;
  printf("zmienna  x = %d\n", x);
  printf("zmienna  y = %p\n", (void *)y);
  printf("zmienna *y = %d\n", *y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"zmienna x = %d\0A\00"
@.str.1 = [17 x i8] c"zmienna y = %p\0A\00"
@.str.2 = [17 x i8] c"zmienna *y = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to i8*
%8 = ptrtoint i8* %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"zmienna x = %d\0A\00"
@.str.1 = [17 x i8] c"zmienna y = %p\0A\00"
@.str.2 = [17 x i8] c"zmienna *y = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = ptrtoint i32* %1 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
void g_try_realloc() {}


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

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

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

LLVM IR (-O2):
define void @g_try_realloc() {
ret void
}
AX0AR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((((short *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movswl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movswl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     114b <AX0AR1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <AX0AR1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AR1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i16*, i16** %13
%22 = getelementptr inbounds i16, i16* %21, i64 277777
%23 = load i16, i16* %22
%24 = sext i16 %23 to i32
%25 = icmp sle i32 %20, %24
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 1, i32* %7
br label %28
27: ; preds = %6
store i32 0, i32* %7
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %5, i64 277777
%11 = load i16, i16* %10
%12 = icmp sle i16 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef long long uint64_t;

/* Variables and functions */
uint64_t charToBinASCII(unsigned char base) {
  switch (base) {
  case 'A':
  case 'a':
    return (0LL);
  case 'C':
  case 'c':
    return (1LL << (64 - 4));
  case 'G':
  case 'g':
    return (2LL << (64 - 4));
  case 'T':
  case 't':
    return (3LL << (64 - 4));
  default:
    return (4LL << (64 - 4));
  }
}


x86 assembly (clang, -O0):
<charToBinASCII>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x33,%eax
ja     117a <charToBinASCII+0x7a>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0x0,-0x8(%rbp)
jmp    1188 <charToBinASCII+0x88>
movabs $0x1000000000000000,%rax
mov    %rax,-0x8(%rbp)
jmp    1188 <charToBinASCII+0x88>
movabs $0x2000000000000000,%rax
mov    %rax,-0x8(%rbp)
jmp    1188 <charToBinASCII+0x88>
movabs $0x3000000000000000,%rax
mov    %rax,-0x8(%rbp)
jmp    1188 <charToBinASCII+0x88>
movabs $0x4000000000000000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToBinASCII>:
add    $0xbf,%dil
cmp    $0x33,%dil
ja     1141 <charToBinASCII+0x41>
xor    %eax,%eax
movzbl %dil,%ecx
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
movabs $0x1000000000000000,%rax
ret
movabs $0x2000000000000000,%rax
ret
movabs $0x3000000000000000,%rax
ret
movabs $0x4000000000000000,%rax
ret

LLVM IR (-O0):
define i64 @charToBinASCII(i8 zeroext %0) {
%2 = alloca i64
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
]
6: ; preds = %1, %1
store i64 0, i64* %2
br label %11
7: ; preds = %1, %1
store i64 1152921504606846976, i64* %2
br label %11
8: ; preds = %1, %1
store i64 2305843009213693952, i64* %2
br label %11
9: ; preds = %1, %1
store i64 3458764513820540928, i64* %2
br label %11
10: ; preds = %1
store i64 4611686018427387904, i64* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @charToBinASCII(i8 zeroext %0) {
switch i8 %0, label %5 [
i8 65, label %6
i8 97, label %6
i8 67, label %2
i8 99, label %2
i8 71, label %3
i8 103, label %3
i8 84, label %4
i8 116, label %4
]
2: ; preds = %1, %1
br label %6
3: ; preds = %1, %1
br label %6
4: ; preds = %1, %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %1, %5, %4, %3, %2
%7 = phi i64 [ 4611686018427387904, %5 ], [ 3458764513820540928, %4 ], [ 2305843009213693952, %3 ], [ 1152921504606846976, %2 ], [ 0, %1 ], [ 0, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *);
int secure_temp_file();
int main() {
  int fd = secure_temp_file();
  if (fd != -1) {
    printf("create file success, now close it\n");
    close(fd);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <secure_temp_file@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1167 <main+0x37>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <secure_temp_file@plt>
cmp    $0xffffffff,%eax
je     1152 <main+0x22>
mov    %eax,%ebx
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"create file success, now close it\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @secure_temp_file()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = call i32 @close(i32 %8)
br label %10
10: ; preds = %6, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@str = [34 x i8] c"create file success, now close it\00"
define i32 @main() {
%1 = tail call i32 (...) @secure_temp_file()
%2 = icmp eq i32 %1, -1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @close(i32 %1)
br label %6
6: ; preds = %3, %0
ret i32 0
}
int get1w(fd)
int fd;
{
  int i;
  if (read(fd, &i, sizeof(int)) != sizeof(int))
    return -1;
  return i;
}


x86 assembly (clang, -O0):
<get1w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <read@plt>
cltq
cmp    $0x4,%rax
je     1146 <get1w+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <get1w+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get1w>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x4,%ecx
jne    1132 <get1w+0x22>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get1w(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32, i32*, i64, ...) bitcast (i32 (...)* @read to i32 (i32, i32*, i64, ...)*)(i32 %0, i32* %2, i64 4)
%5 = icmp eq i32 %4, 4
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
char const *inet_ntop(int, void const *, char *, size_t);
const char *networkToPresentation(int af, const void *src, char *dst,
                                  size_t size) {
  return inet_ntop(af, src, dst, size);
}


x86 assembly (clang, -O0):
<networkToPresentation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <inet_ntop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<networkToPresentation>:
jmp    1030 <inet_ntop@plt>

LLVM IR (-O0):
define i8* @networkToPresentation(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i8* @inet_ntop(i32 %9, i8* %10, i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @networkToPresentation(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i64 %3)
ret i8* %5
}
void task_blk_io_accounting_add(struct task_io_accounting *dst,
                                struct task_io_accounting *src) {}


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

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

LLVM IR (-O0):
%struct.task_io_accounting = type opaque
define void @task_blk_io_accounting_add(%struct.task_io_accounting* %0, %struct.task_io_accounting* %1) {
%3 = alloca %struct.task_io_accounting*
%4 = alloca %struct.task_io_accounting*
store %struct.task_io_accounting* %0, %struct.task_io_accounting** %3
store %struct.task_io_accounting* %1, %struct.task_io_accounting** %4
ret void
}

LLVM IR (-O2):
%struct.task_io_accounting = type opaque
define void @task_blk_io_accounting_add(%struct.task_io_accounting* nocapture %0, %struct.task_io_accounting* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fatal_OutOfMemory();
double atof(char const *);
scalar_t__ malloc(int);
void MakeDoubleLiteral(const char *p_token, long *r_literal) {
  double *t_value;
  t_value = (double *)malloc(sizeof(double));
  if (t_value == NULL)
    Fatal_OutOfMemory();
  *t_value = atof(p_token);
  *r_literal = (long)t_value;
}


x86 assembly (clang, -O0):
<MakeDoubleLiteral>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <MakeDoubleLiteral+0x30>
mov    $0x0,%al
call   1040 <Fatal_OutOfMemory@plt>
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeDoubleLiteral>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1154 <MakeDoubleLiteral+0x24>
xor    %eax,%eax
call   1040 <Fatal_OutOfMemory@plt>
mov    %r15,%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%rbx)
mov    %rbx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @MakeDoubleLiteral(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca double*
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = call i64 @malloc(i32 8)
%7 = inttoptr i64 %6 to double*
store double* %7, double** %5
%8 = load double*, double** %5
%9 = icmp eq double* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @Fatal_OutOfMemory()
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %3
%14 = call double @atof(i8* %13)
%15 = load double*, double** %5
store double %14, double* %15
%16 = load double*, double** %5
%17 = ptrtoint double* %16 to i64
%18 = load i64*, i64** %4
store i64 %17, i64* %18
ret void
}

LLVM IR (-O2):
define void @MakeDoubleLiteral(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @malloc(i32 8)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @Fatal_OutOfMemory()
br label %7
7: ; preds = %5, %2
%8 = inttoptr i64 %3 to double*
%9 = tail call double @atof(i8* %0)
store double %9, double* %8
store i64 %3, i64* %1
ret void
}
void f1a() {}


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

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

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

LLVM IR (-O2):
define void @f1a() {
ret void
}
int drm_debugfs_cleanup(struct drm_minor *minor) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_minor = type opaque
define i32 @drm_debugfs_cleanup(%struct.drm_minor* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t extract_h(int32_t L_var1) {
  int16_t var_out;
  var_out = (int16_t)(L_var1 >> 16);
  return (var_out);
}


x86 assembly (clang, -O0):
<extract_h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_h>:
sar    $0x10,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @extract_h(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 16
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @extract_h(i32 %0) {
%2 = ashr i32 %0, 16
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int, int /*<<< orphan*/);
void set_pic0_mask(uint8_t mask) { outb(0x0021, mask); }


x86 assembly (clang, -O0):
<set_pic0_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x21,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pic0_mask>:
mov    %edi,%esi
mov    $0x21,%edi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @set_pic0_mask(i32 %0) {
%2 = tail call i32 @outb(i32 33, i32 %0)
ret void
}
void g_completion_new() {}


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

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

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

LLVM IR (-O2):
define void @g_completion_new() {
ret void
}
int count_args(char **x) {
  int n = 0;
  while (*x) {
    n++;
    x++;
  }
  return n;
}


x86 assembly (clang, -O0):
<count_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1137 <count_args+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <count_args+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_args>:
cmpq   $0x0,(%rdi)
je     111d <count_args+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <count_args+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @count_args(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i8**, i8*** %2
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @count_args(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8** [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
void INT_Excep_MTU0_TGID0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU0_TGID0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char input[200];
  scanf("%s", input);
  printf("%ld\n", hash(input));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char toupper(char);
void arrayToUpper(char *array, int len) {
  int i;
  for (i = 0; i < len; i++) {
    array[i] = toupper(array[i]);
  }
}


x86 assembly (clang, -O0):
<arrayToUpper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <arrayToUpper+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <arrayToUpper+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayToUpper>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <arrayToUpper+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <arrayToUpper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @arrayToUpper(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_IMM_W(int, int /*<<< orphan*/);
int /*<<< orphan*/ addbyte(int);
int CMP_HOST_REG_IMM_W(int host_reg, uint16_t imm) {
  if (host_reg & 8) {
    addbyte(0x44);
    addbyte(0x89);
    addbyte(0xc0 | ((host_reg & 7) << 3) | 2);
    host_reg = 2;
  }
  SUB_HOST_REG_IMM_W(host_reg, imm);
  return host_reg;
}


x86 assembly (clang, -O0):
<CMP_HOST_REG_IMM_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     116f <CMP_HOST_REG_IMM_W+0x4f>
mov    $0x44,%edi
call   1040 <addbyte@plt>
mov    $0x89,%edi
call   1040 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     $0x2,%edi
call   1040 <addbyte@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <SUB_HOST_REG_IMM_W@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP_HOST_REG_IMM_W>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   $0x8,%bpl
je     1158 <CMP_HOST_REG_IMM_W+0x38>
mov    $0x44,%edi
call   1040 <addbyte@plt>
mov    $0x89,%edi
call   1040 <addbyte@plt>
shl    $0x3,%ebp
or     $0xc2,%ebp
movzbl %bpl,%edi
call   1040 <addbyte@plt>
mov    $0x2,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <SUB_HOST_REG_IMM_W@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CMP_HOST_REG_IMM_W(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = call i32 @addbyte(i32 68)
%10 = call i32 @addbyte(i32 137)
%11 = load i32, i32* %3
%12 = and i32 %11, 7
%13 = shl i32 %12, 3
%14 = or i32 192, %13
%15 = or i32 %14, 2
%16 = call i32 @addbyte(i32 %15)
store i32 2, i32* %3
br label %17
17: ; preds = %8, %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @SUB_HOST_REG_IMM_W(i32 %18, i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @CMP_HOST_REG_IMM_W(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @addbyte(i32 68)
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 194
%11 = tail call i32 @addbyte(i32 %10)
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 2, %5 ], [ %0, %2 ]
%14 = tail call i32 @SUB_HOST_REG_IMM_W(i32 %13, i32 %1)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1
}
unsigned char *kolibri_get_imgbuffer_from_bitmap(void *bitmap) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @kolibri_get_imgbuffer_from_bitmap(i8* nocapture readnone %0) {
ret i8* undef
}