xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t time_usec() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((int64_t)1000000 * tv.tv_sec) + tv.tv_usec;
}


x86 assembly (clang, -O0):
<time_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_usec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @time_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 1000000, %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @time_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
/* Variables and functions */
void *memset(void *, int, size_t);
int /*<<< orphan*/ pmemobj_tx_add_range_direct(void *, size_t);
void *TX_MEMSET(void *dest, int c, size_t num) {
  pmemobj_tx_add_range_direct(dest, num);
  return memset(dest, c, num);
}


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

x86 assembly (clang, -O2):
<TX_MEMSET>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rsi
call   1040 <pmemobj_tx_add_range_direct@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @TX_MEMSET(i8* returned %0, i32 %1, i64 %2) {
%4 = tail call i32 @pmemobj_tx_add_range_direct(i8* %0, i64 %2)
%5 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %5, i64 %2, i1 false)
ret i8* %0
}
/* Type definitions */
struct servent {
  int s_port;
};

/* Variables and functions */
struct servent *getservbyname(char *, char *);
int getport(void) {
  struct servent *se;
  if ((se = getservbyname("identd", "tcp")) == NULL)
    return 113;
  else
    return se->s_port;
}


x86 assembly (clang, -O0):
<getport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <getservbyname@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1145 <getport+0x35>
movl   $0x71,-0x4(%rbp)
jmp    114e <getport+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getport>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1030 <getservbyname@plt>
test   %rax,%rax
je     112d <getport+0x1d>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0x71,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.servent = type { i32 }
@.str = [7 x i8] c"identd\00"
@.str.1 = [4 x i8] c"tcp\00"
define i32 @getport() {
%1 = alloca i32
%2 = alloca %struct.servent*
%3 = call %struct.servent* @getservbyname(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store %struct.servent* %3, %struct.servent** %2
%4 = icmp eq %struct.servent* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 113, i32* %1
br label %10
6: ; preds = %0
%7 = load %struct.servent*, %struct.servent** %2
%8 = getelementptr inbounds %struct.servent, %struct.servent* %7, i32 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %6, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.servent = type { i32 }
@.str = [7 x i8] c"identd\00"
@.str.1 = [4 x i8] c"tcp\00"
define i32 @getport() {
%1 = tail call %struct.servent* @getservbyname(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq %struct.servent* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = getelementptr inbounds %struct.servent, %struct.servent* %1, i64 0, i32 0
%5 = load i32, i32* %4
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 113, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int majn() {
  fprintf(stderr, "error\n");
  fprintf(stdout, "stdout\n");
  return 0;
}


x86 assembly (clang, -O0):
<majn>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<majn>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"error\0A\00"
@stdout = global i32 0
@.str.1 = [8 x i8] c"stdout\0A\00"
define i32 @majn() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"error\0A\00"
@stdout = global i32 0
@.str.1 = [8 x i8] c"stdout\0A\00"
define i32 @majn() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_13uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x13 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_13uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 19
%7 = icmp ne i64 %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_13uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 81604378624
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RTProcShortName(void) {}


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

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

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

LLVM IR (-O2):
define void @RTProcShortName() {
ret void
}
/* Variables and functions */
const char *cw_get_ssl_error(void) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @cw_get_ssl_error() {
ret i8* null
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
void devm_gpio_free(struct device *dev, unsigned int gpio) { WARN_ON(1); }


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

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

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

LLVM IR (-O2):
%struct.device = type { i32 }
define void @devm_gpio_free(%struct.device* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @WARN_ON(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
scalar_t__ i2c_smbus_read_i2c_block_data(int, unsigned char, unsigned char,
                                         unsigned char *);
void bmp180_read_block(int fd, unsigned char address, unsigned char length,
                       unsigned char *values) {
  if (i2c_smbus_read_i2c_block_data(fd, address, length, values) < 0) {
    close(fd);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<bmp180_read_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %rcx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x5(%rbp),%dl
mov    -0x6(%rbp),%al
mov    -0x10(%rbp),%rcx
movzbl %dl,%esi
movzbl %al,%edx
call   1040 <i2c_smbus_read_i2c_block_data@plt>
cmp    $0x0,%rax
jge    117e <bmp180_read_block+0x4e>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmp180_read_block>:
push   %rbx
mov    %edi,%ebx
call   1040 <i2c_smbus_read_i2c_block_data@plt>
test   %rax,%rax
js     113f <bmp180_read_block+0xf>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @bmp180_read_block(i32 %0, i8 zeroext %1, i8 zeroext %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8, i8* %6
%11 = load i8, i8* %7
%12 = load i8*, i8** %8
%13 = call i64 @i2c_smbus_read_i2c_block_data(i32 %9, i8 zeroext %10, i8 zeroext %11, i8* %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = load i32, i32* %5
%17 = call i32 @close(i32 %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @bmp180_read_block(i32 %0, i8 zeroext %1, i8 zeroext %2, i8* %3) {
%5 = tail call i64 @i2c_smbus_read_i2c_block_data(i32 %0, i8 zeroext %1, i8 zeroext %2, i8* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @close(i32 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
void strReplaceChar(char *str, char s, char d) {
  while (*str != 0) {
    if (*str == s)
      *str = d;
    str++;
  }
}


x86 assembly (clang, -O0):
<strReplaceChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <strReplaceChar+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <strReplaceChar+0x3f>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strReplaceChar+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strReplaceChar>:
mov    (%rdi),%al
test   %al,%al
je     1125 <strReplaceChar+0x25>
add    $0x1,%rdi
jmp    111b <strReplaceChar+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <strReplaceChar+0x25>
cmp    %sil,%al
jne    1110 <strReplaceChar+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <strReplaceChar+0x10>
ret

LLVM IR (-O0):
define void @strReplaceChar(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
br label %7
7: ; preds = %22, %3
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i8, i8* %6
%21 = load i8*, i8** %4
store i8 %20, i8* %21
br label %22
22: ; preds = %19, %12
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %7
25: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @strReplaceChar(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 1;
  int b = 1;
  int *x;
  int rnd;
  if (rnd)
    x = &a;
  else
    x = &b;
  assert(*x == 1);
  b = 2;
  assert(a == 1);
  if (*x > 1) {
    assert(x == &b);
    assert(*x == 2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1144 <main+0x34>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114c <main+0x3c>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x2,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jle    11ae <main+0x9e>
lea    -0xc(%rbp),%rax
cmp    %rax,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
ret i32 0
}
void rop3_24_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = T ^ *D;
  stk1 = stk1 & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_24_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_24_0_1>:
xor    %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_24_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = xor i32 %16, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
%32 = and i32 %29, %31
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = or i32 %32, %38
%40 = load i8, i8* %6
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = xor i32 %43, -1
%45 = and i32 %41, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = and i32 %45, %48
%50 = or i32 %39, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_24_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, %2
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
void predict(double x1, double y1, double x2, double y2, double *x3,
             double *y3) {
  *x3 = 2 * x2 - x1;
  *y3 = 2 * y2 - y1;
  return;
}


x86 assembly (clang, -O0):
<predict>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<predict>:
addsd  %xmm2,%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,(%rdi)
addsd  %xmm3,%xmm3
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rsi)
ret

LLVM IR (-O0):
define void @predict(double %0, double %1, double %2, double %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double, double* %9
%14 = load double, double* %7
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %13, double %15)
%17 = load double*, double** %11
store double %16, double* %17
%18 = load double, double* %10
%19 = load double, double* %8
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %18, double %20)
%22 = load double*, double** %12
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @predict(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fneg double %0
%8 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %7)
store double %8, double* %4
%9 = fneg double %1
%10 = tail call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double %9)
store double %10, double* %5
ret void
}
void cdr2cm(in, iout) int *in, *iout;
{ *iout = ~(*in) + 1; }


x86 assembly (clang, -O0):
<cdr2cm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdr2cm>:
xor    %eax,%eax
sub    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @cdr2cm(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* %5
%7 = xor i32 %6, -1
%8 = add nsw i32 %7, 1
%9 = load i32*, i32** %4
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @cdr2cm(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = sub i32 0, %3
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void tw1_output_str(void *p1) { printf("%s", (char *)p1); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @tw1_output_str(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double flesseq(double a, double b) { return a <= b; }


x86 assembly (clang, -O0):
<flesseq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flesseq>:
cmplesd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @flesseq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @flesseq(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
int _and(int op1, int op2) { return op1 & op2; }


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

x86 assembly (clang, -O2):
<_and>:
mov    %edi,%eax
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @_and(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ CRYPTO_memcmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ x25519_scalar_mult(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/ const *);
int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32],
           const uint8_t peer_public_value[32]) {
  static const uint8_t kZeros[32] = {0};
  x25519_scalar_mult(out_shared_key, private_key, peer_public_value);
  return CRYPTO_memcmp(kZeros, out_shared_key, 32) != 0;
}


x86 assembly (clang, -O0):
<X25519>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <x25519_scalar_mult@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x20,%edx
call   1040 <CRYPTO_memcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X25519>:
push   %rbx
mov    %rdi,%rbx
call   1030 <x25519_scalar_mult@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1040 <CRYPTO_memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@X25519.kZeros = internal constant [32 x i32] zeroinitializer
define i32 @X25519(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @x25519_scalar_mult(i32* %7, i32* %8, i32* %9)
%11 = load i32*, i32** %4
%12 = call i64 @CRYPTO_memcmp(i32* getelementptr inbounds ([32 x i32], [32 x i32]* @X25519.kZeros, i64 0, i64 0), i32* %11, i32 32)
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@X25519.kZeros = internal constant [32 x i32] zeroinitializer
define i32 @X25519(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @x25519_scalar_mult(i32* %0, i32* %1, i32* %2)
%5 = tail call i64 @CRYPTO_memcmp(i32* getelementptr inbounds ([32 x i32], [32 x i32]* @X25519.kZeros, i64 0, i64 0), i32* %0, i32 32)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ModelicaNotExistError(char *);
void ModelicaInternal_setenv(const char *name, const char *value,
                             int convertFromSlash) {
  ModelicaNotExistError("ModelicaInternal_setenv");
}


x86 assembly (clang, -O0):
<ModelicaInternal_setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <ModelicaNotExistError@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"ModelicaInternal_setenv\00"
define void @ModelicaInternal_setenv(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @ModelicaNotExistError(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"ModelicaInternal_setenv\00"
define void @ModelicaInternal_setenv(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @ModelicaNotExistError(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct map {
  int dummy;
};

/* Variables and functions */
struct map *map_init(int);
struct map *map_new() {
  return map_init(16);
}


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

x86 assembly (clang, -O2):
<map_new>:
mov    $0x10,%edi
jmp    1030 <map_init@plt>

LLVM IR (-O0):
%struct.map = type { i32 }
define %struct.map* @map_new() {
%1 = call %struct.map* @map_init(i32 16)
ret %struct.map* %1
}

LLVM IR (-O2):
%struct.map = type { i32 }
define %struct.map* @map_new() {
%1 = tail call %struct.map* @map_init(i32 16)
ret %struct.map* %1
}
int iDgiInit(long lDgi, unsigned char *psDgiBuf) {
  psDgiBuf[0] = (lDgi >> 8) & 0xFF;
  psDgiBuf[1] = lDgi & 0xFF;
  psDgiBuf[2] = 0;
  return (0);
}


x86 assembly (clang, -O0):
<iDgiInit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iDgiInit>:
mov    %rdi,%rax
mov    %ah,(%rsi)
mov    %al,0x1(%rsi)
movb   $0x0,0x2(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iDgiInit(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = ashr i64 %5, 8
%7 = and i64 %6, 255
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i64, i64* %3
%12 = and i64 %11, 255
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 0, i8* %17
ret i32 0
}

LLVM IR (-O2):
define i32 @iDgiInit(i64 %0, i8* nocapture writeonly %1) {
%3 = lshr i64 %0, 8
%4 = trunc i64 %3 to i8
store i8 %4, i8* %1
%5 = trunc i64 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 2
store i8 0, i8* %7
ret i32 0
}
/* Variables and functions */
size_t get_max_size(void *mem_pool) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @get_max_size(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int main(void) {
  char ch;
  while ((ch = getchar()) != '#')
    putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x23,%eax
je     1153 <main+0x33>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x23,%al
je     1145 <main+0x25>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 35
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @putchar(i8 signext %4)
%6 = tail call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 35
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int **, int **);
main() {
  int a = 1, b = 2, *p, *q;
  p = &a;
  q = &b;
  swap(&p, &q);
  printf("%d,%d\n", *p, *q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0x4(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%esi
mov    0x8(%rsp),%rax
mov    (%rax),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%7 = bitcast i32** %3 to i8*
%8 = bitcast i32** %4 to i8*
store i32* %1, i32** %3
store i32* %2, i32** %4
%9 = call i32 @swap(i32** %3, i32** %4)
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13)
ret i32 0
}
void ble_rsp_test_phy_rx(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_test_phy_rx(i8* nocapture %0) {
ret void
}
unsigned long RotWord(unsigned long word) {
  unsigned long result;
  unsigned long firstbyte, secondbyte, thirdbyte, fourthbyte;
  firstbyte = word >> 24;
  secondbyte = (word >> 16) & 0x00FF;
  thirdbyte = (word >> 8) & 0x0000FF;
  fourthbyte = word & 0x000000FF;
  result =
      (secondbyte << 24) + (thirdbyte << 16) + (fourthbyte << 8) + firstbyte;
  return result;
}


x86 assembly (clang, -O0):
<RotWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x18,%rax
mov    -0x28(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
mov    -0x30(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotWord>:
mov    %rdi,%rax
shr    $0x18,%rax
shl    $0x8,%edi
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @RotWord(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %2
%8 = load i64, i64* %2
%9 = lshr i64 %8, 24
store i64 %9, i64* %4
%10 = load i64, i64* %2
%11 = lshr i64 %10, 16
%12 = and i64 %11, 255
store i64 %12, i64* %5
%13 = load i64, i64* %2
%14 = lshr i64 %13, 8
%15 = and i64 %14, 255
store i64 %15, i64* %6
%16 = load i64, i64* %2
%17 = and i64 %16, 255
store i64 %17, i64* %7
%18 = load i64, i64* %5
%19 = shl i64 %18, 24
%20 = load i64, i64* %6
%21 = shl i64 %20, 16
%22 = add i64 %19, %21
%23 = load i64, i64* %7
%24 = shl i64 %23, 8
%25 = add i64 %22, %24
%26 = load i64, i64* %4
%27 = add i64 %25, %26
store i64 %27, i64* %3
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @RotWord(i64 %0) {
%2 = lshr i64 %0, 24
%3 = shl i64 %0, 8
%4 = and i64 %3, 4294967040
%5 = add nuw nsw i64 %4, %2
ret i64 %5
}
int sub_fun(int x) {
  int i;
  int count = 0;
  for (i = 0; i < 100; i++) {
    count = count + 2;
    ;
  }
  return count + x;
}


x86 assembly (clang, -O0):
<sub_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1136 <sub_fun+0x36>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <sub_fun+0x15>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sub_fun(i32 %0) {
%2 = add nsw i32 %0, 200
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("This is foo\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"This is foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void testClosureLLBSrV(void (*closure)(long long, char, short), long long a1,
                       char a2, short a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureLLBSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%cl
movsbl %cl,%esi
movswl -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLBSrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
jmp    *%rax

LLVM IR (-O0):
define void @testClosureLLBSrV(void (i64, i8, i16)* %0, i64 %1, i8 signext %2, i16 signext %3) {
%5 = alloca void (i64, i8, i16)*
%6 = alloca i64
%7 = alloca i8
%8 = alloca i16
store void (i64, i8, i16)* %0, void (i64, i8, i16)** %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i16 %3, i16* %8
%9 = load void (i64, i8, i16)*, void (i64, i8, i16)** %5
%10 = load i64, i64* %6
%11 = load i8, i8* %7
%12 = load i16, i16* %8
ret void
}

LLVM IR (-O2):
define void @testClosureLLBSrV(void (i64, i8, i16)* nocapture %0, i64 %1, i8 signext %2, i16 signext %3) {
tail call void %0(i64 %1, i8 signext %2, i16 signext %3)
ret void
}
/* Type definitions */
struct fid_wait {
  int dummy;
};

/* Variables and functions */
int gnix_wait_wait(struct fid_wait *, int);
int fi_wait(struct fid_wait *waitset, int timeout) {
  return gnix_wait_wait(waitset, timeout);
}


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

x86 assembly (clang, -O2):
<fi_wait>:
jmp    1030 <gnix_wait_wait@plt>

LLVM IR (-O0):
%struct.fid_wait = type { i32 }
define i32 @fi_wait(%struct.fid_wait* %0, i32 %1) {
%3 = alloca %struct.fid_wait*
%4 = alloca i32
store %struct.fid_wait* %0, %struct.fid_wait** %3
store i32 %1, i32* %4
%5 = load %struct.fid_wait*, %struct.fid_wait** %3
%6 = load i32, i32* %4
%7 = call i32 @gnix_wait_wait(%struct.fid_wait* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.fid_wait = type { i32 }
define i32 @fi_wait(%struct.fid_wait* %0, i32 %1) {
%3 = tail call i32 @gnix_wait_wait(%struct.fid_wait* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ err(int, char *);
void *xcalloc(size_t nmemb, size_t size) {
  void *p;
  if ((p = calloc(nmemb, size)) == NULL)
    err(1, "calloc");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115c <xcalloc+0x3c>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xcalloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"calloc\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
unsigned int cpuid_edx(unsigned int op) {
  unsigned int eax, edx;
  __asm__("mov %%ebx, %%edi;"
          "cpuid;"
          "mov %%edi, %%ebx;"
          : "=a"(eax), "=d"(edx)
          : "0"(op)
          : "ecx", "edi");
  return edx;
}


x86 assembly (clang, -O0):
<cpuid_edx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %ebx,%edi
cpuid
mov    %edi,%ebx
mov    %eax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_edx>:
mov    %edi,%eax
mov    %ebx,%edi
cpuid
mov    %edi,%ebx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cpuid_edx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "mov %ebx, %edi;cpuid;mov %edi, %ebx;", "={ax},={dx},0,~{ecx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_edx(i32 %0) {
%2 = tail call { i32, i32 } asm "mov %ebx, %edi;cpuid;mov %edi, %ebx;", "={ax},={dx},0,~{ecx},~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 1
ret i32 %3
}
void *shallow_copy(void *arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i8* @shallow_copy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exp(int /*<<< orphan*/);
int /*<<< orphan*/ lgamma(unsigned long);
long long lround(int /*<<< orphan*/);
long long factorial(unsigned long int n) { return lround(exp(lgamma(n + 1))); }


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1050 <lgamma@plt>
mov    %eax,%edi
call   1040 <exp@plt>
mov    %eax,%edi
call   1030 <lround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
add    $0x1,%rdi
call   1050 <lgamma@plt>
mov    %eax,%edi
call   1040 <exp@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lround@plt>

LLVM IR (-O0):
define i64 @factorial(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
%5 = call i32 @lgamma(i64 %4)
%6 = call i32 @exp(i32 %5)
%7 = call i64 @lround(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @factorial(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i32 @lgamma(i64 %2)
%4 = tail call i32 @exp(i32 %3)
%5 = tail call i64 @lround(i32 %4)
ret i64 %5
}
double calc_Nm_S(double Sw, double Sa) {
  if (Sa - Sw <= 0)
    return Sw;
  else
    return Sw / (Sa - Sw);
}


x86 assembly (clang, -O0):
<calc_Nm_S>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1134 <calc_Nm_S+0x34>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <calc_Nm_S+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_Nm_S>:
subsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm1,%xmm3
cmpnlesd %xmm2,%xmm3
andpd  %xmm3,%xmm1
movsd  0xee3(%rip),%xmm2
andnpd %xmm2,%xmm3
orpd   %xmm1,%xmm3
divsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @calc_Nm_S(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = fcmp ole double %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load double, double* %4
store double %11, double* %3
br label %18
12: ; preds = %2
%13 = load double, double* %4
%14 = load double, double* %5
%15 = load double, double* %4
%16 = fsub double %14, %15
%17 = fdiv double %13, %16
store double %17, double* %3
br label %18
18: ; preds = %12, %10
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @calc_Nm_S(double %0, double %1) {
%3 = fsub double %1, %0
%4 = fcmp ugt double %3, 0.000000e+00
%5 = select i1 %4, double %3, double 1.000000e+00
%6 = fdiv double %0, %5
ret double %6
}