xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void check_positive(int v, const char *msg) {
  if (v < 1) {
    fprintf(stderr, "error: number of %s must be positive!\n", msg);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_positive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1160 <check_positive+0x40>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_positive>:
test   %edi,%edi
jle    1125 <check_positive+0x5>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"error: number of %s must be positive!\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_positive(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"error: number of %s must be positive!\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_positive(i32 %0, i8* %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_cleanup();
void actuator_lcd_cleanup(void) { lcd_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @actuator_lcd_cleanup() {
%1 = tail call i32 (...) @lcd_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flockfile(int /*<<< orphan*/);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/);
int puts_unlocked(char const *);
int /*<<< orphan*/ stdout;
int puts(const char *s) {
  flockfile(stdout);
  int result = puts_unlocked(s);
  funlockfile(stdout);
  return result;
  ;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <flockfile@plt>
mov    -0x8(%rbp),%rdi
call   1050 <puts_unlocked@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <funlockfile@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%edi
call   1040 <flockfile@plt>
mov    %rbx,%rdi
call   1050 <puts_unlocked@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1030 <funlockfile@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @flockfile(i32 %4)
%6 = load i8*, i8** %2
%7 = call i32 @puts_unlocked(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* @stdout
%9 = call i32 @funlockfile(i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @flockfile(i32 %2)
%4 = tail call i32 @puts_unlocked(i8* %0)
%5 = load i32, i32* @stdout
%6 = tail call i32 @funlockfile(i32 %5)
ret i32 %4
}
int test_imm_8Fint32_mem(int *val) {
  return ((*val) & (0x8F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Fint32_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, 143
%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_8Fint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 143
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print_array(long array[], int length) {
  for (int i = 0; i < length; i++) {
    printf("%ld\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_array+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define void @print_array(i64* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i64, i64* %0, i64 %8
%10 = load i64, i64* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int pgm_default_led(struct programmer_t *pgm, int value) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.programmer_t = type opaque
define i32 @pgm_default_led(%struct.programmer_t* nocapture readnone %0, i32 %1) {
ret i32 0
}
struct node *prev(struct node *node) {
  return __builtin_choose_expr(
      __builtin_types_compatible_p(__typeof__(prev_const(node)),
                                   const struct node *),
      (struct node *)(prev_const(node)),
      __builtin_choose_expr(
          __builtin_types_compatible_p(__typeof__(prev_const(node)),
                                       const struct module *),
          (struct module *)(prev_const(node)),
          __builtin_choose_expr(
              __builtin_types_compatible_p(__typeof__(prev_const(node)),
                                           const struct typ *),
              (struct typ *)(prev_const(node)),
              __builtin_choose_expr(
                  __builtin_types_compatible_p(__typeof__(prev_const(node)),
                                               const struct toplevel *),
                  (struct toplevel *)(prev_const(node)),
                  __builtin_choose_expr(
                      __builtin_types_compatible_p(__typeof__(prev_const(node)),
                                                   const struct scope *),
                      (struct scope *)(prev_const(node)),
                      __builtin_choose_expr(
                          __builtin_types_compatible_p(
                              __typeof__(prev_const(node)),
                              const struct typset *),
                          (struct typset *)(prev_const(node)),
                          __builtin_choose_expr(
                              __builtin_types_compatible_p(
                                  __typeof__(prev_const(node)),
                                  const struct constraint *),
                              (struct constraint *)(prev_const(node)),
                              __builtin_choose_expr(
                                  __builtin_types_compatible_p(
                                      __typeof__(prev_const(node)),
                                      const struct vecancestor *),
                                  (struct vecancestor *)(prev_const(node)),
                                  (prev_const(node))))))))));
}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @prev(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call i32 (%struct.node*, ...) bitcast (i32 (...)* @prev_const to i32 (%struct.node*, ...)*)(%struct.node* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.node*
ret %struct.node* %6
}

LLVM IR (-O2):
%struct.node = type opaque
define %struct.node* @prev(%struct.node* %0) {
%2 = tail call i32 (%struct.node*, ...) bitcast (i32 (...)* @prev_const to i32 (%struct.node*, ...)*)(%struct.node* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.node*
ret %struct.node* %4
}
/* Variables and functions */
int /*<<< orphan*/ orgfx_enable_tex0(int /*<<< orphan*/);
int /*<<< orphan*/ orgfx_set_color(unsigned int);
int /*<<< orphan*/ orgfx_triangle(int, int, int, int, int, int,
                                  int /*<<< orphan*/);
void orgfxplus_triangle(int x0, int y0, int x1, int y1, int x2, int y2,
                        unsigned int color) {
  orgfx_enable_tex0(0);
  orgfx_set_color(color);
  orgfx_triangle(x0, y0, x1, y1, x2, y2, 0);
}


x86 assembly (clang, -O0):
<orgfxplus_triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
xor    %edi,%edi
call   1050 <orgfx_enable_tex0@plt>
mov    0x10(%rbp),%edi
call   1040 <orgfx_set_color@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <orgfx_triangle@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfxplus_triangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1050 <orgfx_enable_tex0@plt>
mov    0x40(%rsp),%edi
call   1040 <orgfx_set_color@plt>
movl   $0x0,(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <orgfx_triangle@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @orgfxplus_triangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = call i32 @orgfx_enable_tex0(i32 0)
%16 = load i32, i32* %14
%17 = call i32 @orgfx_set_color(i32 %16)
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = load i32, i32* %11
%22 = load i32, i32* %12
%23 = load i32, i32* %13
%24 = call i32 @orgfx_triangle(i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 0)
ret void
}

LLVM IR (-O2):
define void @orgfxplus_triangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @orgfx_enable_tex0(i32 0)
%9 = tail call i32 @orgfx_set_color(i32 %6)
%10 = tail call i32 @orgfx_triangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ast_register_file_version(char *, char *);
void __attribute__((constructor)) __register_file_version(void) {
  ast_register_file_version(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/"
      "master/ulaw.c",
      "$Revision: 7221 $");
}


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

x86 assembly (clang, -O2):
<__register_file_version>:
lea    0xee9(%rip),%rdi
lea    0xf73(%rip),%rsi
jmp    1030 <ast_register_file_version@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/ulaw.c\00"
@.str.1 = [18 x i8] c"$Revision: 7221 $\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__register_file_version, i8* null }]
define void @__register_file_version() {
%1 = call i32 @ast_register_file_version(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/ulaw.c\00"
@.str.1 = [18 x i8] c"$Revision: 7221 $\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__register_file_version, i8* null }]
define void @__register_file_version() {
%1 = tail call i32 @ast_register_file_version(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_SetVolume(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *, unsigned short);
void UPnPRenderingControl_SetVolume(void *upnptoken, unsigned int InstanceID,
                                    char *Channel,
                                    unsigned short DesiredVolume) {
  printf("Invoke: UPnPRenderingControl_SetVolume(%u,%s,%u);\r\n", InstanceID,
         Channel, DesiredVolume);
  UPnPResponse_RenderingControl_SetVolume(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_SetVolume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xeb8(%rip),%rdi
movzwl -0x1a(%rbp),%ecx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_RenderingControl_SetVolume@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_SetVolume>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_RenderingControl_SetVolume@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Invoke: UPnPRenderingControl_SetVolume(%u,%s,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetVolume(i8* %0, i32 %1, i8* %2, i16 zeroext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i16, i16* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i16 zeroext %11)
%13 = load i8*, i8** %5
%14 = call i32 @UPnPResponse_RenderingControl_SetVolume(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Invoke: UPnPRenderingControl_SetVolume(%u,%s,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetVolume(i8* %0, i32 %1, i8* %2, i16 zeroext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i16 zeroext %3)
%6 = tail call i32 @UPnPResponse_RenderingControl_SetVolume(i8* %0)
ret void
}
int wrenUtf8EncodeNumBytes(int value) {
  do {
  } while (0);
  if (value <= 0x7f)
    return 1;
  if (value <= 0x7ff)
    return 2;
  if (value <= 0xffff)
    return 3;
  if (value <= 0x10ffff)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<wrenUtf8EncodeNumBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
jmp    110c <wrenUtf8EncodeNumBytes+0xc>
cmpl   $0x7f,-0x8(%rbp)
jg     1122 <wrenUtf8EncodeNumBytes+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1174 <wrenUtf8EncodeNumBytes+0x74>
cmpl   $0x7ff,-0x8(%rbp)
jg     113b <wrenUtf8EncodeNumBytes+0x3b>
movl   $0x2,-0x4(%rbp)
jmp    1174 <wrenUtf8EncodeNumBytes+0x74>
cmpl   $0xffff,-0x8(%rbp)
jg     1154 <wrenUtf8EncodeNumBytes+0x54>
movl   $0x3,-0x4(%rbp)
jmp    1174 <wrenUtf8EncodeNumBytes+0x74>
cmpl   $0x10ffff,-0x8(%rbp)
jg     116d <wrenUtf8EncodeNumBytes+0x6d>
movl   $0x4,-0x4(%rbp)
jmp    1174 <wrenUtf8EncodeNumBytes+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrenUtf8EncodeNumBytes>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1135 <wrenUtf8EncodeNumBytes+0x35>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1135 <wrenUtf8EncodeNumBytes+0x35>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1135 <wrenUtf8EncodeNumBytes+0x35>
xor    %eax,%eax
cmp    $0x110000,%edi
setb   %al
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @wrenUtf8EncodeNumBytes(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 1114112
%9 = select i1 %8, i32 4, i32 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int sjhashStrNICmp(char const *, char const *, int);
int strCompare(const void *pKey1, int n1, const void *pKey2, int n2) {
  if (n1 != n2)
    return 1;
  return sjhashStrNICmp((const char *)pKey1, (const char *)pKey2, n1);
}


x86 assembly (clang, -O0):
<strCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <strCompare+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1151 <strCompare+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <sjhashStrNICmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCompare>:
cmp    %ecx,%esi
jne    1120 <strCompare+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <sjhashStrNICmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strCompare(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @sjhashStrNICmp(i8* %0, i8* %2, i32 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
void dispatch_atfork_parent(void) {}


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

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

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

LLVM IR (-O2):
define void @dispatch_atfork_parent() {
ret void
}
char Int2Char(int x) {
  if (x < 10)
    return x + '0';
  else
    return (x - 10) + 'A';
}


x86 assembly (clang, -O0):
<Int2Char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <Int2Char+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <Int2Char+0x2b>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int2Char>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

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

LLVM IR (-O2):
define signext i8 @Int2Char(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_LL();
int /*<<< orphan*/ test_ULL();
int main() {
  test_LL();
  test_ULL();
  puts("TEST OK");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_LL@plt>
mov    $0x0,%al
call   1040 <test_ULL@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_LL@plt>
xor    %eax,%eax
call   1040 <test_ULL@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"TEST OK\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_LL()
%3 = call i32 (...) @test_ULL()
%4 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"TEST OK\00"
define i32 @main() {
%1 = tail call i32 (...) @test_LL()
%2 = tail call i32 (...) @test_ULL()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
char const *pubnub_uname(void) {
  return "POSIX"
         "%2F"
         "2.1-alpha";
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"POSIX%2F2.1-alpha\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"POSIX%2F2.1-alpha\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ dprintf(int, char *, char *);
int usage(char *argv0) {
  dprintf(2, "usage: %s interface channel\n", argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xed4(%rip),%rsi
call   1030 <dprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    $0x2,%edi
call   1030 <dprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"usage: %s interface channel\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dprintf(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [29 x i8] c"usage: %s interface channel\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @dprintf(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ compute_shiftstate();
void do_null(void) { compute_shiftstate(); }


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

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

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

LLVM IR (-O2):
define void @do_null() {
%1 = tail call i32 (...) @compute_shiftstate()
ret void
}
__typeof__(islower("")) test_islower_38(void) { return islower(""); }


x86 assembly (clang, -O0):
<test_islower_38>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <islower@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_islower_38() {
%1 = call i32 @islower(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_islower_38() {
%1 = tail call i32 @islower(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
void fo_scheduler_set_special(int option, int value) {}


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

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

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

LLVM IR (-O2):
define void @fo_scheduler_set_special(i32 %0, i32 %1) {
ret void
}
int strcnt(char *string, char c) {
  int i, cnt = 0;
  for (i = 0; string[i] != '\0'; i++) {
    if (string[i] == c)
      cnt++;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<strcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1165 <strcnt+0x65>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <strcnt+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <strcnt+0x57>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <strcnt+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcnt>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strcnt+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strcnt+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcnt(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
                    struct ubifs_nnode *parent, int iip) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.ubifs_pnode = type opaque
%struct.ubifs_nnode = type opaque
define void @dbg_dump_pnode(%struct.ubifs_info* %0, %struct.ubifs_pnode* %1, %struct.ubifs_nnode* %2, i32 %3) {
%5 = alloca %struct.ubifs_info*
%6 = alloca %struct.ubifs_pnode*
%7 = alloca %struct.ubifs_nnode*
%8 = alloca i32
store %struct.ubifs_info* %0, %struct.ubifs_info** %5
store %struct.ubifs_pnode* %1, %struct.ubifs_pnode** %6
store %struct.ubifs_nnode* %2, %struct.ubifs_nnode** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.ubifs_pnode = type opaque
%struct.ubifs_nnode = type opaque
define void @dbg_dump_pnode(%struct.ubifs_info* nocapture %0, %struct.ubifs_pnode* nocapture %1, %struct.ubifs_nnode* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("** Welcome to Thinking in C **");
  puts("(You'll be glad you came!)");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"** Welcome to Thinking in C **\00"
@.str.1 = [27 x i8] c"(You'll be glad you came!)\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"** Welcome to Thinking in C **\00"
@.str.1 = [27 x i8] c"(You'll be glad you came!)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void setComponent(double *v, double d, double dP) {
  v[0] = d, v[1] = dP;
  v[2] = v[1] - v[0];
}


x86 assembly (clang, -O0):
<setComponent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setComponent>:
movsd  %xmm0,(%rdi)
movsd  %xmm1,0x8(%rdi)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdi)
ret

LLVM IR (-O0):
define void @setComponent(double* %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double, double* %6
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
store double %10, double* %12
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = fsub double %15, %18
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 2
store double %19, double* %21
ret void
}

LLVM IR (-O2):
define void @setComponent(double* nocapture writeonly %0, double %1, double %2) {
store double %1, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
store double %2, double* %4
%5 = fsub double %2, %1
%6 = getelementptr inbounds double, double* %0, i64 2
store double %5, double* %6
ret void
}
int _func_xpath_ignore(char *chunk, void *data) { return 1; }


x86 assembly (clang, -O0):
<_func_xpath_ignore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_func_xpath_ignore(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
const char *bindex(sp, ch)
register const char *sp;
int ch;
{
  register const char c = ch, *r;
  r = sp;
  while (*sp) {
    if (*sp++ == c)
      r = sp;
  }
  return r;
}


x86 assembly (clang, -O0):
<bindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <bindex+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <bindex+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1119 <bindex+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bindex>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <bindex+0x34>
movsbl %sil,%edx
lea    0x1(%rax),%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %ecx,%edx
cmove  %rsi,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <bindex+0x20>
ret

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

LLVM IR (-O2):
define i8* @bindex(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %16, %8 ]
%10 = phi i8* [ %0, %5 ], [ %15, %8 ]
%11 = phi i8* [ %0, %5 ], [ %12, %8 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = sext i8 %9 to i32
%14 = icmp eq i32 %7, %13
%15 = select i1 %14, i8* %12, i8* %10
%16 = load i8, i8* %12
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8* [ %0, %2 ], [ %15, %8 ]
ret i8* %19
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
unsigned long gfx_get_vid_register_base(void) {
  return gfx_pci_config_read(0x8000091C);
}


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

x86 assembly (clang, -O2):
<gfx_get_vid_register_base>:
mov    $0x8000091c,%edi
jmp    1030 <gfx_pci_config_read@plt>

LLVM IR (-O0):
define i64 @gfx_get_vid_register_base() {
%1 = call i64 @gfx_pci_config_read(i32 -2147481316)
ret i64 %1
}

LLVM IR (-O2):
define i64 @gfx_get_vid_register_base() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147481316)
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void *, size_t);
ssize_t i2c_write(int fd, void *buf, size_t count) {
  return write(fd, buf, count);
}


x86 assembly (clang, -O0):
<i2c_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @i2c_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void main(void) {
  volatile unsigned long *val = (volatile unsigned long *)0x1234;
  int i;
  if (val[0] > 25) {
    i = 7;
  }
  val[1] = i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    $0x19,%rax
jbe    1125 <main+0x25>
movl   $0x7,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x1234,%rax
movq   $0x7,0x123c
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i64*
%2 = alloca i32
store i64* inttoptr (i64 4660 to i64*), i64** %1
%3 = load i64*, i64** %1
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load volatile i64, i64* %4
%6 = icmp ugt i64 %5, 25
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 7, i32* %2
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = load i64*, i64** %1
%12 = getelementptr inbounds i64, i64* %11, i64 1
store volatile i64 %10, i64* %12
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = load volatile i64, i64* inttoptr (i64 4660 to i64*)
store volatile i64 7, i64* inttoptr (i64 4668 to i64*)
ret void
}
int bal(signed char *x) {
  int i;
  signed char *xx = __builtin_assume_aligned(x, 8);
  for (i = 0; i < 32; i++)
    xx[i] = xx[i] >= 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<bal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1155 <bal+0x55>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <bal+0x17>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bal>:
pxor   %xmm0,%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
pxor   %xmm3,%xmm3
pcmpgtb %xmm1,%xmm3
movdqu %xmm3,(%rdi)
pcmpgtb %xmm2,%xmm0
movdqu %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define i32 @bal(i8* %0) {
%2 = bitcast i8* %0 to <16 x i8>*
%3 = load <16 x i8>, <16 x i8>* %2
%4 = ashr <16 x i8> %3, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
%5 = bitcast i8* %0 to <16 x i8>*
store <16 x i8> %4, <16 x i8>* %5
%6 = getelementptr inbounds i8, i8* %0, i64 16
%7 = bitcast i8* %6 to <16 x i8>*
%8 = load <16 x i8>, <16 x i8>* %7
%9 = ashr <16 x i8> %8, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
%10 = bitcast i8* %6 to <16 x i8>*
store <16 x i8> %9, <16 x i8>* %10
ret i32 undef
}
/* Type definitions */
struct pbst_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ tree_to_vine(struct pbst_table *);
int /*<<< orphan*/ update_parents(struct pbst_table *);
int /*<<< orphan*/ vine_to_tree(struct pbst_table *);
void pbst_balance(struct pbst_table *tree) {
  assert(tree != NULL);
  tree_to_vine(tree);
  vine_to_tree(tree);
  update_parents(tree);
}


x86 assembly (clang, -O0):
<pbst_balance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <tree_to_vine@plt>
mov    -0x8(%rbp),%rdi
call   1040 <vine_to_tree@plt>
mov    -0x8(%rbp),%rdi
call   1060 <update_parents@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbst_balance>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <tree_to_vine@plt>
mov    %rbx,%rdi
call   1040 <vine_to_tree@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <update_parents@plt>

LLVM IR (-O0):
%struct.pbst_table = type { i32 }
define void @pbst_balance(%struct.pbst_table* %0) {
%2 = alloca %struct.pbst_table*
store %struct.pbst_table* %0, %struct.pbst_table** %2
%3 = load %struct.pbst_table*, %struct.pbst_table** %2
%4 = icmp ne %struct.pbst_table* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.pbst_table*, %struct.pbst_table** %2
%8 = call i32 @tree_to_vine(%struct.pbst_table* %7)
%9 = load %struct.pbst_table*, %struct.pbst_table** %2
%10 = call i32 @vine_to_tree(%struct.pbst_table* %9)
%11 = load %struct.pbst_table*, %struct.pbst_table** %2
%12 = call i32 @update_parents(%struct.pbst_table* %11)
ret void
}

LLVM IR (-O2):
%struct.pbst_table = type { i32 }
define void @pbst_balance(%struct.pbst_table* %0) {
%2 = icmp ne %struct.pbst_table* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @tree_to_vine(%struct.pbst_table* %0)
%6 = tail call i32 @vine_to_tree(%struct.pbst_table* %0)
%7 = tail call i32 @update_parents(%struct.pbst_table* %0)
ret void
}