xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite_err(void *, int, int, int /*<<< orphan*/ *);
void toasim_write_32(char *fname, void *val, FILE *file) {
  uint32_t sz = 4;
  fwrite_err(fname, 4, 1, file);
  fwrite_err(&sz, 4, 1, file);
  fwrite_err(val, sz, 1, file);
}


x86 assembly (clang, -O0):
<toasim_write_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite_err@plt>
lea    -0x1c(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite_err@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite_err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toasim_write_32>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
movl   $0x4,0x4(%rsp)
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite_err@plt>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite_err@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite_err@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @toasim_write_32(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%6 = tail call i32 @fwrite_err(i8* %0, i32 4, i32 1, i32* %2)
%7 = call i32 @fwrite_err(i8* %5, i32 4, i32 1, i32* %2)
%8 = load i32, i32* %4
%9 = call i32 @fwrite_err(i8* %1, i32 %8, i32 1, i32* %2)
ret void
}
int test_imm_D4uint32_mem(unsigned int *val) {
  return ((*val) & (0xD4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D4uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 212
%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_D4uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 212
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t add3(uint8_t x, uint8_t y, uint8_t z) { return x + y + z; }


x86 assembly (clang, -O0):
<add3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add3>:
lea    (%rdi,%rsi,1),%rax
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @add3(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %1, %0
%5 = add nsw i64 %4, %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_strdup_handler(char *);
char *strndup(char const *, size_t);
__attribute__((__weak__, __always___)) char *
softboundcets_strndup(const char *s, size_t n) {
  char *ret_ptr = strndup(s, n);
  __softboundcets_strdup_handler(ret_ptr);
  return ret_ptr;
}


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

x86 assembly (clang, -O2):
<softboundcets_strndup>:
push   %rbx
call   1030 <strndup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__softboundcets_strdup_handler@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundcets_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @strndup(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @__softboundcets_strdup_handler(i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define weak i8* @softboundcets_strndup(i8* %0, i64 %1) {
%3 = tail call i8* @strndup(i8* %0, i64 %1)
%4 = tail call i32 @__softboundcets_strdup_handler(i8* %3)
ret i8* %3
}
extern void libvamphostsdk_v_2_2_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvamphostsdk_v_2_2_present() {
ret void
}
/* Variables and functions */
float expf(float);
float __ocl_half_exp_float(float src) { return expf(src); }


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

x86 assembly (clang, -O2):
<__ocl_half_exp_float>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @__ocl_half_exp_float(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void msDelay(int len) {
  struct timespec s;
  s.tv_sec = len / 1000;
  s.tv_nsec = (len - (s.tv_sec * 1000)) * 1000000;
  nanosleep(&s, NULL);
}


x86 assembly (clang, -O0):
<msDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x3e8,-0x10(%rbp),%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msDelay>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0xfffffc18,%ecx,%ecx
add    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @msDelay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 1000
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %12, i32* %13
%14 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @msDelay(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = mul nsw i32 %4, -1000
%7 = add i32 %6, %0
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
void slideLeft(char *line, unsigned offset) {
  unsigned int i;
  for (i = 0;; ++i) {
    line[i] = line[i + offset];
    if (line[i + offset] == '\0') {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<slideLeft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    -0xc(%rbp),%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    -0xc(%rbp),%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1146 <slideLeft+0x46>
pop    %rbp
ret
jmp    114b <slideLeft+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <slideLeft+0x12>

x86 assembly (clang, -O2):
<slideLeft>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rsi,%rax,1),%ecx
movzbl (%rdi,%rcx,1),%r8d
mov    %eax,%edx
mov    %r8b,(%rdi,%rdx,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rcx,1)
jne    1110 <slideLeft+0x10>
ret

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

LLVM IR (-O2):
define void @slideLeft(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %13, %3 ]
%5 = add i32 %4, %1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = zext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %8, i8* %10
%11 = load i8, i8* %7
%12 = icmp eq i8 %11, 0
%13 = add i32 %4, 1
br i1 %12, label %14, label %3
14: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_byte(unsigned char, int, unsigned char);
void setReturnDelayTime(unsigned char id, unsigned char time) {
  dxl_write_byte(id, (5), time);
}


x86 assembly (clang, -O0):
<setReturnDelayTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x5,%esi
movzbl %al,%edi
movzbl -0x2(%rbp),%edx
call   1030 <dxl_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setReturnDelayTime>:
mov    %esi,%edx
mov    $0x5,%esi
jmp    1030 <dxl_write_byte@plt>

LLVM IR (-O0):
define void @setReturnDelayTime(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @dxl_write_byte(i8 zeroext %5, i32 5, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @setReturnDelayTime(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @dxl_write_byte(i8 zeroext %0, i32 5, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fcos() {
  db(0xD9);
  db(0xFF);
}


x86 assembly (clang, -O0):
<fcos>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xff,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcos>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fcos() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 255)
ret void
}

LLVM IR (-O2):
define void @fcos() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 255)
ret void
}
int MAN2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MAN2() {
ret i32 0
}
int min(int n1, int n2) { return n1 < n2 ? n1 : n2; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ isdigit(char);
char tolower(char);
char gauged_writer_hex_decode(char c) {
  return isdigit(c) ? c - '0' : tolower(c) - 'a' + 10;
}


x86 assembly (clang, -O0):
<gauged_writer_hex_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <gauged_writer_hex_decode+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <gauged_writer_hex_decode+0x45>
movsbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauged_writer_hex_decode>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <gauged_writer_hex_decode+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <tolower@plt>
add    $0xa9,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @gauged_writer_hex_decode(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @gauged_writer_hex_decode(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @tolower(i8 signext %0)
%8 = add i8 %7, -87
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}
long int fn9(long int x, unsigned long long y) { return x << y; }


x86 assembly (clang, -O0):
<fn9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn9>:
mov    %rsi,%rcx
mov    %rdi,%rax
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @fn9(i64 %0, i64 %1) {
%3 = shl i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int strlen(char *);
char *chopStringTips(char *input) {
  int len = strlen(input);
  if (len > 0)
    input++;
  if (len > 1)
    input[len - 2] = '\0';
  return input;
}


x86 assembly (clang, -O0):
<chopStringTips>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113e <chopStringTips+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1159 <chopStringTips+0x49>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chopStringTips>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setg   %al
add    %rbx,%rax
cmp    $0x2,%ecx
jl     1131 <chopStringTips+0x21>
add    $0xfffffffe,%ecx
movb   $0x0,(%rax,%rcx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @chopStringTips(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
%6 = icmp sgt i32 %2, 1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = add nsw i32 %2, -2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7, %1
ret i8* %5
}
unsigned long event_get_version_number(void) { return (0x02001000); }


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

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

LLVM IR (-O0):
define i64 @event_get_version_number() {
ret i64 33558528
}

LLVM IR (-O2):
define i64 @event_get_version_number() {
ret i64 33558528
}
void RTLockValidatorRecSharedIsOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecSharedIsOwner() {
ret void
}
/* Variables and functions */
int rand();
int main() {
  int i = rand();
  int j;
  if (i < 10) {
    j = 1;
  } else if (j < 20) {
    j = 2;
  }
  if (i < 10) {
    j = 1;
  } else if (j < 20) {
    j = 2;
  } else {
    j = 3;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    113f <main+0x2f>
movl   $0x1,-0xc(%rbp)
jmp    1155 <main+0x45>
cmpl   $0x14,-0xc(%rbp)
jge    1150 <main+0x40>
movl   $0x2,-0xc(%rbp)
jmp    1155 <main+0x45>
cmpl   $0xa,-0x8(%rbp)
jge    116b <main+0x5b>
movl   $0x1,-0xc(%rbp)
jmp    118d <main+0x7d>
cmpl   $0x14,-0xc(%rbp)
jge    1181 <main+0x71>
movl   $0x2,-0xc(%rbp)
jmp    1188 <main+0x78>
movl   $0x3,-0xc(%rbp)
jmp    118d <main+0x7d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rand()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ _ssp_child_sub(char const *, unsigned int);
int _ssp_child(char const *progname, unsigned int pattern) {
  _ssp_child_sub(progname, pattern);
  _exit(2);
  return 2;
}


x86 assembly (clang, -O0):
<_ssp_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <_ssp_child_sub@plt>
mov    $0x2,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_ssp_child>:
push   %rax
call   1040 <_ssp_child_sub@plt>
mov    $0x2,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @_ssp_child(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @_ssp_child_sub(i8* %5, i32 %6)
%8 = call i32 @_exit(i32 2)
unreachable
}

LLVM IR (-O2):
define i32 @_ssp_child(i8* %0, i32 %1) {
%3 = tail call i32 @_ssp_child_sub(i8* %0, i32 %1)
%4 = tail call i32 @_exit(i32 2)
unreachable
}
void yy_2_TemplateTailPart(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_TemplateTailPart(i8* nocapture %0, i32 %1) {
ret void
}
void bcm43xx_generate_rts(struct bcm43xx_txhdr *txhdr) {}


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

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

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

LLVM IR (-O2):
%struct.bcm43xx_txhdr = type opaque
define void @bcm43xx_generate_rts(%struct.bcm43xx_txhdr* nocapture %0) {
ret void
}
int rcu_print_task_stall(struct rcu_node *rnp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rcu_node = type opaque
define i32 @rcu_print_task_stall(%struct.rcu_node* nocapture readnone %0) {
ret i32 0
}
f(float f) { char c = f; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i8
store float %0, float* %3
%5 = load float, float* %3
%6 = fptosi float %5 to i8
store i8 %6, i8* %4
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(float %0) {
ret i32 undef
}
char cbt_remove(struct cbtree **root, int pos) { return 0; }


x86 assembly (clang, -O0):
<cbt_remove>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cbtree = type opaque
define signext i8 @cbt_remove(%struct.cbtree** %0, i32 %1) {
%3 = alloca %struct.cbtree**
%4 = alloca i32
store %struct.cbtree** %0, %struct.cbtree*** %3
store i32 %1, i32* %4
ret i8 0
}

LLVM IR (-O2):
%struct.cbtree = type opaque
define signext i8 @cbt_remove(%struct.cbtree** nocapture readnone %0, i32 %1) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA1_Channel6_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_Channel6_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_Channel6_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ driver1();
int /*<<< orphan*/ driver2();
int /*<<< orphan*/ driver3();
int /*<<< orphan*/ driver4();
int main() {
  driver1();
  driver2();
  driver3();
  driver4();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <driver1@plt>
mov    $0x0,%al
call   1040 <driver2@plt>
mov    $0x0,%al
call   1060 <driver3@plt>
mov    $0x0,%al
call   1030 <driver4@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <driver1@plt>
xor    %eax,%eax
call   1040 <driver2@plt>
xor    %eax,%eax
call   1060 <driver3@plt>
xor    %eax,%eax
call   1030 <driver4@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @driver1()
%3 = call i32 (...) @driver2()
%4 = call i32 (...) @driver3()
%5 = call i32 (...) @driver4()
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @driver1()
%2 = tail call i32 (...) @driver2()
%3 = tail call i32 (...) @driver3()
%4 = tail call i32 (...) @driver4()
ret i32 1
}
int test_imm_6Fint64_lowword_reg(long long val) {
  return ((val) & (0x6F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Fint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 111
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, ...);
int main(void) {
  char firstletter;
  int hour, minute;
  int i = 0;
  firstletter = 'a';
  hour = 11;
  minute = 59;
  printf("Current time is %d:%d\n", hour, minute);
  printf("%d + %d = %d\n", i, i, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movb   $0x61,-0x5(%rbp)
movl   $0xb,-0xc(%rbp)
movl   $0x3b,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"Current time is %d:%d\0A\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 11, i32 59)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void show_usage(void) {
  fprintf(stderr, "Usage: configwrite restart|resolv|netconfig\n");
  fprintf(stderr, "Write to stdin if resolv or netconfig parameter is used.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeee(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: configwrite restart|resolv|netconfig\0A\00"
@.str.1 = [58 x i8] c"Write to stdin if resolv or netconfig parameter is used.\0A\00"
@EXIT_FAILURE = global i32 0
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: configwrite restart|resolv|netconfig\0A\00"
@.str.1 = [58 x i8] c"Write to stdin if resolv or netconfig parameter is used.\0A\00"
@EXIT_FAILURE = global i32 0
define void @show_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  for (int i = 0; i < argc; ++i)
    printf("Argument %d : %s \n", i, argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Argument %d : %s \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Argument %d : %s \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
atc_write_response() {}


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

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

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

LLVM IR (-O2):
define i32 @atc_write_response() {
ret i32 undef
}
void xdk_joypad_destroy(void) {}


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

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

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

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

/* Variables and functions */
int errno;
int vfscanf_unlocked(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int vfscanf(FILE *restrict stream, const char *restrict format, va_list args) {
  int r, saved_errno;
  ;
  r = vfscanf_unlocked(stream, format, args);
  saved_errno = errno;
  ;
  return errno = saved_errno, r;
}


x86 assembly (clang, -O0):
<vfscanf>:
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    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vfscanf_unlocked@plt>
mov    %eax,-0x18(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    0x2e94(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfscanf>:
jmp    1030 <vfscanf_unlocked@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32 @vfscanf(i32* noalias %0, i8* noalias %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i32*, i32** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @vfscanf_unlocked(i32* %9, i8* %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* @errno
store i32 %13, i32* %8
%14 = load i32, i32* %8
store i32 %14, i32* @errno
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @vfscanf(i32* noalias %0, i8* noalias %1, i32 %2) {
%4 = tail call i32 @vfscanf_unlocked(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
double Mbytes_to_Gbytes(double bytes) { return bytes / 1e3; }


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

x86 assembly (clang, -O2):
<Mbytes_to_Gbytes>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Mbytes_to_Gbytes(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @Mbytes_to_Gbytes(double %0) {
%2 = fdiv double %0, 1.000000e+03
ret double %2
}
/* Type definitions */
struct printf_info {
  int dummy;
};

/* Variables and functions */
int PA_POINTER;
int ret1(const struct printf_info *info, size_t n, int *argtypes) {
  argtypes[0] = PA_POINTER;
  return 1;
}


x86 assembly (clang, -O0):
<ret1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret1>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.printf_info = type { i32 }
@PA_POINTER = global i32 0
define i32 @ret1(%struct.printf_info* %0, i64 %1, i32* %2) {
%4 = alloca %struct.printf_info*
%5 = alloca i64
%6 = alloca i32*
store %struct.printf_info* %0, %struct.printf_info** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i32, i32* @PA_POINTER
%8 = load i32*, i32** %6
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
ret i32 1
}

LLVM IR (-O2):
%struct.printf_info = type { i32 }
@PA_POINTER = global i32 0
define i32 @ret1(%struct.printf_info* nocapture readnone %0, i64 %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* @PA_POINTER
store i32 %4, i32* %2
ret i32 1
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int epoll_ctl(int epfd __attribute__((unused)), int op __attribute__((unused)),
              int fd __attribute__((unused)),
              struct epoll_event *event __attribute__((unused))) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<epoll_ctl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebf(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_ctl>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.epoll_event*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.epoll_event* %3, %struct.epoll_event** %8
%9 = load i32, i32* @EINVAL
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}
int congruent_next(a, x, c, mod) { return (a * x + c) % mod; }


x86 assembly (clang, -O0):
<congruent_next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<congruent_next>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @congruent_next(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = srem i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @congruent_next(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = srem i32 %6, %3
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t xor32() {
  static uint32_t y = 2463534242UL;
  y ^= (y << 13);
  y ^= (y >> 17);
  return (y ^= (y << 15));
}


x86 assembly (clang, -O0):
<xor32>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
shl    $0xd,%eax
xor    0x2f0d(%rip),%eax
mov    %eax,0x2f07(%rip)
mov    0x2f01(%rip),%eax
sar    $0x11,%eax
xor    0x2ef8(%rip),%eax
mov    %eax,0x2ef2(%rip)
mov    0x2eec(%rip),%eax
shl    $0xf,%eax
xor    0x2ee3(%rip),%eax
mov    %eax,0x2edd(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor32>:
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
shl    $0xd,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
sar    $0x11,%edx
xor    %ecx,%edx
mov    %edx,%eax
shl    $0xf,%eax
xor    %edx,%eax
mov    %eax,0x2eff(%rip)
ret

LLVM IR (-O0):
@xor32.y = internal global i32 -1831433054
define i32 @xor32() {
%1 = load i32, i32* @xor32.y
%2 = shl i32 %1, 13
%3 = load i32, i32* @xor32.y
%4 = xor i32 %3, %2
store i32 %4, i32* @xor32.y
%5 = load i32, i32* @xor32.y
%6 = ashr i32 %5, 17
%7 = load i32, i32* @xor32.y
%8 = xor i32 %7, %6
store i32 %8, i32* @xor32.y
%9 = load i32, i32* @xor32.y
%10 = shl i32 %9, 15
%11 = load i32, i32* @xor32.y
%12 = xor i32 %11, %10
store i32 %12, i32* @xor32.y
ret i32 %12
}

LLVM IR (-O2):
@xor32.y = internal unnamed_addr global i32 -1831433054
define i32 @xor32() {
%1 = load i32, i32* @xor32.y
%2 = shl i32 %1, 13
%3 = xor i32 %2, %1
%4 = ashr i32 %3, 17
%5 = xor i32 %4, %3
%6 = shl i32 %5, 15
%7 = xor i32 %6, %5
store i32 %7, i32* @xor32.y
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int);
void congratulateStudent(char *student, char *course, int numDays) {
  printf("%s has done as much %s Programming as I could fit into %d days. \n",
         student, course, numDays);
}


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

x86 assembly (clang, -O2):
<congratulateStudent>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"%s has done as much %s Programming as I could fit into %d days. \0A\00"
define void @congratulateStudent(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"%s has done as much %s Programming as I could fit into %d days. \0A\00"
define void @congratulateStudent(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ luaL_check_lstr(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ system(int /*<<< orphan*/);
void io_execute(void) { lua_pushnumber(system((luaL_check_lstr((1), NULL)))); }


x86 assembly (clang, -O0):
<io_execute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <luaL_check_lstr@plt>
mov    %eax,%edi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_execute>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <luaL_check_lstr@plt>
mov    %eax,%edi
call   1030 <system@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @io_execute() {
%1 = call i32 @luaL_check_lstr(i32 1, i32* null)
%2 = call i32 @system(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @io_execute() {
%1 = tail call i32 @luaL_check_lstr(i32 1, i32* null)
%2 = tail call i32 @system(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void name() { printf("Please enter your name : "); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter your name : \00"
define void @name() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter your name : \00"
define void @name() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}