xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void web_task() { printf("web_task\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"web_task\0A\00"
define void @web_task() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"web_task\00"
define void @web_task() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int kalle(int a, int b) {
  if (a == 15)
    return 1;
  if (a == 10 && b == 19)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<kalle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xf,-0x8(%rbp)
jne    1120 <kalle+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1147 <kalle+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1140 <kalle+0x40>
cmpl   $0x13,-0xc(%rbp)
jne    1140 <kalle+0x40>
movl   $0x2,-0x4(%rbp)
jmp    1147 <kalle+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kalle>:
mov    %edi,%eax
xor    $0xa,%eax
xor    $0x13,%esi
xor    %ecx,%ecx
or     %eax,%esi
sete   %cl
add    %ecx,%ecx
cmp    $0xf,%edi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @kalle(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 15
%4 = icmp eq i32 %0, 10
%5 = icmp eq i32 %1, 19
%6 = and i1 %4, %5
%7 = select i1 %6, i32 2, i32 0
%8 = select i1 %3, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
prefix(const char *pre, const char *str) {
  return strncmp(pre, str, strlen(pre)) == 0;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prefix(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @prefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int divisionRemain(int x, int y) { return x / y; }


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

x86 assembly (clang, -O2):
<divisionRemain>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @divisionRemain(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 = load i32, i32* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @divisionRemain(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int connectServer(char const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int connectToBroker(const char *host) {
  int fileDescriptor = connectServer(host);
  if (fileDescriptor < 0) {
    perror("ERROR connection failed!");
    exit(EXIT_FAILURE);
  }
  puts("Connected\nCreating task...\n");
  return fileDescriptor;
}


x86 assembly (clang, -O0):
<connectToBroker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <connectServer@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    117c <connectToBroker+0x3c>
lea    0xe97(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connectToBroker>:
push   %rbx
call   1060 <connectServer@plt>
test   %eax,%eax
js     115c <connectToBroker+0x1c>
mov    %eax,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ERROR connection failed!\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [28 x i8] c"Connected\0ACreating task...\0A\00"
define i32 @connectToBroker(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @connectServer(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [25 x i8] c"ERROR connection failed!\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [28 x i8] c"Connected\0ACreating task...\0A\00"
define i32 @connectToBroker(i8* %0) {
%2 = tail call i32 @connectServer(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct bladerf {
  int dummy;
};

/* Variables and functions */
int nios_8x8_write(struct bladerf *, int, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int nios_si5338_write(struct bladerf *dev, uint8_t addr, uint8_t data) {
  int status = nios_8x8_write(dev, 0x01, addr, data);
  if (status == 0) {
    do {
      do {
      } while (0);
    } while (0);
  }
  return status;
}


x86 assembly (clang, -O0):
<nios_si5338_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%esi
call   1030 <nios_8x8_write@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115c <nios_si5338_write+0x4c>
jmp    1148 <nios_si5338_write+0x38>
jmp    114d <nios_si5338_write+0x3d>
jmp    1152 <nios_si5338_write+0x42>
jmp    1157 <nios_si5338_write+0x47>
jmp    115c <nios_si5338_write+0x4c>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_si5338_write>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <nios_8x8_write@plt>

LLVM IR (-O0):
%struct.bladerf = type { i32 }
define i32 @nios_si5338_write(%struct.bladerf* %0, i32 %1, i32 %2) {
%4 = alloca %struct.bladerf*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.bladerf* %0, %struct.bladerf** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.bladerf*, %struct.bladerf** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @nios_8x8_write(%struct.bladerf* %8, i32 1, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_si5338_write(%struct.bladerf* %0, i32 %1, i32 %2) {
%4 = tail call i32 @nios_8x8_write(%struct.bladerf* %0, i32 1, i32 %1, i32 %2)
ret i32 %4
}
void EnterCritical(void) { return; }


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

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

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

LLVM IR (-O2):
define void @EnterCritical() {
ret void
}
int decrypt_byte(unsigned long *pkeys) {
  unsigned temp;
  temp = ((unsigned)(*(pkeys + 2)) & 0xffff) | 2;
  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
and    $0xffff,%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_byte>:
mov    $0xfffd,%eax
and    0x10(%rdi),%eax
lea    0x2(%rax),%ecx
xor    $0x3,%eax
imul   %ecx,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @decrypt_byte(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 2
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 65535
%9 = or i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = xor i32 %11, 1
%13 = mul i32 %10, %12
%14 = lshr i32 %13, 8
%15 = and i32 %14, 255
ret i32 %15
}

LLVM IR (-O2):
define i32 @decrypt_byte(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 65533
%6 = or i32 %5, 2
%7 = xor i32 %5, 3
%8 = mul nuw i32 %6, %7
%9 = lshr i32 %8, 8
%10 = and i32 %9, 255
ret i32 %10
}
int main() {
  volatile int val[] = {1, 2, 3, 4, 5};
  volatile int **ptr = malloc(sizeof(int *));
  *ptr = &val;
  return (*ptr)[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    0xee7(%rip),%ecx
mov    %ecx,0x10(%rax)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rax)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0xef9(%rip),%rax
mov    %rax,-0x18(%rsp)
mov    0xef6(%rip),%eax
mov    %eax,-0x20(%rsp)
mov    0xeef(%rip),%rax
mov    %rax,-0x8(%rsp)
mov    -0x20(%rsp),%eax
ret

LLVM IR (-O0):
@__const.main.val = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32**
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = call i8* @malloc(i64 8)
%6 = bitcast i8* %5 to i32**
store i32** %6, i32*** %3
%7 = bitcast [5 x i32]* %2 to i32*
%8 = load i32**, i32*** %3
store i32* %7, i32** %8
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load volatile i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
@__const.main.val = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = load volatile i64, i64* bitcast ([5 x i32]* @__const.main.val to i64*)
store volatile i64 %7, i64* %1
%8 = load volatile i32, i32* getelementptr inbounds ([5 x i32], [5 x i32]* @__const.main.val, i64 0, i64 2)
store volatile i32 %8, i32* %2
%9 = load volatile i64, i64* bitcast (i32* getelementptr inbounds ([5 x i32], [5 x i32]* @__const.main.val, i64 0, i64 3) to i64*)
store volatile i64 %9, i64* %3
%10 = load volatile i32, i32* %2
ret i32 %10
}
int fun1093() { return 1093; }


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

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

LLVM IR (-O0):
define i32 @fun1093() {
ret i32 1093
}

LLVM IR (-O2):
define i32 @fun1093() {
ret i32 1093
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void handler(int s) {
  printf("recv sig %d\n", s);
  sleep(5);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <sleep@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"recv sig %d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 5)
ret void
}
int max_3(int a, int b, int c) {
  int m;
  if (a < b)
    m = b;
  else
    m = a;
  if (m < c)
    return c;
  return m;
}


x86 assembly (clang, -O0):
<max_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <max_3+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <max_3+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1141 <max_3+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <max_3+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_3>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @max_3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %6
store i32 %13, i32* %8
br label %16
14: ; preds = %3
%15 = load i32, i32* %5
store i32 %15, i32* %8
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %7
store i32 %21, i32* %4
br label %24
22: ; preds = %16
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %24
24: ; preds = %22, %20
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @max_3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
int *hop(int *e) { return *e + e; }


x86 assembly (clang, -O0):
<hop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hop>:
movslq (%rdi),%rax
lea    (%rdi,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i32* @hop(i32* %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void timer_init(void) {
  PUT32((0x20000000 + 0x0000B408), 0x00F90000);
  PUT32((0x20000000 + 0x0000B408), 0x00F90200);
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2000b408,%edi
mov    $0xf90000,%esi
call   1030 <PUT32@plt>
mov    $0x2000b408,%edi
mov    $0xf90200,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
push   %rax
mov    $0x2000b408,%edi
mov    $0xf90000,%esi
call   1030 <PUT32@plt>
mov    $0x2000b408,%edi
mov    $0xf90200,%esi
pop    %rax
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @timer_init() {
%1 = call i32 @PUT32(i32 536917000, i32 16318464)
%2 = call i32 @PUT32(i32 536917000, i32 16318976)
ret void
}

LLVM IR (-O2):
define void @timer_init() {
%1 = tail call i32 @PUT32(i32 536917000, i32 16318464)
%2 = tail call i32 @PUT32(i32 536917000, i32 16318976)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scpi_send_byte_impl(char);
void scpi_send_string_raw(const char *message) {
  char c;
  while ((c = *message++) != 0) {
    scpi_send_byte_impl(c);
  }
}


x86 assembly (clang, -O0):
<scpi_send_string_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114a <scpi_send_string_raw+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <scpi_send_byte_impl@plt>
jmp    111c <scpi_send_string_raw+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scpi_send_string_raw>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <scpi_send_string_raw+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <scpi_send_byte_impl@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <scpi_send_string_raw+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @scpi_send_string_raw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
store i8 %7, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8, i8* %3
%12 = call i32 @scpi_send_byte_impl(i8 signext %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @scpi_send_string_raw(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @scpi_send_byte_impl(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int c;
int max(int, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  extern int A, B;
  static c = 3;
  printf("%d\n", max(A, B));
  printf("%d\n", A);
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ecc(%rip),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <max@plt>
lea    0xebd(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@main.c = internal global i32 3
@.str = [4 x i8] c"%d\0A\00"
@A = external global i32
@B = external global i32
@c = global i32 0
define void @main() {
%1 = load i32, i32* @A
%2 = load i32, i32* @B
%3 = call i32 @max(i32 %1, i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @A
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @main.c
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@A = external global i32
@B = external global i32
@c = global i32 0
define void @main() {
%1 = load i32, i32* @A
%2 = load i32, i32* @B
%3 = tail call i32 @max(i32 %1, i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @A
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
double cs2(double);
double sigma(double);
double pres(double x) { return cs2(x) * sigma(x); }


x86 assembly (clang, -O0):
<pres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cs2@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sigma@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pres>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cs2@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sigma@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @pres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cs2(double %3)
%5 = load double, double* %2
%6 = call double @sigma(double %5)
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @pres(double %0) {
%2 = tail call double @cs2(double %0)
%3 = tail call double @sigma(double %0)
%4 = fmul double %2, %3
ret double %4
}
unsigned char _ucAsyncSetPort(unsigned char ucPortNo) { return (1); }


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

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

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

LLVM IR (-O2):
define zeroext i8 @_ucAsyncSetPort(i8 zeroext %0) {
ret i8 1
}
char odd(int n) {
  if (n % 2 != 0) {
    return '0';
  } else {
    return 'E';
  }
}


x86 assembly (clang, -O0):
<odd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1124 <odd+0x24>
movb   $0x30,-0x1(%rbp)
jmp    1128 <odd+0x28>
movb   $0x45,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd>:
test   $0x1,%dil
mov    $0x45,%ecx
mov    $0x30,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @odd(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 48, i8* %2
br label %9
8: ; preds = %1
store i8 69, i8* %2
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @odd(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8 69, i8 48
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ LOCK_EX;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ flock(int /*<<< orphan*/, int /*<<< orphan*/);
void flockfile(FILE *filehandle) { flock(fileno(filehandle), LOCK_EX); }


x86 assembly (clang, -O0):
<flockfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
call   1040 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flockfile>:
push   %rax
call   1030 <fileno@plt>
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <flock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
define void @flockfile(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = load i32, i32* @LOCK_EX
%6 = call i32 @flock(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
define void @flockfile(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = load i32, i32* @LOCK_EX
%4 = tail call i32 @flock(i32 %2, i32 %3)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec + t.tv_usec * 1.0e-6;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
int test_imm_55uint32_reg(unsigned int val) {
  return ((val) & (0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x55,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_55uint32_reg>:
test   $0x55,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_55uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 85
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_55uint32_reg(i32 %0) {
%2 = and i32 %0, 85
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ alloca(int);
char *dummy(void) {
  char *save = (char *)alloca(4);
  return save;
}


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

x86 assembly (clang, -O2):
<dummy>:
mov    $0x4,%edi
jmp    1030 <alloca@plt>

LLVM IR (-O0):
define i8* @dummy() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
define i8* @dummy() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printSolution(int solution[], int C) {
  for (int i = 0; i < C; i++)
    printf("%d ", solution[i]);
}


x86 assembly (clang, -O0):
<printSolution>:
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    1157 <printSolution+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printSolution+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSolution>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printSolution+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printSolution+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printSolution(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
double sphere(float);
int main() {
  float d;
  printf("Input a number, please ?   ");
  scanf("%f", &d);
  printf("Volume of sphere is  %f(L)\n", sphere(d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1050 <sphere@plt>
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <sphere@plt>
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Input a number, please ? \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"Volume of sphere is %f(L)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call double @sphere(float %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Input a number, please ? \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"Volume of sphere is %f(L)\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call double @sphere(float %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
__attribute__((no, noclone)) unsigned int bar(unsigned char *p) {
  return ((unsigned int)p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
}


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

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

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

LLVM IR (-O2):
define i32 @bar(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ cmdl_print_options();
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *dbpath) {
  printf("\nUsage: dlgr [tracker] [options]\n");
  cmdl_print_options();
  printf("\n\nDefault db: '%s'\n", dbpath);
  printf("\nHomepage: http://www.christoph-polcin.com/project/dlgr\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cmdl_print_options@plt>
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <cmdl_print_options@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AUsage: dlgr [tracker] [options]\0A\00"
@.str.1 = [20 x i8] c"\0A\0ADefault db: '%s'\0A\00"
@.str.2 = [58 x i8] c"\0AHomepage: http://www.christoph-polcin.com/project/dlgr\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @cmdl_print_options()
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"\0A\0ADefault db: '%s'\0A\00"
@str = [33 x i8] c"\0AUsage: dlgr [tracker] [options]\00"
@str.3 = [57 x i8] c"\0AHomepage: http://www.christoph-polcin.com/project/dlgr\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @cmdl_print_options()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int goodfunc(const char *str) {
  printf("\nHi, I'm a good function.  I was passed: %s\n\n", str);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"\0AHi, I'm a good function. I was passed: %s\0A\0A\00"
define i32 @goodfunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"\0AHi, I'm a good function. I was passed: %s\0A\0A\00"
define i32 @goodfunc(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rul___emit_newline();
int /*<<< orphan*/ rul___emit_string(char *);
int /*<<< orphan*/ rul___emit_verify_newline();
void rul__emit_real_comment(char *arbitrary_str) {
  rul___emit_verify_newline();
  rul___emit_string("/* ");
  rul___emit_string(arbitrary_str);
  rul___emit_string(" */");
  rul___emit_newline();
}


x86 assembly (clang, -O0):
<rul__emit_real_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rul___emit_verify_newline@plt>
lea    0xeb6(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rul___emit_string@plt>
lea    0xea5(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    $0x0,%al
call   1050 <rul___emit_newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__emit_real_comment>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <rul___emit_verify_newline@plt>
lea    0xebe(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    %rbx,%rdi
call   1030 <rul___emit_string@plt>
lea    0xeae(%rip),%rdi
call   1030 <rul___emit_string@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <rul___emit_newline@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"/* \00"
@.str.1 = [4 x i8] c" */\00"
define void @rul__emit_real_comment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @rul___emit_verify_newline()
%4 = call i32 @rul___emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @rul___emit_string(i8* %5)
%7 = call i32 @rul___emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @rul___emit_newline()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"/* \00"
@.str.1 = [4 x i8] c" */\00"
define void @rul__emit_real_comment(i8* %0) {
%2 = tail call i32 (...) @rul___emit_verify_newline()
%3 = tail call i32 @rul___emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @rul___emit_string(i8* %0)
%5 = tail call i32 @rul___emit_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @rul___emit_newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello GIT!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hello GIT!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello GIT!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void hdmi_force_init(void) {}


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

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

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

LLVM IR (-O2):
define void @hdmi_force_init() {
ret void
}
/* Variables and functions */
int ig_indirect_table_get(unsigned int, int, unsigned int, int, unsigned int *);
int ig_poc_lut_table_get(unsigned int dev_id, unsigned int index,
                         unsigned int *pentry) {
  if ((index < 0) || (index > 47)) {
    return -1;
  }
  return ig_indirect_table_get(dev_id, 4, index, 4, pentry);
}


x86 assembly (clang, -O0):
<ig_poc_lut_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jb     1136 <ig_poc_lut_table_get+0x26>
cmpl   $0x2f,-0xc(%rbp)
jbe    1142 <ig_poc_lut_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <ig_poc_lut_table_get+0x4b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x4,%ecx
mov    %ecx,%esi
call   1030 <ig_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ig_poc_lut_table_get>:
cmp    $0x2f,%esi
jbe    111b <ig_poc_lut_table_get+0xb>
mov    $0xffffffff,%eax
ret
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x4,%esi
mov    $0x4,%ecx
jmp    1030 <ig_indirect_table_get@plt>

LLVM IR (-O0):
define i32 @ig_poc_lut_table_get(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 47
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @ig_indirect_table_get(i32 %15, i32 4, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @ig_poc_lut_table_get(i32 %0, i32 %1, i32* %2) {
%4 = icmp ugt i32 %1, 47
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @ig_indirect_table_get(i32 %0, i32 4, i32 %1, i32 4, i32* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
int fs_http_statvfs(const char *url, struct statvfs *buf) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.statvfs = type opaque
define i32 @fs_http_statvfs(i8* nocapture readnone %0, %struct.statvfs* nocapture readnone %1) {
ret i32 0
}
void cw1200_debug_release(struct cw1200_common *priv) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define void @cw1200_debug_release(%struct.cw1200_common* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_max_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 __attribute__((no, unused)) test(__m128 s1, __m128 s2) {
  return _mm_max_ps(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_max_ps@plt>

LLVM IR (-O0):
define i32 @test(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 = load i32, i32* %4
%7 = call i32 @_mm_max_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ eth_gpio_config();
int /*<<< orphan*/ eth_mac_config();
int /*<<< orphan*/ eth_nvic_config();
void LOS_EvbEthInit(void) {
  eth_gpio_config();
  eth_nvic_config();
  eth_mac_config();
}


x86 assembly (clang, -O0):
<LOS_EvbEthInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <eth_gpio_config@plt>
mov    $0x0,%al
call   1030 <eth_nvic_config@plt>
mov    $0x0,%al
call   1050 <eth_mac_config@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOS_EvbEthInit>:
push   %rax
xor    %eax,%eax
call   1040 <eth_gpio_config@plt>
xor    %eax,%eax
call   1030 <eth_nvic_config@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <eth_mac_config@plt>

LLVM IR (-O0):
define void @LOS_EvbEthInit() {
%1 = call i32 (...) @eth_gpio_config()
%2 = call i32 (...) @eth_nvic_config()
%3 = call i32 (...) @eth_mac_config()
ret void
}

LLVM IR (-O2):
define void @LOS_EvbEthInit() {
%1 = tail call i32 (...) @eth_gpio_config()
%2 = tail call i32 (...) @eth_nvic_config()
%3 = tail call i32 (...) @eth_mac_config()
ret void
}
/* Variables and functions */
int sumFooStatic(int, int);
int sumFooShared(int a, int b) { return sumFooStatic(a, b); }


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

x86 assembly (clang, -O2):
<sumFooShared>:
jmp    1030 <sumFooStatic@plt>

LLVM IR (-O0):
define i32 @sumFooShared(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 = load i32, i32* %4
%7 = call i32 @sumFooStatic(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sumFooShared(i32 %0, i32 %1) {
%3 = tail call i32 @sumFooStatic(i32 %0, i32 %1)
ret i32 %3
}