xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int, int);
int /*<<< orphan*/ stderr;
int expect_int(int expected, int actual, const char *description) {
  int passed = 1;
  if (expected != actual) {
    passed = 0;
    fprintf(stderr, "%s: Expected %d, got %d\n", description, expected, actual);
  }
  return passed;
}


x86 assembly (clang, -O0):
<expect_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     115c <expect_int+0x4c>
movl   $0x0,-0x14(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_int>:
mov    $0x1,%eax
cmp    %esi,%edi
je     113a <expect_int+0x2a>
push   %rax
mov    %esi,%r8d
mov    %edi,%ecx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"%s: Expected %d, got %d\0A\00"
define i32 @expect_int(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
store i32 0, i32* %7
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %6
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %11, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"%s: Expected %d, got %d\0A\00"
define i32 @expect_int(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %0, i32 %1)
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ 0, %5 ], [ 1, %3 ]
ret i32 %9
}
/* Type definitions */
struct fix_tag_classifier {
  int dummy;
};

/* Variables and functions */
const struct fix_tag_classifier *get_group_classifier_in_Logout(size_t __tag) {
  (void)__tag;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.fix_tag_classifier = type { i32 }
define %struct.fix_tag_classifier* @get_group_classifier_in_Logout(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret %struct.fix_tag_classifier* null
}

LLVM IR (-O2):
%struct.fix_tag_classifier = type { i32 }
define noalias %struct.fix_tag_classifier* @get_group_classifier_in_Logout(i64 %0) {
ret %struct.fix_tag_classifier* null
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void vc_sleep(int ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<vc_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @vc_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @vc_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int to_naf(int x) {
  int mask = 1;
  int carry = 0;
  while (mask) {
    x ^= carry;
    if (x & mask) {
      mask <<= 1;
      carry = x & mask;
    }
    mask <<= 1;
    carry <<= 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<to_naf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1160 <to_naf+0x60>
mov    -0xc(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1149 <to_naf+0x49>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <to_naf+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_naf>:
mov    %edi,%eax
mov    $0x1,%edx
xor    %ecx,%ecx
nopl   0x0(%rax)
xor    %ecx,%eax
lea    (%rdx,%rdx,1),%esi
mov    %eax,%edi
and    %esi,%edi
test   %edx,%eax
cmove  %edx,%esi
cmove  %ecx,%edi
add    %esi,%esi
add    %edi,%edi
mov    %edi,%ecx
mov    %esi,%edx
test   %esi,%esi
jne    1110 <to_naf+0x10>
ret

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

LLVM IR (-O2):
define i32 @to_naf(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %14, %2 ]
%4 = phi i32 [ 1, %1 ], [ %13, %2 ]
%5 = phi i32 [ %0, %1 ], [ %6, %2 ]
%6 = xor i32 %3, %5
%7 = and i32 %6, %4
%8 = icmp eq i32 %7, 0
%9 = shl i32 %4, 1
%10 = and i32 %6, %9
%11 = select i1 %8, i32 %4, i32 %9
%12 = select i1 %8, i32 %3, i32 %10
%13 = shl i32 %11, 1
%14 = shl i32 %12, 1
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %2
16: ; preds = %2
ret i32 %6
}
/* Variables and functions */
int get_ns_in_jiffie();
extern unsigned long get_us_in_jiffie_highres(void) {
  return get_ns_in_jiffie() / 1000;
}


x86 assembly (clang, -O0):
<get_us_in_jiffie_highres>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_ns_in_jiffie@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_us_in_jiffie_highres>:
push   %rax
xor    %eax,%eax
call   1030 <get_ns_in_jiffie@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_us_in_jiffie_highres() {
%1 = call i32 (...) @get_ns_in_jiffie()
%2 = sdiv i32 %1, 1000
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_us_in_jiffie_highres() {
%1 = tail call i32 (...) @get_ns_in_jiffie()
%2 = sdiv i32 %1, 1000
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
char *simplePing(int inVar, SVCXPRT *transp) {
  static int result;
  result = inVar;
  return (char *)&result;
}


x86 assembly (clang, -O0):
<simplePing>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f10(%rip)
lea    0x2f09(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplePing>:
mov    %edi,0x2f1e(%rip)
lea    0x2f17(%rip),%rax
ret

LLVM IR (-O0):
@simplePing.result = internal global i32 0
define i8* @simplePing(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
store i32 %5, i32* @simplePing.result
ret i8* bitcast (i32* @simplePing.result to i8*)
}

LLVM IR (-O2):
@simplePing.result = internal global i32 0
define i8* @simplePing(i32 %0, i32* nocapture readnone %1) {
store i32 %0, i32* @simplePing.result
ret i8* bitcast (i32* @simplePing.result to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ display_turnOnStatusLed();
void event_powerReadingUpdate(int powerReading) {
  if (powerReading >= 5) {
    display_turnOnStatusLed();
  }
}


x86 assembly (clang, -O0):
<event_powerReadingUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jl     112c <event_powerReadingUpdate+0x1c>
mov    $0x0,%al
call   1030 <display_turnOnStatusLed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_powerReadingUpdate>:
cmp    $0x5,%edi
jl     111c <event_powerReadingUpdate+0xc>
xor    %eax,%eax
jmp    1030 <display_turnOnStatusLed@plt>
ret

LLVM IR (-O0):
define void @event_powerReadingUpdate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 5
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @display_turnOnStatusLed()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @event_powerReadingUpdate(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @display_turnOnStatusLed()
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_RD_MODE;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int spi_get_mode(int fd, __u8 *pmode) {
  return ioctl(fd, SPI_IOC_RD_MODE, pmode);
}


x86 assembly (clang, -O0):
<spi_get_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_get_mode>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@SPI_IOC_RD_MODE = global i32 0
define i32 @spi_get_mode(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* @SPI_IOC_RD_MODE
%7 = load i32*, i32** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@SPI_IOC_RD_MODE = global i32 0
define i32 @spi_get_mode(i32 %0, i32* %1) {
%3 = load i32, i32* @SPI_IOC_RD_MODE
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32* %1)
ret i32 %4
}
unsigned char tosMemory_peekUnsignedChar(int base, int offs) {
  return *((unsigned char *)(base + offs));
}


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

x86 assembly (clang, -O2):
<tosMemory_peekUnsignedChar>:
movslq %esi,%rax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @tosMemory_peekUnsignedChar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i8, i8* %9
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @tosMemory_peekUnsignedChar(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %5
ret i8 %6
}
/* Variables and functions */
int ec_queue_read(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void echo_stream(int stream) {
  char buf[1024];
  int n;
  while ((n = ec_queue_read(stream, buf, 1023)) > 0) {
    buf[n] = 0;
    printf("%s", buf);
  }
}


x86 assembly (clang, -O0):
<echo_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x3ff,%edx
call   1040 <ec_queue_read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    1178 <echo_stream+0x58>
movslq -0x414(%rbp),%rax
movb   $0x0,-0x410(%rbp,%rax,1)
lea    -0x410(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    112e <echo_stream+0xe>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_stream>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x3ff,%edx
call   1040 <ec_queue_read@plt>
test   %eax,%eax
jle    1174 <echo_stream+0x54>
lea    0xebb(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %eax,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3ff,%edx
call   1040 <ec_queue_read@plt>
test   %eax,%eax
jg     1150 <echo_stream+0x30>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @echo_stream(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @ec_queue_read(i32 %0, i8* %3, i32 1023)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1, %6
%7 = phi i32 [ %11, %6 ], [ %4, %1 ]
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %8
store i8 0, i8* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%11 = call i32 @ec_queue_read(i32 %0, i8* %3, i32 1023)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ voidfn();
int main() {
  voidfn();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @voidfn()
ret i32 0
}
int traverse(struct lnlst *head) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.lnlst = type opaque
define i32 @traverse(%struct.lnlst* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ccvt_420i(int, int, unsigned char *, unsigned char *, int);
void ccvt_420i_rgb24(int width, int height, void *src, void *dst) {
  ccvt_420i(width, height, (unsigned char *)src, (unsigned char *)dst, 1);
}


x86 assembly (clang, -O0):
<ccvt_420i_rgb24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <ccvt_420i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccvt_420i_rgb24>:
mov    $0x1,%r8d
jmp    1030 <ccvt_420i@plt>

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

LLVM IR (-O2):
define void @ccvt_420i_rgb24(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @ccvt_420i(i32 %0, i32 %1, i8* %2, i8* %3, i32 1)
ret void
}
long test_lrintl(long double x) { return __builtin_lrintl(x); }


x86 assembly (clang, -O0):
<test_lrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lrintl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lrintl>:
jmp    1030 <lrintl@plt>

LLVM IR (-O0):
define i64 @test_lrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @lrintl(x86_fp80 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_lrintl(x86_fp80 %0) {
%2 = tail call i64 @lrintl(x86_fp80 %0)
ret i64 %2
}
int (*matrix3())[5][2] {
  static int arr[][2] = {{11, 12}, {21, 22}, {31, 32}, {41, 42}, {51, 52}};
  return (int(*)[5][2])arr;
}


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

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

LLVM IR (-O0):
@matrix3.arr = internal global [5 x [2 x i32]] [[2 x i32] [i32 11, i32 12], [2 x i32] [i32 21, i32 22], [2 x i32] [i32 31, i32 32], [2 x i32] [i32 41, i32 42], [2 x i32] [i32 51, i32 52]]
define [5 x [2 x i32]]* @matrix3() {
ret [5 x [2 x i32]]* @matrix3.arr
}

LLVM IR (-O2):
@matrix3.arr = internal global [5 x [2 x i32]] [[2 x i32] [i32 11, i32 12], [2 x i32] [i32 21, i32 22], [2 x i32] [i32 31, i32 32], [2 x i32] [i32 41, i32 42], [2 x i32] [i32 51, i32 52]]
define [5 x [2 x i32]]* @matrix3() {
ret [5 x [2 x i32]]* @matrix3.arr
}
/* Variables and functions */
int /*<<< orphan*/ RESHLm(int);
void RES4HLm() { RESHLm(0x10); }


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

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

LLVM IR (-O0):
define void @RES4HLm() {
%1 = call i32 @RESHLm(i32 16)
ret void
}

LLVM IR (-O2):
define void @RES4HLm() {
%1 = tail call i32 @RESHLm(i32 16)
ret void
}
long main() { long g; }


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

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ PlatformPrint(char *);
void HypervisorCleanup(void) { PlatformPrint("Hypervisor unloaded."); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Hypervisor unloaded.\00"
define void @HypervisorCleanup() {
%1 = call i32 @PlatformPrint(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hypervisor unloaded.\00"
define void @HypervisorCleanup() {
%1 = tail call i32 @PlatformPrint(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ util_shift_right_saturate_n(int, short, int);
int _sshl(int src1, unsigned int src2) {
  short local2 = (short)(src2 & 0x7FFF);
  return (int)util_shift_right_saturate_n(src1, -local2, 32);
}


x86 assembly (clang, -O0):
<_sshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fff,%eax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%edi
movswl -0xa(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    $0x20,%edx
movswl %ax,%esi
call   1030 <util_shift_right_saturate_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sshl>:
and    $0x7fff,%esi
neg    %esi
movswl %si,%esi
mov    $0x20,%edx
jmp    1030 <util_shift_right_saturate_n@plt>

LLVM IR (-O0):
define i32 @_sshl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 32767
%8 = trunc i32 %7 to i16
store i16 %8, i16* %5
%9 = load i32, i32* %3
%10 = load i16, i16* %5
%11 = sext i16 %10 to i32
%12 = sub nsw i32 0, %11
%13 = trunc i32 %12 to i16
%14 = call i64 @util_shift_right_saturate_n(i32 %9, i16 signext %13, i32 32)
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @_sshl(i32 %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = and i16 %3, 32767
%5 = sub nsw i16 0, %4
%6 = tail call i64 @util_shift_right_saturate_n(i32 %0, i16 signext %5, i32 32)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _dbg_check_disable();
int /*<<< orphan*/ port_disable();
void chSysDisable(void) {
  port_disable();
  _dbg_check_disable();
}


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

x86 assembly (clang, -O2):
<chSysDisable>:
push   %rax
xor    %eax,%eax
call   1040 <port_disable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <_dbg_check_disable@plt>

LLVM IR (-O0):
define void @chSysDisable() {
%1 = call i32 (...) @port_disable()
%2 = call i32 (...) @_dbg_check_disable()
ret void
}

LLVM IR (-O2):
define void @chSysDisable() {
%1 = tail call i32 (...) @port_disable()
%2 = tail call i32 (...) @_dbg_check_disable()
ret void
}
void g_value_set_long() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_long() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M501_f(char *s) {
  debug("M501_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M501_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M501_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M501_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M501_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M501_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M501_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void CopyEDistList2(Schema, A, B) struct univStruct *Schema;
struct Student **A;
struct Student **B;
{
  AssignStudentEDistList2First(B, AccessStudentEDistList2First(A));
}


x86 assembly (clang, -O0):
<CopyEDistList2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <AccessStudentEDistList2First@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1030 <AssignStudentEDistList2First@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyEDistList2>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1040 <AccessStudentEDistList2First@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <AssignStudentEDistList2First@plt>

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.Student = type opaque
define void @CopyEDistList2(%struct.univStruct* %0, %struct.Student** %1, %struct.Student** %2) {
%4 = alloca %struct.univStruct*
%5 = alloca %struct.Student**
%6 = alloca %struct.Student**
store %struct.univStruct* %0, %struct.univStruct** %4
store %struct.Student** %1, %struct.Student*** %5
store %struct.Student** %2, %struct.Student*** %6
%7 = load %struct.Student**, %struct.Student*** %6
%8 = load %struct.Student**, %struct.Student*** %5
%9 = call i32 (%struct.Student**, ...) bitcast (i32 (...)* @AccessStudentEDistList2First to i32 (%struct.Student**, ...)*)(%struct.Student** %8)
%10 = call i32 (%struct.Student**, i32, ...) bitcast (i32 (...)* @AssignStudentEDistList2First to i32 (%struct.Student**, i32, ...)*)(%struct.Student** %7, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.Student = type opaque
define void @CopyEDistList2(%struct.univStruct* nocapture readnone %0, %struct.Student** %1, %struct.Student** %2) {
%4 = tail call i32 (%struct.Student**, ...) bitcast (i32 (...)* @AccessStudentEDistList2First to i32 (%struct.Student**, ...)*)(%struct.Student** %1)
%5 = tail call i32 (%struct.Student**, i32, ...) bitcast (i32 (...)* @AssignStudentEDistList2First to i32 (%struct.Student**, i32, ...)*)(%struct.Student** %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ insertionSort(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int A[] = {10, 2, 8, 7, 3, 9, 4, 5, 6, 11, 1};
  printArray(A, 11);
  insertionSort(A, 11);
  printArray(A, 11);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1060 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1050 <insertionSort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1060 <printArray@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <insertionSort@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.A = [11 x i32] [i32 10, i32 2, i32 8, i32 7, i32 3, i32 9, i32 4, i32 5, i32 6, i32 11, i32 1]
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 11)
%5 = call i32 @insertionSort(i32* %3, i32 11)
%6 = call i32 @printArray(i32* %3, i32 11)
%7 = call i32 (...) @getchar()
ret i32 0
}
int main(void) {
  int counter = 0;
  while (1) {
    counter++;
    if (5 == counter) {
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
jne    112e <main+0x2e>
jmp    1133 <main+0x33>
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main(void) {
  int tmp;
  {
    goto L;
    if (0) {
    L:
      tmp = 1;
    } else {
      tmp = 0;
    }
    return (tmp);
  }
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %5
3: ; No predecessors!
br i1 false, label %4, label %6
4: ; preds = %3
br label %5
5: ; preds = %4, %0
store i32 1, i32* %2
br label %7
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int strcmp(char *, char *);
int StrUtil_stringCompFunc(const void *a, const void *b) {
  char *s1 = *((char **)a);
  char *s2 = *((char **)b);
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<StrUtil_stringCompFunc>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @StrUtil_stringCompFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @StrUtil_stringCompFunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void Reset_Handler() {}


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

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

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

LLVM IR (-O2):
define void @Reset_Handler() {
ret void
}
void gtk_spin_button_get_numeric() {}


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

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

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

LLVM IR (-O2):
define void @gtk_spin_button_get_numeric() {
ret void
}
/* Variables and functions */
char *proc_search_keyword(char *, char *);
char *proc_cpu_model() {
  return proc_search_keyword("/proc/cpuinfo", "model name");
}


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

x86 assembly (clang, -O2):
<proc_cpu_model>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <proc_search_keyword@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [11 x i8] c"model name\00"
define i8* @proc_cpu_model() {
%1 = call i8* @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/cpuinfo\00"
@.str.1 = [11 x i8] c"model name\00"
define i8* @proc_cpu_model() {
%1 = tail call i8* @proc_search_keyword(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
struct request {
  int dummy;
};

/* Variables and functions */
int __end_that_request_first(struct request *, int, int);
int end_that_request_chunk(struct request *req, int uptodate, int nr_bytes) {
  int tmp;
  tmp = __end_that_request_first(req, uptodate, nr_bytes);
  return (tmp);
}


x86 assembly (clang, -O0):
<end_that_request_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <__end_that_request_first@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_that_request_chunk>:
jmp    1030 <__end_that_request_first@plt>

LLVM IR (-O0):
%struct.request = type { i32 }
define i32 @end_that_request_chunk(%struct.request* %0, i32 %1, i32 %2) {
%4 = alloca %struct.request*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.request* %0, %struct.request** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.request*, %struct.request** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @__end_that_request_first(%struct.request* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%struct.request = type { i32 }
define i32 @end_that_request_chunk(%struct.request* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__end_that_request_first(%struct.request* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int const TS_DIFF(int const, int const);
uint32_t TS_ABS_DIFF_LARGER_THAN(const uint32_t a, const uint32_t b,
                                 const uint32_t limit) {
  return TS_DIFF(a + limit, b) > (limit * 2);
}


x86 assembly (clang, -O0):
<TS_ABS_DIFF_LARGER_THAN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <TS_DIFF@plt>
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TS_ABS_DIFF_LARGER_THAN>:
push   %rbx
mov    %edx,%ebx
add    %edx,%edi
call   1030 <TS_DIFF@plt>
add    %ebx,%ebx
xor    %ecx,%ecx
cmp    %ebx,%eax
setg   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @TS_ABS_DIFF_LARGER_THAN(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* %6
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = call i32 @TS_DIFF(i32 %9, i32 %10)
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 2
%14 = icmp sgt i32 %11, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @TS_ABS_DIFF_LARGER_THAN(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %0
%5 = tail call i32 @TS_DIFF(i32 %4, i32 %1)
%6 = shl nsw i32 %2, 1
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
double M_PI;
double to_degrees(double radians) { return radians * (180.0 / M_PI); }


x86 assembly (clang, -O0):
<to_degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_degrees>:
mov    0x2ee1(%rip),%rax
movsd  0xef1(%rip),%xmm1
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @to_degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double 1.800000e+02, %4
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @to_degrees(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double 1.800000e+02, %2
%4 = fmul double %3, %0
ret double %4
}
unsigned char _ucAsyncReset(void) { return (1); }


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

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

LLVM IR (-O0):
define zeroext i8 @_ucAsyncReset() {
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @_ucAsyncReset() {
ret i8 1
}
int execute_lock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_lock() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sock_close(int sock) {
  if (sock < 0)
    return;
  close(sock);
}


x86 assembly (clang, -O0):
<sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <sock_close+0x1a>
jmp    1132 <sock_close+0x22>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_close>:
test   %edi,%edi
js     1119 <sock_close+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @sock_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @sock_close(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UartPutc(char);
__attribute__((noreturn)) void UartEndSimulation(int code) {
  UartPutc((char)0x4);
  UartPutc((char)code);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UartEndSimulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <UartPutc@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <UartPutc@plt>
jmp    1130 <UartEndSimulation+0x20>

x86 assembly (clang, -O2):
<UartEndSimulation>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <UartPutc@plt>
movsbl %bl,%edi
call   1030 <UartPutc@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1130 <UartEndSimulation+0x20>

LLVM IR (-O0):
define void @UartEndSimulation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @UartPutc(i8 signext 4)
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
%6 = call i32 @UartPutc(i8 signext %5)
br label %7
7: ; preds = %1, %7
br label %7
}

LLVM IR (-O2):
define void @UartEndSimulation(i32 %0) {
%2 = tail call i32 @UartPutc(i8 signext 4)
%3 = trunc i32 %0 to i8
%4 = tail call i32 @UartPutc(i8 signext %3)
br label %5
5: ; preds = %1, %5
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ mat_multiply_matrix_d3(double **, double **, double **);
int /*<<< orphan*/ mat_transpose_matrix_d3(double **, double **);
void mat_get_metric(double metric[3][3], double lattice[3][3]) {
  double lattice_t[3][3];
  mat_transpose_matrix_d3(lattice_t, lattice);
  mat_multiply_matrix_d3(metric, lattice_t, lattice);
}


x86 assembly (clang, -O0):
<mat_get_metric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mat_transpose_matrix_d3@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <mat_multiply_matrix_d3@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_get_metric>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <mat_transpose_matrix_d3@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <mat_multiply_matrix_d3@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @mat_get_metric([3 x double]* %0, [3 x double]* %1) {
%3 = alloca [3 x double]*
%4 = alloca [3 x double]*
%5 = alloca [3 x [3 x double]]
store [3 x double]* %0, [3 x double]** %3
store [3 x double]* %1, [3 x double]** %4
%6 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%7 = bitcast [3 x double]* %6 to double**
%8 = load [3 x double]*, [3 x double]** %4
%9 = bitcast [3 x double]* %8 to double**
%10 = call i32 @mat_transpose_matrix_d3(double** %7, double** %9)
%11 = load [3 x double]*, [3 x double]** %3
%12 = bitcast [3 x double]* %11 to double**
%13 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%14 = bitcast [3 x double]* %13 to double**
%15 = load [3 x double]*, [3 x double]** %4
%16 = bitcast [3 x double]* %15 to double**
%17 = call i32 @mat_multiply_matrix_d3(double** %12, double** %14, double** %16)
ret void
}

LLVM IR (-O2):
define void @mat_get_metric([3 x double]* %0, [3 x double]* %1) {
%3 = alloca [3 x [3 x double]]
%4 = bitcast [3 x [3 x double]]* %3 to i8*
%5 = bitcast [3 x [3 x double]]* %3 to double**
%6 = bitcast [3 x double]* %1 to double**
%7 = call i32 @mat_transpose_matrix_d3(double** %5, double** %6)
%8 = bitcast [3 x double]* %0 to double**
%9 = call i32 @mat_multiply_matrix_d3(double** %8, double** %5, double** %6)
ret void
}
int test_imm_86int8_reg(signed char val) {
  return ((val) & (-0x86 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_86int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff7a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_86int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -134
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int if_bad(int j) {
  int p = 10;
  if (p < 10 + j) {
    p++;
  } else {
    p = j + 3;
    for (int k = 0; k < 10; k++) {
      j += 3;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<if_bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jge    112d <if_bad+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <if_bad+0x63>
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    115e <if_bad+0x5e>
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <if_bad+0x3d>
jmp    1163 <if_bad+0x63>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_bad>:
lea    0x3(%rdi),%ecx
test   %edi,%edi
mov    $0xb,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @if_bad(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, 3
%4 = select i1 %2, i32 11, i32 %3
ret i32 %4
}
int LIT2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @LIT2() {
ret i32 0
}
void swd_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @swd_enable() {
ret void
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, unsigned int);
void *mp_alloc(struct mempool *, unsigned int, int /*<<< orphan*/);
void *mp_memdup(struct mempool *mp, const void *buf, unsigned len) {
  void *b = mp_alloc(mp, len, 0);
  if (b)
    memcpy(b, buf, len);
  return b;
}


x86 assembly (clang, -O0):
<mp_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1040 <mp_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1160 <mp_memdup+0x40>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_memdup>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edx,%esi
xor    %edx,%edx
call   1040 <mp_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1147 <mp_memdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.mempool = type { i32 }
define i8* @mp_memdup(%struct.mempool* %0, i8* %1, i32 %2) {
%4 = tail call i8* @mp_alloc(%struct.mempool* %0, i32 %2, i32 0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memcpy(i8* %4, i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}