xunge/DecIR huggingface dataset:
void UARTTxDMAThresholdControl(unsigned int baseAdd,
                               unsigned int thrsCtrlFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x80)))) &= ~((0x00000004u));
  (*((volatile unsigned int *)(baseAdd + (0x80)))) |=
      (thrsCtrlFlag & (0x00000004u));
}


x86 assembly (clang, -O0):
<UARTTxDMAThresholdControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x4,%edx
mov    -0x4(%rbp),%eax
add    $0x80,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTTxDMAThresholdControl>:
sub    $0xffffff80,%edi
andl   $0xfffffffb,(%rdi)
and    $0x4,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTTxDMAThresholdControl(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 = add i32 %5, 128
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -5
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 4
%13 = load i32, i32* %3
%14 = add i32 %13, 128
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTTxDMAThresholdControl(i32 %0, i32 %1) {
%3 = add i32 %0, 128
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -5
store volatile i32 %7, i32* %5
%8 = and i32 %1, 4
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
__attribute__((__weak__, __always___)) int
softboundcets_select(int nfds, fd_set *readfds, fd_set *writefds,
                     fd_set *exceptfds, struct timeval *timeout) {
  return select(nfds, readfds, writefds, exceptfds, timeout);
}


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

x86 assembly (clang, -O2):
<softboundcets_select>:
jmp    1030 <select@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define weak i32 @softboundcets_select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load %struct.timeval*, %struct.timeval** %10
%16 = call i32 @select(i32 %11, i32* %12, i32* %13, i32* %14, %struct.timeval* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define weak i32 @softboundcets_select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = tail call i32 @select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4)
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int is_little_endian() {
  union {
    uint16_t value;
    uint8_t bytes[2];
  } test;
  test.value = 1;
  return test.bytes[0] == 1;
}


x86 assembly (clang, -O0):
<is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define i32 @is_little_endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to [2 x i32]*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_little_endian() {
ret i32 1
}
/* Variables and functions */
scalar_t__ malloc(int);
int *mallocInt(int val) {
  int *temp = (int *)malloc(sizeof(int));
  *temp = val;
  return temp;
}


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

x86 assembly (clang, -O2):
<mallocInt>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @mallocInt(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 %0, i32* %3
ret i32* %3
}
int test_imm_8Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x8F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Fuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x8f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Fuint8_mem>:
testb  $0x8f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -113
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ showArrayOfPointers();
int /*<<< orphan*/ showNullPointers();
int /*<<< orphan*/ showPointerArithmatic();
int /*<<< orphan*/ showPointers();
int main() {
  showPointers();
  showNullPointers();
  showPointerArithmatic();
  showArrayOfPointers();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <showPointers@plt>
xor    %eax,%eax
call   1060 <showNullPointers@plt>
xor    %eax,%eax
call   1040 <showPointerArithmatic@plt>
xor    %eax,%eax
call   1030 <showArrayOfPointers@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @showPointers()
%3 = call i32 (...) @showNullPointers()
%4 = call i32 (...) @showPointerArithmatic()
%5 = call i32 (...) @showArrayOfPointers()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @showPointers()
%2 = tail call i32 (...) @showNullPointers()
%3 = tail call i32 (...) @showPointerArithmatic()
%4 = tail call i32 (...) @showArrayOfPointers()
ret i32 0
}
void g_source_remove_by_user_data() {}


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

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

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

LLVM IR (-O2):
define void @g_source_remove_by_user_data() {
ret void
}
int g(void) { return 6 * 7; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 42
}

LLVM IR (-O2):
define i32 @g() {
ret i32 42
}
/* Type definitions */
struct sbuf {
  int dummy;
};

/* Variables and functions */
int sbuf_append(struct sbuf *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int sbuf_append_string(struct sbuf *sbuf, const char *s) {
  return sbuf_append(sbuf, s, strlen(s));
}


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

x86 assembly (clang, -O2):
<sbuf_append_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sbuf_append@plt>

LLVM IR (-O0):
%struct.sbuf = type { i32 }
define i32 @sbuf_append_string(%struct.sbuf* %0, i8* %1) {
%3 = alloca %struct.sbuf*
%4 = alloca i8*
store %struct.sbuf* %0, %struct.sbuf** %3
store i8* %1, i8** %4
%5 = load %struct.sbuf*, %struct.sbuf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @sbuf_append(%struct.sbuf* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.sbuf = type { i32 }
define i32 @sbuf_append_string(%struct.sbuf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @sbuf_append(%struct.sbuf* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ play();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("--------------------------------tic-tac-teo--------------------------"
         "-----\n");
  play();
  printf("--------------------------------tic-tac-teo--------------------------"
         "-----\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <play@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"--------------------------------tic-tac-teo-------------------------------\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @play()
%4 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.1 = [75 x i8] c"--------------------------------tic-tac-teo-------------------------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.1, i64 0, i64 0))
%2 = tail call i32 (...) @play()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}
void uart_putc(unsigned char ch) {
  while (1) {
    if (((*(volatile unsigned int *)(0x7F005010)) & 6) == 6)
      break;
  }
  (*(volatile unsigned int *)(0x7F005020)) = ch;
  return;
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005010,%eax
mov    (%rax),%eax
and    $0x6,%eax
cmp    $0x6,%eax
jne    1122 <uart_putc+0x22>
jmp    1127 <uart_putc+0x27>
jmp    110a <uart_putc+0xa>
movzbl -0x1(%rbp),%ecx
mov    $0x7f005020,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
mov    0x7f005010,%eax
not    %eax
test   $0x6,%al
jne    1100 <uart_putc>
movzbl %dil,%eax
mov    %eax,0x7f005020
ret

LLVM IR (-O0):
define void @uart_putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %1, %8
%4 = load volatile i32, i32* inttoptr (i64 2130726928 to i32*)
%5 = and i32 %4, 6
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
store volatile i32 %11, i32* inttoptr (i64 2130726944 to i32*)
ret void
}

LLVM IR (-O2):
define void @uart_putc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 2130726928 to i32*)
%4 = and i32 %3, 6
%5 = icmp eq i32 %4, 6
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = zext i8 %0 to i32
store volatile i32 %7, i32* inttoptr (i64 2130726944 to i32*)
ret void
}
/* Variables and functions */
int magic_index(int *, int /*<<< orphan*/, int);
int test_no_magic_index() {
  int array[] = {-2, -1, 0, 1, 2, 3};
  return -1 == magic_index(array, 0, 5);
}


x86 assembly (clang, -O0):
<test_no_magic_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <magic_index@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_magic_index>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <magic_index@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_no_magic_index.array = [6 x i32] [i32 -2, i32 -1, i32 0, i32 1, i32 2, i32 3]
define i32 @test_no_magic_index() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @magic_index(i32* %3, i32 0, i32 5)
%5 = icmp eq i32 -1, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_no_magic_index.array = [6 x i32] [i32 -2, i32 -1, i32 0, i32 1, i32 2, i32 3]
define i32 @test_no_magic_index() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @magic_index(i32* %3, i32 0, i32 5)
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_int(int x) {
  if (x) {
    printf("%3d = true\n", x);
  } else {
    printf("%3d = false\n", x);
  }
}


x86 assembly (clang, -O0):
<test_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <test_int+0x29>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1148 <test_int+0x38>
mov    -0x4(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int>:
test   %edi,%edi
je     1122 <test_int+0x12>
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xee3(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%3d = true\0A\00"
@.str.1 = [13 x i8] c"%3d = false\0A\00"
define void @test_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%3d = true\0A\00"
@.str.1 = [13 x i8] c"%3d = false\0A\00"
define void @test_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %7
7: ; preds = %5, %3
ret void
}
int defined_twice_b(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @defined_twice_b() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ OSA_MULx(scalar_t__, scalar_t__);
uint8_t OSA_MULxPOW(uint8_t V, uint8_t i, uint8_t c) {
  if (i == 0)
    return V;
  else
    return OSA_MULx(OSA_MULxPOW(V, i - 1, c), c);
}


x86 assembly (clang, -O0):
<OSA_MULxPOW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114c <OSA_MULxPOW+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <OSA_MULxPOW+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x20(%rbp),%rdx
call   1040 <OSA_MULxPOW@plt>
mov    %rax,%rdi
mov    -0x20(%rbp),%rsi
call   1030 <OSA_MULx@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSA_MULxPOW>:
test   %rsi,%rsi
je     113e <OSA_MULxPOW+0x1e>
push   %rbx
mov    %rdx,%rbx
add    $0xffffffffffffffff,%rsi
call   1040 <OSA_MULxPOW@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <OSA_MULx@plt>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @OSA_MULxPOW(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3, %7
%6 = phi i64 [ %10, %7 ], [ %0, %3 ]
ret i64 %6
7: ; preds = %3
%8 = add nsw i64 %1, -1
%9 = tail call i64 @OSA_MULxPOW(i64 %0, i64 %8, i64 %2)
%10 = tail call i64 @OSA_MULx(i64 %9, i64 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ fn1(int /*<<< orphan*/, short);
int fn2(int p1) {
  fn1(0, (short)(int)&p1);
  return 0;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
xor    %edi,%edi
movswl %ax,%esi
call   1030 <fn1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rax
movswl %ax,%esi
xor    %edi,%edi
call   1030 <fn1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fn2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = ptrtoint i32* %2 to i64
%4 = trunc i64 %3 to i16
%5 = call i32 @fn1(i32 0, i16 signext %4)
ret i32 0
}
int test_imm_71int64_midword_reg(long long val) {
  return ((val >> 16) & (0x71 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_71int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x71,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_71int64_midword_reg>:
test   $0x710000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_71int64_midword_reg(i64 %0) {
%2 = and i64 %0, 7405568
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned int f27(unsigned int x, int y __attribute__((unused))) {
  return (x >> (8 * sizeof(unsigned int) - 1)) ^ (x << 1);
}


x86 assembly (clang, -O0):
<f27>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f27(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 = lshr i32 %5, 31
%7 = load i32, i32* %3
%8 = shl i32 %7, 1
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f27(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
char toupper(char);
void convert(char a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    a[i] = toupper(a[i]);
}


x86 assembly (clang, -O0):
<convert>:
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 <convert+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 <convert+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <convert+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 <convert+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @convert(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 @convert(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
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "Usage: %s [-o output_file] input_file\n", name);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s [-o output_file] input_file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s [-o output_file] input_file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int *malloc(int);
int *allocate(size_t n) {
  int *ptr = malloc(sizeof(int) * n);
#pragma omp target enter data map(to : ptr[:n])
  return ptr;
}


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

x86 assembly (clang, -O2):
<allocate>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @allocate(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 4, %4
%6 = trunc i64 %5 to i32
%7 = call i32* @malloc(i32 %6)
store i32* %7, i32** %3
%8 = load i32*, i32** %3
ret i32* %8
}

LLVM IR (-O2):
define noalias i32* @allocate(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 2
%4 = tail call i32* @malloc(i32 %3)
ret i32* %4
}
int f(int j) {
  int a[10];
  return a[j];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
int /*<<< orphan*/ writestr(int, char *);
void moveto(int x, int y) {
  char buf[1024];
  snprintf(buf, sizeof(buf) - 1, "\033[%d;%dH", y + 1, x + 1);
  writestr(1, buf);
}


x86 assembly (clang, -O0):
<moveto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    -0x4(%rbp),%r8d
add    $0x1,%r8d
mov    $0x3ff,%esi
lea    0xeae(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rsi
mov    $0x1,%edi
call   1040 <writestr@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveto>:
push   %rbx
sub    $0x400,%rsp
lea    0x1(%rsi),%ecx
lea    0x1(%rdi),%r8d
lea    0xeca(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
call   1030 <snprintf@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <writestr@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @moveto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1024 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = call i32 @snprintf(i8* %6, i32 1023, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%13 = call i32 @writestr(i32 1, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @moveto(i32 %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = add nsw i32 %1, 1
%6 = add nsw i32 %0, 1
%7 = call i32 @snprintf(i8* %4, i32 1023, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @writestr(i32 1, i8* %4)
ret void
}
/* Type definitions */
struct buffer_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BufferPush(struct buffer_t *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ BufferRemove(struct buffer_t *, size_t);
size_t BufferSize(struct buffer_t *);
int /*<<< orphan*/ BufferStart(struct buffer_t *);
void BufferCopy(struct buffer_t *buffer, struct buffer_t *src) {
  size_t size = BufferSize(src);
  BufferPush(buffer, BufferStart(src), size);
  BufferRemove(src, size);
}


x86 assembly (clang, -O0):
<BufferCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <BufferSize@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <BufferStart@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1050 <BufferPush@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <BufferRemove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BufferCopy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <BufferSize@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1060 <BufferStart@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1050 <BufferPush@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <BufferRemove@plt>

LLVM IR (-O0):
%struct.buffer_t = type { i32 }
define void @BufferCopy(%struct.buffer_t* %0, %struct.buffer_t* %1) {
%3 = alloca %struct.buffer_t*
%4 = alloca %struct.buffer_t*
%5 = alloca i64
store %struct.buffer_t* %0, %struct.buffer_t** %3
store %struct.buffer_t* %1, %struct.buffer_t** %4
%6 = load %struct.buffer_t*, %struct.buffer_t** %4
%7 = call i64 @BufferSize(%struct.buffer_t* %6)
store i64 %7, i64* %5
%8 = load %struct.buffer_t*, %struct.buffer_t** %3
%9 = load %struct.buffer_t*, %struct.buffer_t** %4
%10 = call i32 @BufferStart(%struct.buffer_t* %9)
%11 = load i64, i64* %5
%12 = call i32 @BufferPush(%struct.buffer_t* %8, i32 %10, i64 %11)
%13 = load %struct.buffer_t*, %struct.buffer_t** %4
%14 = load i64, i64* %5
%15 = call i32 @BufferRemove(%struct.buffer_t* %13, i64 %14)
ret void
}

LLVM IR (-O2):
%struct.buffer_t = type { i32 }
define void @BufferCopy(%struct.buffer_t* %0, %struct.buffer_t* %1) {
%3 = tail call i64 @BufferSize(%struct.buffer_t* %1)
%4 = tail call i32 @BufferStart(%struct.buffer_t* %1)
%5 = tail call i32 @BufferPush(%struct.buffer_t* %0, i32 %4, i64 %3)
%6 = tail call i32 @BufferRemove(%struct.buffer_t* %1, i64 %3)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dstdevwd(int, int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dstdevwd(N, 1, x, stride);
  printf("sample standard deviation: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%ecx
mov    $0x1,%esi
call   1040 <stdlib_strided_dstdevwd@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1040 <stdlib_strided_dstdevwd@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [32 x i8] c"sample standard deviation: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dstdevwd(i32 %6, i32 1, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [32 x i8] c"sample standard deviation: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dstdevwd(i32 4, i32 1, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
int ft_sqrt(int nb) {
  int res;
  int pow2;
  if (nb < 1)
    return (0);
  res = 1;
  pow2 = 1;
  while (pow2 < nb) {
    res++;
    pow2 = res * res;
  }
  return (pow2 == nb ? res : 0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <ft_sqrt+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1176 <ft_sqrt+0x76>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114f <ft_sqrt+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112b <ft_sqrt+0x2b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1166 <ft_sqrt+0x66>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <ft_sqrt+0x70>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <ft_sqrt+0x70>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
test   %edi,%edi
jle    1134 <ft_sqrt+0x34>
mov    $0x1,%ecx
mov    $0x1,%edx
cmp    $0x1,%edi
je     112c <ft_sqrt+0x2c>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
jl     1120 <ft_sqrt+0x20>
xor    %eax,%eax
cmp    %edi,%edx
cmove  %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %10, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ 1, %3 ]
%7 = add nuw nsw i32 %6, 1
%8 = mul nsw i32 %7, %7
%9 = icmp slt i32 %8, %0
br i1 %9, label %5, label %10
10: ; preds = %5, %3
%11 = phi i32 [ 1, %3 ], [ %7, %5 ]
%12 = phi i32 [ 1, %3 ], [ %8, %5 ]
%13 = icmp eq i32 %12, %0
%14 = select i1 %13, i32 %11, i32 0
br label %15
15: ; preds = %1, %10
%16 = phi i32 [ %14, %10 ], [ 0, %1 ]
ret i32 %16
}
void _M2_M2EXCEPTION_finish(__attribute__((unused)) int argc,
                            __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_M2EXCEPTION_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap64(int /*<<< orphan*/);
uint64_t cpu_to_be64(uint64_t x) { return bswap64(x); }


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

x86 assembly (clang, -O2):
<cpu_to_be64>:
jmp    1030 <bswap64@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_be64(i32 %0) {
%2 = tail call i32 @bswap64(i32 %0)
ret i32 %2
}
double add(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int diff(char **, char **);
int main(void) {
  char *DataList[4];
  return diff(DataList, DataList + 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x20,%rsi
call   1030 <diff@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0x20(%rsp),%rsi
mov    %rsp,%rdi
call   1030 <diff@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %4, i64 4
%6 = call i32 @diff(i8** %3, i8** %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 4
%5 = call i32 @diff(i8** %3, i8** %4)
ret i32 %5
}
void baz_float(float *x) { *x = __imag foo_float(5); }


x86 assembly (clang, -O0):
<baz_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <foo_float@plt>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz_float>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_float@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @baz_float(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo_float to i32 (i32, ...)*)(i32 5)
%4 = load float*, float** %2
store float 0.000000e+00, float* %4
ret void
}

LLVM IR (-O2):
define void @baz_float(float* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_float to i32 (i32, ...)*)(i32 5)
store float 0.000000e+00, float* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ vesav_write(char *);
void vesav_write_int(int writeValue) {
  char string[30];
  sprintf(string, "%d", writeValue);
  vesav_write(string);
}


x86 assembly (clang, -O0):
<vesav_write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <vesav_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vesav_write_int>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <vesav_write@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @vesav_write_int(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = call i32 @vesav_write(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @vesav_write_int(i32 %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @vesav_write(i8* %3)
ret void
}
char *XDisplayName(char *string) { return string; }


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

x86 assembly (clang, -O2):
<XDisplayName>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @XDisplayName(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int uartin();
int getch(void) { return uartin(); }


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

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

LLVM IR (-O0):
define i32 @getch() {
%1 = call i32 (...) @uartin()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getch() {
%1 = tail call i32 (...) @uartin()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getpid();
int /*<<< orphan*/ stderr;
main() {
  fprintf(stderr, "%d\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 (...) @getpid()
%4 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int hash(char string[]) {
  int index = 0;
  int code = 0;
  while (string[index] != '\0') {
    code += string[index];
    ++index;
  }
  return code;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114b <hash+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hash+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(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 i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %15
}
/* Type definitions */
struct Audio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SDL_CloseAudio();
void sdl_audio_close(struct Audio *audio) { SDL_CloseAudio(); }


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

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

LLVM IR (-O0):
%struct.Audio = type { i32 }
define void @sdl_audio_close(%struct.Audio* %0) {
%2 = alloca %struct.Audio*
store %struct.Audio* %0, %struct.Audio** %2
%3 = call i32 (...) @SDL_CloseAudio()
ret void
}

LLVM IR (-O2):
%struct.Audio = type { i32 }
define void @sdl_audio_close(%struct.Audio* nocapture readnone %0) {
%2 = tail call i32 (...) @SDL_CloseAudio()
ret void
}