xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;
struct pcg_state_32 {
  int dummy;
};

/* Variables and functions */
int pcg_oneseq_32_xsh_rs_16_random_r(struct pcg_state_32 *);
uint16_t pcg_oneseq_32_xsh_rs_16_boundedrand_r(struct pcg_state_32 *rng,
                                               uint16_t bound) {
  uint16_t threshold = ((uint16_t)(-bound)) % bound;
  for (;;) {
    uint16_t r = pcg_oneseq_32_xsh_rs_16_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_oneseq_32_xsh_rs_16_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_oneseq_32_xsh_rs_16_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_oneseq_32_xsh_rs_16_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_oneseq_32_xsh_rs_16_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_oneseq_32_xsh_rs_16_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_oneseq_32_xsh_rs_16_random_r@plt>
test   %eax,%eax
js     1120 <pcg_oneseq_32_xsh_rs_16_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.pcg_state_32 = type { i32 }
define i32 @pcg_oneseq_32_xsh_rs_16_boundedrand_r(%struct.pcg_state_32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_oneseq_32_xsh_rs_16_random_r(%struct.pcg_state_32* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
char produce(FILE *fp) { return fgetc(fp); }


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

x86 assembly (clang, -O2):
<produce>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define signext i8 @produce(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
ret i8 %2
}
unsigned long hash_function(const char *strinput) {
  unsigned long hash = 5381;
  const unsigned char *str = (const unsigned char *)strinput;
  int c;
  while ((c = *str++))
    hash = hash * 33 ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     114b <hash_function+0x4b>
imul   $0x21,-0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <hash_function+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash_function+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
xor    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_function+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_function(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = mul i64 %6, 33
%10 = zext i8 %5 to i64
%11 = xor i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int date_string(unsigned long, int, char *, int);
scalar_t__ parse_date_basic(char const *, unsigned long *, int *);
int parse_date(const char *date, char *result, int maxlen) {
  unsigned long timestamp;
  int offset;
  if (parse_date_basic(date, &timestamp, &offset))
    return -1;
  return date_string(timestamp, offset, result, maxlen);
}


x86 assembly (clang, -O0):
<parse_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1040 <parse_date_basic@plt>
cmp    $0x0,%rax
je     115a <parse_date+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <parse_date+0x50>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <date_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_date>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <parse_date_basic@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    115a <parse_date+0x3a>
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <date_string@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_date(i8* %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = bitcast i64* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i64 @parse_date_basic(i8* %0, i64* %4, i32* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i32, i32* %5
%13 = call i32 @date_string(i64 %11, i32 %12, i8* %1, i32 %2)
br label %14
14: ; preds = %3, %10
%15 = phi i32 [ %13, %10 ], [ -1, %3 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_mday;
  scalar_t__ tm_hour;
  scalar_t__ tm_min;
  scalar_t__ tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ mktime(struct tm *);
time_t getNextLocalDayForTs(time_t ts) {
  struct tm *t = localtime(&ts);
  t->tm_sec = 0;
  t->tm_min = 0;
  t->tm_hour = 0;
  t->tm_mday += 1;
  return mktime(t);
}


x86 assembly (clang, -O0):
<getNextLocalDayForTs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextLocalDayForTs>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rax)
movq   $0x0,0x18(%rax)
addl   $0x1,(%rax)
mov    %rax,%rdi
call   1040 <mktime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i64, i64, i64 }
define i32 @getNextLocalDayForTs(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 3
store i64 0, i64* %6
%7 = load %struct.tm*, %struct.tm** %3
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 2
store i64 0, i64* %8
%9 = load %struct.tm*, %struct.tm** %3
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
store i64 0, i64* %10
%11 = load %struct.tm*, %struct.tm** %3
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = load %struct.tm*, %struct.tm** %3
%16 = call i32 @mktime(%struct.tm* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.tm = type { i32, i64, i64, i64 }
define i32 @getNextLocalDayForTs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%6 = bitcast i64* %4 to i8*
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = call i32 @mktime(%struct.tm* %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void __attribute__((noreturn)) usage(void) {
  fprintf(stdout, "Usage: ./usage [0...9] 0x[XX] [0 ... 255] \n");
  fprintf(stdout, "       1  -> adapter 1 (/dev/i2c-1)       \n");
  fprintf(stdout, "       0x22 -> i2c address 0x22           \n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xefa(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeed(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [44 x i8] c"Usage: ./usage [0...9] 0x[XX] [0 ... 255] \0A\00"
@.str.1 = [44 x i8] c" 1 -> adapter 1 (/dev/i2c-1) \0A\00"
@.str.2 = [44 x i8] c" 0x22 -> i2c address 0x22 \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [44 x i8] c"Usage: ./usage [0...9] 0x[XX] [0 ... 255] \0A\00"
@.str.1 = [44 x i8] c" 1 -> adapter 1 (/dev/i2c-1) \0A\00"
@.str.2 = [44 x i8] c" 0x22 -> i2c address 0x22 \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FXClose(int);
int FXNew(char *, int);
int FXPrint(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("initializing\n");
  int s = FXNew("127.0.0.1", 80);
  printf("%d\n", FXPrint(s, "GET /"));
  FXClose(s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x50,%esi
call   1060 <FXNew@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xea8(%rip),%rsi
call   1040 <FXPrint@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <FXClose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
mov    $0x50,%esi
call   1070 <FXNew@plt>
mov    %eax,%ebx
lea    0xe97(%rip),%rsi
mov    %eax,%edi
call   1050 <FXPrint@plt>
lea    0xe85(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1060 <FXClose@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [10 x i8] c"127.0.0.1\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [6 x i8] c"GET /\00"
@str = [13 x i8] c"initializing\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @FXNew(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 80)
%3 = tail call i32 @FXPrint(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = tail call i32 @FXClose(i32 %2)
ret i32 0
}
/* Type definitions */
typedef int u_int64_t;

/* Variables and functions */
u_int64_t store_htonll(u_int64_t v) {
  v = (v & 0xff) << 56 | (v & 0xff00ULL) << 40 | (v & 0xff0000ULL) << 24 |
      (v & 0xff000000ULL) << 8 | (v & 0xff00000000ULL) >> 8 |
      (v & 0xff0000000000ULL) >> 24 | (v & 0xff000000000000ULL) >> 40 |
      (v & 0xff00000000000000ULL) >> 56;
  return (v);
}


x86 assembly (clang, -O0):
<store_htonll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x38,%ecx
shl    %cl,%eax
cltq
movslq -0x4(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x28,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
and    $0xff0000,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
shr    $0x18,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
shr    $0x28,%rcx
or     %rcx,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00000000000000,%rdx
and    %rdx,%rcx
shr    $0x38,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @store_htonll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 56
%6 = sext i32 %5 to i64
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = and i64 %8, 65280
%10 = shl i64 %9, 40
%11 = or i64 %6, %10
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = and i64 %13, 16711680
%15 = shl i64 %14, 24
%16 = or i64 %11, %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = and i64 %18, 4278190080
%20 = shl i64 %19, 8
%21 = or i64 %16, %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = and i64 %23, 1095216660480
%25 = lshr i64 %24, 8
%26 = or i64 %21, %25
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = and i64 %28, 280375465082880
%30 = lshr i64 %29, 24
%31 = or i64 %26, %30
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = and i64 %33, 71776119061217280
%35 = lshr i64 %34, 40
%36 = or i64 %31, %35
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = and i64 %38, -72057594037927936
%40 = lshr i64 %39, 56
%41 = or i64 %36, %40
%42 = trunc i64 %41 to i32
store i32 %42, i32* %2
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
define i32 @store_htonll(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ set_tcp_uncork(int);
int /*<<< orphan*/ set_udp_uncork(int);
void set_sock_uncork(int fd, int udp) {
  if (!!udp)
    set_udp_uncork(fd);
  else
    set_tcp_uncork(fd);
}


x86 assembly (clang, -O0):
<set_sock_uncork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1145 <set_sock_uncork+0x25>
mov    -0x4(%rbp),%edi
call   1030 <set_udp_uncork@plt>
jmp    114d <set_sock_uncork+0x2d>
mov    -0x4(%rbp),%edi
call   1040 <set_tcp_uncork@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sock_uncork>:
test   %esi,%esi
je     1129 <set_sock_uncork+0x9>
jmp    1030 <set_udp_uncork@plt>
jmp    1040 <set_tcp_uncork@plt>

LLVM IR (-O0):
define void @set_sock_uncork(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @set_udp_uncork(i32 %8)
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 @set_tcp_uncork(i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @set_sock_uncork(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @set_udp_uncork(i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @set_tcp_uncork(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t foo(uint32_t *x) {
  uint32_t tmp = *x + 1;
  *x += 42;
  return tmp;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2a,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rcx
lea    0x1(%rcx),%rax
add    $0x2a,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i64 @foo(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = add nsw i64 %2, 1
%4 = add nsw i64 %2, 42
store i64 %4, i64* %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void *a_thread_func() {
  sleep(10);
  perror("Could not send cancel request correctly\n");
  pthread_exit(0);
  return NULL;
}


x86 assembly (clang, -O0):
<a_thread_func>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1050 <sleep@plt>
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_thread_func>:
push   %rax
mov    $0xa,%edi
call   1050 <sleep@plt>
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Could not send cancel request correctly\0A\00"
define i8* @a_thread_func() {
%1 = call i32 @sleep(i32 10)
%2 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @pthread_exit(i32 0)
ret i8* null
}

LLVM IR (-O2):
@.str = [41 x i8] c"Could not send cancel request correctly\0A\00"
define noalias i8* @a_thread_func() {
%1 = tail call i32 @sleep(i32 10)
%2 = tail call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32 0)
ret i8* null
}
int main(int argc, char *argv[]) { return argc + 4; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, 4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EMFILE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int pipe(int fildes[2] __attribute__((unused))) {
  printf("pipe\n");
  errno = EMFILE;
  return -1;
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"pipe\0A\00"
@EMFILE = global i32 0
@errno = global i32 0
define i32 @pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EMFILE
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EMFILE = global i32 0
@errno = global i32 0
@str = [5 x i8] c"pipe\00"
define i32 @pipe(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EMFILE
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ cgincbind(char *, char *, int);
void cgdec1ib(void) { cgincbind("ax", "sub", 1); }


x86 assembly (clang, -O0):
<cgdec1ib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x1,%edx
call   1030 <cgincbind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec1ib>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <cgincbind@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"sub\00"
define void @cgdec1ib() {
%1 = call i32 @cgincbind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"sub\00"
define void @cgdec1ib() {
%1 = tail call i32 @cgincbind(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
scalar_t__ sputc(char *, char const);
int sputs(char *s, const char *b) {
  int len = 0;
  while (*b != '\0') {
    len += sputc(s, *b);
    s++;
    b++;
  }
  return len;
}


x86 assembly (clang, -O0):
<sputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1171 <sputs+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <sputc@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <sputs+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sputs>:
push   %rbp
push   %r14
push   %rbx
mov    (%rsi),%al
test   %al,%al
je     114e <sputs+0x3e>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <sputc@plt>
add    %eax,%ebp
add    $0x1,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <sputs+0x20>
jmp    1150 <sputs+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sputs(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %15, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %14, %5 ], [ %1, %2 ]
%9 = phi i8* [ %13, %5 ], [ %0, %2 ]
%10 = tail call i64 @sputc(i8* %9, i8 signext %6)
%11 = trunc i64 %10 to i32
%12 = add i32 %7, %11
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %18
}
int SDL_imageFilterSubByteMMX(unsigned char *Src1, unsigned char *Dest,
                              unsigned int SrcLength, unsigned char C) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterSubByteMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterSubByteMMX(i8* %0, i8* %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterSubByteMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 37;
  printf("n = %d\n", n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"n = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 37)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                      int /*<<< orphan*/ *, void **,
                                      int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_X509;
scalar_t__ d2i_X509;
X509 *PEM_read_bio_X509(BIO *bp, X509 **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read_bio((d2i_of_void *)d2i_X509, PEM_STRING_X509, bp,
                           (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_bio_X509>:
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    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read_bio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_bio_X509>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read_bio@plt>

LLVM IR (-O0):
@d2i_X509 = global i64 0
@PEM_STRING_X509 = global i32 0
define i32* @PEM_read_bio_X509(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_X509
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_X509
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read_bio(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_X509 = global i64 0
@PEM_STRING_X509 = global i32 0
define i32* @PEM_read_bio_X509(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_X509
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read_bio(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Variables and functions */
int mystery(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int x;
  int y;
  printf("Enter two integers: ");
  scanf("%d%d", &x, &y);
  printf("The result is %d\n", mystery(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mystery@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <mystery@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Enter two integers: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @mystery(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
void _Jv_LookupInterfaceMethod() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_LookupInterfaceMethod() {
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
float sqrt(int);
int main(void) {
  char err_msg[100];
  float bad;
  errno = 0;
  bad = sqrt(-1);
  sprintf(err_msg, "Error Number for sqrt(-1) is %d", errno);
  perror(err_msg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e97(%rip),%rax
movl   $0x0,(%rax)
mov    $0xffffffff,%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0x74(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
lea    0xe8e(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0x2ea4(%rip),%rbx
movl   $0x0,(%rbx)
mov    $0xffffffff,%edi
call   1040 <sqrt@plt>
mov    (%rbx),%edx
lea    0xeab(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [32 x i8] c"Error Number for sqrt(-1) is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca float
store i32 0, i32* %1
store i32 0, i32* @errno
%4 = call float @sqrt(i32 -1)
store float %4, float* %3
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @errno
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @perror(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [32 x i8] c"Error Number for sqrt(-1) is %d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i32 0, i32* @errno
%3 = tail call float @sqrt(i32 -1)
%4 = load i32, i32* @errno
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @perror(i8* %2)
ret i32 0
}
void intel_gvt_resume(struct drm_i915_private *dev_priv) {}


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

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

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

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @intel_gvt_resume(%struct.drm_i915_private* nocapture %0) {
ret void
}
/* Variables and functions */
int VsLoadPlugin(unsigned char *, int);
int VsLoadPluginFromArray(unsigned char *generalArray, void **args,
                          unsigned int argsCount, unsigned int *argSize) {
  if (argsCount != 1)
    return 0x02;
  int pluginLength = *(int *)args[0];
  return VsLoadPlugin(generalArray, pluginLength);
}


x86 assembly (clang, -O0):
<VsLoadPluginFromArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x1,-0x1c(%rbp)
je     113d <VsLoadPluginFromArray+0x2d>
movl   $0x2,-0x4(%rbp)
jmp    1158 <VsLoadPluginFromArray+0x48>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <VsLoadPlugin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VsLoadPluginFromArray>:
cmp    $0x1,%edx
jne    111f <VsLoadPluginFromArray+0xf>
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <VsLoadPlugin@plt>
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @VsLoadPluginFromArray(i8* %0, i8** nocapture %1, i32 %2, i32* nocapture readnone %3) {
%5 = icmp eq i32 %2, 1
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = bitcast i8** %1 to i32**
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = tail call i32 @VsLoadPlugin(i8* %0, i32 %9)
br label %11
11: ; preds = %4, %6
%12 = phi i32 [ %10, %6 ], [ 2, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void deletefile(char *filename) { remove(filename); }


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

x86 assembly (clang, -O2):
<deletefile>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @deletefile(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, double *, int);
void _writed(int fd, double d) { write(fd, &d, sizeof(double)); }


x86 assembly (clang, -O0):
<_writed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_writed>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_writed(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, double* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @_writed(i32 %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i32 @write(i32 %0, double* %3, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 2.0)
    printf("Hello, World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xecd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1149 <main+0x39>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jg     1126 <main+0x16>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to double
%8 = fcmp olt double %7, 2.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void tek_GIN(void) { esc("\032"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\1A\00"
define void @tek_GIN() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_i(int, int);
int min_i(int /*<<< orphan*/, int);
int clamp_i(int val, int min, int max) { return min_i(max_i(val, min), max); }


x86 assembly (clang, -O0):
<clamp_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <max_i@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <min_i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_i>:
push   %rbx
mov    %edx,%ebx
call   1030 <max_i@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <min_i@plt>

LLVM IR (-O0):
define i32 @clamp_i(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 = call i32 @max_i(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = call i32 @min_i(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @clamp_i(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @max_i(i32 %0, i32 %1)
%5 = tail call i32 @min_i(i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
void serial_string(char *string) {
  char c;
  while (c = *string++)
    outbyte(c);
}


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

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

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

LLVM IR (-O2):
define void @serial_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @outbyte(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}